The slide-rule collection

Gates and Adders

Logic is something a switch can do. Put switches in series and in parallel and you have AND and OR; put full adders in a row and you can watch the carry run to the left; let marbles fall through toggles and they count in binary.

Close the switches

Circuits are algebra

Shannon, 1937. In his master's thesis Claude Shannon showed that circuits of relays and switches obey Boole's algebra of logic: series is AND, parallel is OR, a contact that opens when its coil is energised is NOT. Simplifying a circuit became simplifying a formula, and the other way round.

The staircase. Two-way switches at the top and bottom of a stair, wired through two travellers, give XOR: the lamp changes whenever either switch is flipped. Electricians wired this long before anyone called it a gate.

One gate is enough. NAND alone makes every other gate: NOT a is a NAND a, AND is NAND followed by NOT, OR is NAND of the two NOTs. Relays gave way to valves and then transistors, but the algebra did not change.