Bitwise operations are fast, simple arithmetic operations and logic gates that are done on an individual bit level from a sometimes multiple bit strings. Unary operations are operations that are done with a single bit string, while binary operations are done with 2 bit strings. These bit strings are called operands.

Warning

Before reading, make sure you have read the page on binary.

Bitwise operationsfunctionalityexample
NOT/ComplementUnary operation. Flips to the opposite valueNOT 1011
= 0100
ANDBinary operation. Checks if pair are the same value, otherwise 0.001
AND 101
= 001
ORBinary operation. Returns 1 if 1 is found in either of the pair.0101
OR 0001
=0101
XORBinary operation. AKA Exclusive OR. Returns 1 if 1 is found in only one of the pair.0101
XOR 0001
= 0100