The XOR (Exclusive-OR) Gate

The Exclusive-OR (XOR) gate is an element of strict choice. It solves a logical problem that the regular OR gate cannot handle.

XOR lets a signal ("1") pass only if its inputs have different values. If there is a one at the first input and a zero at the second, the current will pass. If it's the other way around, it will also pass. But if you apply two identical signals to the inputs (two zeros or two ones), the gate will close and output a zero.

XOR gate

Visually, it looks almost the same as the OR gate shield, but an additional curved line is added on the input side.

This is one of the most important gates in all of digital electronics. Why? Because it is the heart of computer mathematics. If a regular OR can be compared to the rule "you can eat an apple, or a pear, or both together," then XOR is the strict rule "either one or the other, but not both at once." Adders are built on the basis of XOR gates, which are exactly what allows your computer to add numbers together.

Learn to build a computer →