The XOR Gate
The XOR gate (exclusive or) outputs true only when its two inputs differ, and false when they match. Paired with an AND gate, XOR builds a half adder: XOR produces the sum bit and AND produces the carry bit, letting a circuit add binary numbers. XOR also underlies parity checks that catch a flipped bit in transmitted data. An advanced companion to Xoro Builds the Difference, naming the real term directly for an older audience instead of the character Xoro.
Here is a riddle: when do these two switches strike a spark? Only when they disagree, one lit and one still dark. Two lit together? Silent. Two dark together? Silent too. One lit, one dark; only then the exclusive gate rings true.
This is the XOR gate, exclusive or, pickier than plain OR, it wants a difference between its inputs, nothing more.
Flip a coin twice inside a circuit, compare the two results, XOR catches every difference, a built-in mismatch detector.
Pair it beside an AND gate, and a half adder starts to form, XOR gives the sum bit, AND gives the carry, a new number is born.
One and zero added together, the sum reads back as one, one and one added together, the sum drops out, the carry begun.
Computers use this trick to check if a message got changed in flight, flip one bit by accident, and the XOR check catches it, plain and bright.
A gate that only fires on disagreement, quietly precise, the XOR gate finds the difference hiding in plain sight.
Key Concepts: The XOR gate outputs true only when its two inputs differ, and false when they match | Pairing XOR with AND builds a half adder: XOR gives the sum bit, AND gives the carry bit | Chaining half adders together lets a circuit add binary numbers with more than one digit | XOR-based parity checks can detect a single flipped bit in transmitted data
Key Words: XOR, exclusive or, half adder, sum bit, carry bit, parity
Advanced companion note: This is the real-term companion to Xoro in xoro-builds-the-difference.md, written for an older audience directly about the XOR gate rather than through the character.
