Exclusive disjunction
File:Venn0110.svg |
Venn diagram of [math]\displaystyle{ \scriptstyle A \oplus B }[/math] |
File:Venn 0110 1001.svg |
Venn diagram of [math]\displaystyle{ \scriptstyle A \oplus B \oplus C }[/math] File:Venn 0110 0110.svg [math]\displaystyle{ ~\oplus~ }[/math] File:Venn 0000 1111.svg [math]\displaystyle{ ~\Leftrightarrow~ }[/math] File:Venn 0110 1001.svg |
Exclusive disjunction (also called exclusive or, XOR) is a Logic operation on two values. It will be true, if exactly one of the two values is true. Otherwise it will be false. This also means that the result of 'XOR' will be true only if both the values are different. Same values will result in a false.
The best way to remember a XOR operation is: "One or the other, but not both".
This is different from inclusive disjunction.
Truth table
The truth table of [math]\displaystyle{ p\, \mathrm{XOR}\, q }[/math] (also written as [math]\displaystyle{ p \oplus q }[/math], or [math]\displaystyle{ p \neq q }[/math]) is as follows:
p | q | ⊕ |
---|---|---|
F | F | F |
F | T | T |
T | F | T |
T | T | F |