XOR gate (exclusive OR)
Exclusive OR: the output is 1 when an odd number of inputs are 1 — with two inputs, “1 when they differ”.
Truth table
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Pins
2–8 inputs on the left, one output on the right.
How to use it
Half-adder sum S = A⊕B, spotting differing bits, parity checks. With one input as a control, it's a switchable inverter.
Usage example
Outputs 1 when the inputs differ (A = 1, B = 0 here). Used for an adder's sum bit and for checking whether two bits differ.