Post

You know how numbers can be represented in binary? Here's some example numbers: 01010101 (85 in decimal) 00110011 (51 in decimal) So some digits are ones and some are zeroes. Bitwise operators are like math on a per-binary-digit level. 1/5

So for "OR" the Nth digit of the result is 1 if the Nth digit of either number is 1. So 01010101 OR 00110011 = 01110111. For "AND" the Nth digit of the result is 1 if the Nth digit of both numbers is 1, and 0 otherwise. So 01010101 AND 00110011 = 00010001. 2/5

For "XOR" the Nth digit of the result is 1 if the Nth digit of both numbers do not match, and 0 otherwise. So 01010101 XOR 00110011 = 01100110. NOR, NAND, and XNOR are just the opposites day versions of the above. You change all the ones into zeroes and your zeroes into ones afterwards. 3/5