Bitwise XOR: 1011 0110 ^ 0110 1101 — XOR gate
coredifference mask between two bytes
Answer
11011011
Why this example is worth doing
The result marks every bit position where the two bytes differ, and counting the 1s in it gives the Hamming distance between them — the link this page makes to the coding-theory half of the site. The page also notes the self-inverse property: applying the same mask twice restores the original, which is why XOR is the operator behind both simple encryption and in-place swaps.
Try your own input in the XOR gate. Truth table, symbol and algebraic form for A ⊕ B, the difference detector.
How the answer is reached
Column by column
A10110110
B01101101
result11011011
| bit | A | B | result |
|---|---|---|---|
| 7 | 1 | 0 | 1 |
| 6 | 0 | 1 | 1 |
| 5 | 1 | 1 | 0 |
| 4 | 1 | 0 | 1 |
| 3 | 0 | 1 | 1 |
| 2 | 1 | 1 | 0 |
| 1 | 1 | 0 | 1 |
| 0 | 0 | 1 | 1 |