XOR Gate

Truth table for an XOR gate
Input AInput BOutput
falsefalsefalse
falsetruetrue
truefalsetrue
truetruefalse

An XOR gate (sometimes referred to by its extended name, Exclusive OR gate) is a digital logic gate with two or more inputs and one output that performs exclusive disjunction. The output of an XOR gate is true only when exactly one of its inputs is true. If both of an XOR gate's inputs are false, or if both of its inputs are true, then the output of the XOR gate is false.

If an XOR gate has more than two inputs, then its behavior depends on its implementation. In the vast majority of cases, an XOR gate will output true if an odd number of its inputs is true. However, it's important to note that this behavior differs from the strict definition of exclusive or, which insists that exactly one input must be true for the output to be true.

The truth table for an XOR gate with two inputs appears to the right.

Symbols

Each of the symbols below can be used to represent an XOR gate. There are multiple international standards defined, and one may preferred over the other in your region of the world.

ASNI / IEEEIEC
ANSI / IEEE XOR Gate symbol IEC XOR Gate symbol

Live Example

Try the following interactive example to see for yourself how an XOR gate behaves.

Please ensure that Adobe Flash Player 10.2 or greater is installed.

Further Reading

To learn more, check out the following external resources:

« Table of Contents


Warning: include(../../footer.php) [function.include]: failed to open stream: No such file or directory in /nfs/c04/h01/mnt/61271/domains/logic.ly/html/lessons/xor-gate/index.php on line 87

Warning: include() [function.include]: Failed opening '../../footer.php' for inclusion (include_path='.:/usr/local/php-5.3.29/share/pear') in /nfs/c04/h01/mnt/61271/domains/logic.ly/html/lessons/xor-gate/index.php on line 87