History: how machines learned to add

The carry is the hardest part

People added on the abacus too, bead by bead. The trouble was the carry: when a digit reached ten, it had to be cleared to zero and one added to the next digit.

before: 19hundredstensunitson the abacus = 19+1after: 20on the abacus = 20the tenth unit bead does not fit: all ten go back, one goes into the tens
A Russian abacus: each digit is a wire with ten beads, the counted ones moved left (the two dark ones in the middle help counting by eye). Adding 1 to 19 means doing the carry by hand: clear the units and add a bead to the tens.

In 1642 Blaise Pascal built a calculating machine for his father, a tax official, in which the carry happened by itself: a wheel going from 9 to 0 pushed the next one. Thirty years later Gottfried Leibniz invented the stepped drum, and a century later his idea grew into arithmometers — calculating machines found in every office until the 1970s.

01234567890123456789012345678901234567890123456789levers: set the number 207crank: one turn —adds00000414result02turn counter207 × 2 = 414: two turns of the crankshift
An arithmometer: the levers set a number, one turn of the crank adds it to the result windows — with the carry between digits done inside. Two turns multiply by 2. Shifting the carriage by one digit multiplies by 10: that is how column multiplication was done.

Leibniz also described the binary system: just two digits, 0 and 1. It was awkward for wheels, but perfect for anything that can only be on or off.

Relays on a kitchen table

In 1937 George Stibitz, an engineer at Bell Labs, built a binary adder at home on his kitchen table from two telephone relays, a battery and light bulbs. A lit bulb meant 1, a dark one 0 — exactly what you build in the first lesson. His "Model K" (for kitchen) later grew into a relay calculator that in 1940 computed over a telephone line from another city.

In the same years Konrad Zuse in Berlin built binary computing machines: the mechanical Z1 and the relay Z3 (1941) — the first working programmable computer. Its adder was the heart of it all, too.

An adder in every processor

Relays gave way to vacuum tubes, tubes to transistors, transistors shrank into chips. But the adder stayed: every processor subtracts, compares and computes addresses with the same adder. Since the 1960s almost every machine writes negative numbers in two's complement — then subtraction needs no separate circuit.

The first microprocessor, the Intel 4004 (1971), was made for a calculator, so it could also count in decimal digits — the DAA instruction, "decimal adjust". The 6502, the processor of the Apple II and the NES, has a decimal mode for it. That is the "+6" correction of the bonus lesson.

Intel, Apple, Nintendo and Bell Labs are trademarks of their respective owners. This kit is not affiliated with or endorsed by them; the names are mentioned to tell the story.