A really good way to think about XOR is adding mod two and not "carrying" anything:

So:

  • 0 + 0 ~= 0 XOR 0 = 0
  • 0 + 1 ~= 0 XOR 1 = 1
  • 1 + 0 ~= 1 XOR 0 = 1
  • 1 + 1 (mod 2) ~= 1 XOR 1 = 0

This really helped in my understanding of XOR a little better, especially when working with LSFR's in cryptography.