XOR identities

XOR with 0, with itself, or with 1 — three handy patterns in one picture. A ready-made basics circuit you can open in the TorchAnvil simulator.

XOR, three ways

XOR is "is the sum odd?" — it outputs 1 when an odd number of its inputs are 1. That single rule gives it three very useful personalities when one input is held at a fixed value.

This sample wires the same lever A into three different XOR gates, each with a different second input: constant 0, A itself (fan-out), and constant 1.

How it works

Work through each XOR with the rule XOR(x, y) = x ≠ y:

A A ⊕ 0 A ⊕ A A ⊕ 1
0 0 0 1
1 1 0 0

Why it matters

These three identities show up all the time in real circuits:

Try this