XOR gate

An XOR logic gate (short for ‘exclusive oR gate’) takes two input signals and produces an output signal that is 1 if exactly one of the input signals is 1.

In other words, the output will be 1 if the input signals are different from each other; if both input signals are the same (both 0 or both 1), the output will be 0.

Truth table

The truth table for it looks like:

Input AInput BOutput (A XOR B)
000
011
101
110

Making an XOR gate

An XOR gate can also be said to be ‘A OR B AND NOT (A AND B)’.

This means that you can create an XOR gate by combining OR, AND, and NOT gates together.