Science for Kids
Technology

How does a chip add two numbers when it cannot count?

August 5, 202610 min read

A round polished silicon wafer tilted to the light, covered in a grid of identical small square chips

You grab the last coin and the score in the corner of the screen jumps from 1,180 to 1,230. It changed while your thumb was still moving. Something under the glass added fifty to one thousand one hundred and eighty and got it right. But nothing in there can count, and nothing in there has ever met the number fifty. So what did the arithmetic?

Nothing did. A chip is a crowd of switches, and a switch has no opinions whatsoever: it lets electricity past, or it does not, depending on its neighbors. Line enough of them up in the right shape and the answer appears on the wires by itself.

A wire has only two things to say

Electricity traveling along a wire is a current, a drift of electrons: the tiny charged particles that metals are full of. A wire either carries one or it does not, because a wire that is halfway on is unreliable. So every wire gets exactly two conditions, and one wire’s worth of on-or-off is a bit.

We call one condition “1” and the other “0”, and the wire never agreed to this. It knows no difference between them. The digit is our invention, recorded nowhere except inside our own heads.

Writing fifty that way needs a trick you already own. Ordinary counting is decimal: every column is worth ten times the column on its right. Wires have two conditions instead of ten digits, so each column is worth twice the one on its right: ones, twos, fours, eights, sixteens. That is binary.

2 × 2 × 2 × 2 = 16 patterns

Four wires, two conditions each: enough patterns for every number from zero to fifteen.

Every extra wire doubles the reach. Eleven of them hold your score of 1,230 comfortably, and the chip inside a phone, its processor, works in rows of sixty-four.

A row of wires therefore holds any number, once we agree what each column is worth. Nothing has been added yet, though: two rows are lying there, waiting to become a third.

You have been carrying since you were six

Try this where you are sitting: add 7 and 5 in your head. You got twelve, and writing it down you would put a 2 in the ones column and push a 1 into the tens.

That shape never changes. One column of a sum has two answers rather than one: the digit you write, and the digit you carry.

Now try it where a column holds only on or off. Off and off gives off. One on and one off gives on, whichever way round they sit. On and on gives off, carrying an on into the next column, because two is impossible here.

Only two questions are hiding in those four possibilities. Were both wires on? Then carry. Was exactly one wire on? Then write.

Two yes-or-no questions, four situations to get right: that is the entire job of addition, however enormous the numbers. The difficulty is that something unable to read has to answer them.

A switch with a wire for a handle

A light switch needs a finger. The switch inside a chip is a transistor: microscopic, with no moving parts and a wire for a handle. Send a current down the handle and it closes; remove the current and it opens.

Put two of them in a line, one behind the other, so current leaving the battery must get past the first before it can reach the second. Nothing emerges from the far end unless both handles are on. Call that the both-rule.

Two coils of copper wire mounted one behind the other on a wooden board, wired to a glowing lamp
Two switches in a line, each held shut by an electromagnet. The lamp lights only if current gets past both.

Put them side by side instead, on separate paths that rejoin at the end. Current escapes if either handle is on, since it needs only one open road. Call that the either-rule.

A clump of switches wired to answer one yes-or-no question is a gate: two in a line make a both-gate, two side by side an either-gate. The carry question is therefore solved by two switches. Only the awkward one is left — exactly one, meaning either, but not both.

Either, but not both

Take an either-gate and hang one more switch on its way out, wired backwards so that it sits closed until a current reaches its handle. Feed the both-gate’s outgoing wire into that handle.

Two wires off, and the either-gate passes nothing, so nothing emerges. Exactly one wire on, and the either-gate passes current while the both-gate stays silent; the last switch stays shut and the current arrives immediately. Both wires on, and the either-gate passes current again — but the both-gate is now pushing current into the last switch’s handle, holding it open. Nothing arrives.

That final wire carries the digit you write, and the both-gate’s own outgoing wire carries the digit you carry. Together they are one column of a sum, assembled from five switches, and the arrangement is called an adder.

Nothing in it remembers what a number is, and nothing counts. One column is not a whole sum, though, and your score needs eleven of them.

One box per column, and a carry that travels

Copy that box of five switches eleven times, one per column, and stand them in a row. Then wire every box’s carry into the box on its left, precisely as your pencil does when it pushes a 1 into the next column.

A box that must also accept an incoming carry needs several extra switches, since it has three wires to add. The rules survive intact: carry if two or three are on, write if an odd number are on.

Everything then happens at once. Every box is already watching its own wires, and answers appear almost instantly, as fast as electricity crosses five switches.

The single slow part is a carry making its journey left, one box at a time — a property of the row, not the numbers.

Every photograph on your phone and every message you have sent was assembled by clumps of switches like these, and by nothing else.

All of it fits on a slab of silicon about 1 cm(0.4 in) on a side, smaller than your thumbnail. Nobody discovered these rules by staring at a chip, though.

The algebra that waited eighty years

In 1854, when your great-great-great-grandparents were children, George Boole published An Investigation of the Laws of Thought. He was a professor of mathematics in Cork, in Ireland, and he wanted the rules of ordinary reasoning written down as sums.

His algebra was a rulebook for combining two values, true and false, using three moves: and, or, not. Those are the both-rule and the either-rule, set out in ink. Boole died ten years later, having never seen a switch.

The book sat on philosophy shelves for eighty years. Then in 1937 a twenty-one-year-old engineering student in Massachusetts, Claude Shannon, spent a summer inside a telephone laboratory. It was full of relays: clacking metal switches operated by other switches instead of fingers. He saw that the relays and Boole’s algebra were the same thing in different clothes, and wrote it up in his master’s thesis that August.

Two women in 1940s clothes at a wall of dark panels studded with rows of glowing glass tubes
Pennsylvania, 1945. Thirty-six glass tubes held one ordinary digit.

The old way still took years to die. In 1945 Presper Eckert and John Mauchly finished ENIAC, a room-sized electronic calculating machine at a university in Pennsylvania. It still counted in tens, because people had to type numbers in and read numbers out. ENIAC ran 30 meters(100 ft) around the walls, about the length of a basketball court, and one ordinary digit cost thirty-six glass tubes, each one a switch. Two conditions would have cost two.

Run the whole thing by hand

A child’s hands laying out small paper squares on a table, orange side up and white side up
Colored side up means on. Turning a square over is the only move you get.

You will get the right answer, without once thinking about how large the numbers were. Four columns, four goes, two rules — and the biggest pair they hold takes the same four goes. That is a chip, working at one column every ten seconds instead of far too fast to watch.

The number was never in the chip

Go back to the score in the corner of the screen. Eleven boxes of switches took two rows of on and off, and electricity found the only paths still open to it. Nothing counted. Nothing knew what fifty meant.

The piece hiding in plain sight is the agreement we made at the beginning. We decided that a wire with a current in it means one, and that each column is worth twice the one to its right. Removing that agreement changes nothing inside the chip: the same switches close, the same wires light up, the same answer waits.

Read that row by a different agreement and it becomes something else entirely. It is a letter of the alphabet, or the exact blue of one dot on your screen, or a hundredth of a second of a recording. The chip cannot understand which you meant, and it has never needed to. It only ever had to be a shape that electricity has one way through.

Liked this? Take it with you.