Previous | ToC | Next Labs: Cryptography. Part 1. Math Alive

There is another additive operation on binary numbers that is very useful. It is called "parity" addition or "XOR" (The word XOR originated from exclusive-OR). We still call it addition because this operation has many properties in common with standard decimal (or binary) addition: it is commutative and associative, and "adding" zero to a number doesn't change the number. Parity addition is similar to binary addition, except that there is never a carry.
To distinguish them we will denote the parity addition by . For parity addition we have:

0 0 = 0
0 1 = 1
1 0 = 1
1 1 = 0 .

We can formulate the rule: parity adding two identical digits gives 0, while parity adding two different digits gives 1. (Note: many software developers have adopted the word "XOR" in their language. For example: Tomorrow I will go to the movie xor to the park. This means that I will go to exactly one of them, not both.)
To distinguish this addition from binary addition people use a special symbol for parity addition or each time they say explicitly that they use parity addition. (The default addition, or what is meant by addition if no additional qualifier is given, for binary numbers is the addition we've learned on preceding pages.)

Note. When we parity add two binary numbers of different length, we add leading zeros to the smaller number, so both numbers would become the same length. Sometimes, we say that we parity add binary strings.