If you have one or two bits you may perform certain bitwise operations upon them. Not You may apply a not operation on one bit. This flips the bit so that zero becomes one and vice versa. For two bits your options increase to and, or, and xor. And To and two bits together is to say that if both bits are one and only one then the result will be one. Otherwise, if one or both bits are zero then the result will be zero. The truth table for and follows. | 0 1
-----------
0 | 0 0
1 | 0 1 Or To or two bits is to say that if one or both bits are one then the result is one. | 0 1
-----------
0 | 0 1
1 | 1 1 Xor To xor (exclusive or) two bits is to say that if one and only one bit is one then the result will be one, otherwise zero. | 0 1
-----------
0 | 0 1
1 | 1 0