A B A | B A & B A ^ B ~A
0 0 0 0 0 1
1 0 1 0 1 0
0 1 1 0 1 1
1 1 1 1 0 0
The Bitwise NOT
00101010 42
becomes
11010101
The Bitwise AND
00101010 42
& 00001111 15
__________
00001010 10
The Bitwise OR
00101010 42
| 00001111 15
_________
00101111 47
The Bitwise XOR
00101010 42
^ 00001111 15
_________
00100101 37