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 operations | functionality | example |
|---|---|---|
| NOT/Complement | Unary operation. Flips to the opposite value | NOT 1011 = 0100 |
AND | Binary operation. Checks if pair are the same value, otherwise 0. | 001 AND 101 = 001 |
OR | Binary operation. Returns 1 if 1 is found in either of the pair. | 0101 OR 0001 =0101 |
XOR | Binary operation. AKA Exclusive OR. Returns 1 if 1 is found in only one of the pair. | 0101 XOR 0001 = 0100 |