XOR, exclusive OR, is a
logical function. Here is the
truth table for Q = A XOR B:
A|B|Q
-+-+-
0|0|0
0|1|1
1|0|1
1|1|0
For more than two inputs, XOR returns 1 if and only if an odd number of its inputs are 1. This is required to maintain the associative property. Consider:
(1 xor 0) xor 0 => 1 xor 0 => 1
1 xor (0 xor 0) => 1 xor 0 => 1
(1 xor 1) xor 1 => 0 xor 1 => 1
1 xor (1 xor 1) => 1 xor 0 => 1
but:
(1 xor 0) xor 1 => 1 xor 1 => 0
1 xor (0 xor 1) => 1 xor 1 => 0
Exclusive OR is also sometimes abbreviated EOR.
See also other logic functions: AND, OR, NOT, NAND, NOR, NXOR.