Modulo 2 arithmetic

Modulo 2 arithmetic is central to much real world error correction, so here’s a brief explanation (as much to aid my memory as anything else):

011101 + 111011 = 100110

ie,

1 + 1 = 0

1 + 0 = 1

0 + 0 = 0

0 + 1 = 1

The observant will have noticed this is equivalent to XOR, the eXclusive OR.

There is no carrying in modulo 2 arithmetic, hence subtraction generates the same result as addition, ie:

1 - 1 = 0

0 - 1 = 1

1 - 0 = 1

0 - 0 = 0