Open the door of your microwave oven and look at the back wall. Behind it sits a vacuum tube, the same family of device that ran every radio, television, and computer on Earth until the late 1950s. It is called a magnetron, it puts out about a kilowatt of radio energy to heat your dinner, and no transistor made today can do that job as cheaply. Now go and start your car. The click you hear when you turn the key is a relay, and so are the switches behind the headlamps, the horn, and the fuel pump: a device older than the vacuum tube, older even than the light bulb, still doing the job because nothing has beaten it at that job.
I have wanted to write this series for a long time. Jon Stokes's book Inside the Machine is the thing that taught me how a processor actually works. It starts with nothing more than a light switch and ends with the real chips of its era, the Pentium 4 and the PowerPC G5, and by the end you can read a spec sheet and understand what every line means. It is also, by design, a book about the CPU. The GPU gets a passing mention. This series is my attempt at the same journey for the graphics processor, from the switch all the way up to Nvidia's Ada, Hopper, Blackwell, and Vera Rubin. No prior electronics needed. If you have read ML Basics or LLM Basics, you already know the one calculation we will follow the whole way: the neuron's w × x + b, a multiply and an add. A language model does trillions of those per second. The question this series answers is how a slab of silicon manages it.
Stokes starts with the switch. I want to start one step earlier, with the switches that came before the transistor, because the transistor only makes sense as an answer to their problems, and because those older devices are still all around you, doing the jobs where they were never beaten. But before any of that, it is worth being clear about what we are trying to build.
What a computer is, in the simplest terms
Strip a computer to the bone and it is a machine that takes in numbers, combines them by following a list of instructions, and puts numbers out. The numbers can stand for anything: a price, the colour of a pixel, the weight w in our running calculation. The instructions are things like "add these two", "compare these two", and "if the first was bigger, do this next instead of that". Everything a computer has ever done, from a payroll to a video game to a chatbot, is an enormous number of those small steps done very fast.
The trick that makes such a machine buildable at all is to write every number using only two symbols. Instead of the digits 0 to 9, use just 0 and 1, and let a wire that carries a current mean 1 and a wire that does not mean 0. Part 4 goes through this properly. For now the point is what it buys you: once every number is a pattern of on and off, every operation the computer performs becomes a question about switches.
Look at the four circuits above. The first two are the same circuit with the switch open and then closed: a single switch and a lamp is one bit, and the lamp shows whether the switch is on. The last two both have one switch open and one closed, and they disagree about the lamp. Put two switches in series on the same wire and the lamp lights only if both are closed, which is the logical idea AND, so one open switch is enough to keep it dark. Put them on parallel branches and it lights if either is closed, which is OR, so one closed switch is enough to light it. Add a switch that is arranged to be on when its input is off, which is NOT, and Part 4 shows that those three arrangements, repeated, will add two numbers, compare them, and remember the result. That is a computer. Everything else is quantity.
There is one catch, and the whole of this part hangs on it. In the circuits above, the switches are closed by a finger. For a computer, the lamp at the end of one arrangement has to be the finger on the next: the output of one group of switches must be able to flip the input of another, with no person in between. That needs a switch that electricity itself can flip. Such a switch is the one component a computer cannot do without, and there have only ever been three kinds: the relay, the vacuum tube, and the transistor. The history of computing is the history of a better one.
The one thing electronics needs
The same requirement turns up outside computers, in a broader form. Every electronic device, from a hearing aid to a data centre, is built on a single trick: a small electrical signal controlling a large one. A radio takes a signal from the aerial too faint to hear and makes it strong enough to drive a loudspeaker. A telephone repeater takes a voice that has faded over a hundred miles of wire and restores it. A computer takes the tiny voltage that means "1" on one wire and uses it to decide whether another wire will be "1" or "0". The first two are called amplification, the third is switching, and they are the same trick at different settings. A component that can do it is called active.
Side note: the passive components. Everything else on a circuit board is passive: it shapes, stores, or resists current, but it cannot make a small signal control a large one. There are three that matter. A resistor restricts the flow, the way a narrow pipe restricts water, and is what stops an LED from drawing so much current that it burns out. A capacitor stores charge briefly and gives it back, like a small tank with a spring-loaded lid, and is what smooths the lumpy output of a power supply and what a camera flash charges up before it fires. An inductor is a coil of wire that resists changes in current, and is the heart of every transformer, including the one inside your phone charger. A circuit made only of these three can filter, delay, and tune, which is how the earliest radios selected a station, but it can never amplify. For that you need one of the three active devices, and this part and the next two are about them.
The light switch, and the finger problem
Start with the switch on your wall. It sits in the same loop of wire as the lamp: the current that lights the room passes through the switch itself, and the thing that decides whether it flows is your finger, which is outside the circuit altogether. That is fine for a room. It is useless for a machine, because a machine has no finger. What we want is a switch whose "finger" is another electric current, so that one circuit can decide what happens in a second circuit.
The relay is exactly that, and it is the oldest device that does it. It is an electromagnet placed next to a switch. Run a current through the coil and the iron core becomes a magnet, which pulls a hinged iron arm, the armature, towards it. The arm carries a contact, and when it moves it closes a gap in a second, completely separate circuit. Stop the current in the coil, the magnet dies, and a spring pulls the arm back, opening the gap again. The coil circuit is the controlling circuit, the contact circuit is the controlled circuit, and the only thing that passes between them is the pull of a magnet.
Hold onto the drawing on the right, because every strength and every weakness of the relay is visible in it: the coil, the iron core, the arm on its pivot, the spring, the gap between the contacts.
Where the relay came from: the telegraph
The relay was invented in the 1830s to solve a problem with the telegraph, and the telegraph is worth a moment because it is the first machine that sent information as on and off.
A telegraph is a battery, a switch, and a very long wire. The switch is the key, a lever the operator presses with a finger. At the far end, the wire runs through an electromagnet with a small iron arm above it, the sounder. Press the key and current flows down the line, the electromagnet pulls the arm down with a click, and when the key is released the arm springs back with a second click. A short press is a dot, a long press is a dash, and Samuel Morse's code turns dots and dashes into letters. The circuit is completed through the earth itself, with a metal plate buried at each end, so that only one wire has to be strung. It is the light-switch circuit from the last figure, with the lamp replaced by a clicker and the wire made forty miles long.
The problem was distance. A wire resists current, and after a few dozen miles the current arriving at the far end was too feeble to pull a sounder's arm with a satisfying click. Joseph Henry is usually credited with the answer, around 1835. Make the electromagnet at the far end pull a very light, very sensitive arm, and instead of clicking, let that arm close a contact that connects a fresh battery to the next section of line. The weak signal arriving from the west does not have to push the current all the way east. It only has to flip a switch, and the fresh battery does the pushing. The message relays itself onward, station by station, which is where the name comes from, and what has been built is a switch flipped by a weak current that controls a strong one.
That is the whole relay, and by 1837 it was in the telegraph patents of Edward Davy and Samuel Morse. A century later, people noticed that the same device would do for the AND and OR of the first figure, and built computers out of it.
What "switching enormous currents" means
The relay's first virtue is the one the telegraph needed: the current that flips it can be tiny, and the current it controls can be as big as you like. To see why that matters, it helps to be clear about what current is. Current is the rate at which charge flows through a wire, measured in amps, and you can think of it as litres per second in a pipe. A phone charger pushes about two amps into a phone. A kettle draws around ten. The starter motor that turns over a cold car engine draws somewhere between one and two hundred amps for a few seconds, and a big current has consequences. A wire carrying it has to be thick, or it heats up, which is why the cable from your car battery to the starter is as thick as your finger. And a switch that opens while a big current is flowing draws a spark, an arc, across the opening contacts, which pits and eventually welds them.
Now imagine that starter switch was the key in your dashboard. A finger-thick cable would have to run from the battery, up through the steering column, to a switch under your hand, and back, and every start would arc inside it. Instead, the key switches a fifth of an amp, through a thin wire, into the coil of a relay bolted next to the battery. The relay's contacts, which are heavy copper built for the job, carry the two hundred amps over a few inches of cable to the motor. The thin wire and the small switch decide. The thick wire and the big contacts deliver.
The same arrangement is behind every headlamp, horn, and fuel pump relay in the car, the contactor that starts a lift motor or an air conditioner's compressor, and the relay boards inside industrial machinery, where a control computer with wires the thickness of a hair switches motors that draw hundreds of amps.
Keeping the dangerous side away
The relay's second virtue follows from the same drawing, and it is about safety rather than size. Look again at the relay figure: the controlling circuit and the controlled circuit share no wire. The only thing that passes from one to the other is a magnetic field across an air gap. Engineers call this isolation, and it is what lets a delicate, low-voltage circuit board control something that would destroy it.
The mains supply in your house is 230 volts (120 in North America), which is enough to kill a person and far more than enough to destroy a microchip. The chip in a thermostat, a washing machine controller, or a smart plug runs on three to five volts and can supply a few thousandths of an amp from one of its pins. It cannot switch a boiler or a heating element directly. So the chip's pin drives the coil of a relay, with a few volts and a few milliamps, and the relay's contacts, on the other side of the gap, carry the mains to the heater. If the mains side arcs, spikes, or shorts, none of it reaches the chip, because there is no wire for it to travel along. The relay is a wall with a magnet in it.
There is a third virtue, less obvious. When a relay is off, it is off: a physical air gap, not a component that merely conducts very little. For a safety interlock, the door switch on an industrial press, the cut-out that isolates a faulty power line at a substation, that certainty matters, which is why the boxes that make those decisions are still called protective relays even now that most of them are computers inside.
Why it is slow, and why it wears out
Now the weaknesses, and they are visible in the same drawing. To close the contacts, the relay has to move a lump of metal: the magnet must pull the armature down through the air gap, which is about a millimetre, and the spring must pull it back. Iron has mass, and moving it takes time. A small relay operates in five to ten milliseconds, so it can switch at most a few hundred times a second, and a big one is slower.
Every closing bounces the contacts a little and every opening draws that small arc, so the contacts pit, roughen, and after a few million operations stick or fail. A relay is the size of a sugar cube at best, because the coil needs turns of wire and the armature needs room to swing. It draws a steady current the whole time it is on, to hold the arm against the spring. And it is either open or closed, nothing in between, so it can switch a signal but cannot strengthen one: it is useless for a radio or a telephone.
People did build computers out of them, because the AND and OR of the first figure are exactly what a relay's contacts do, and a relay's coil can be driven by another relay's contacts, which is the "no finger" requirement met. Konrad Zuse's Z3 in 1941, the first working programmable computer, used about 2,600 relays and could manage a multiplication in three seconds. The Harvard Mark I in 1944 ran on 3,500 relays and could be heard from the next room. And the most famous computer bug was literally a moth, crushed in a relay of the Mark II in 1947 and taped into the logbook as the "first actual case of bug being found", which was a joke, because engineers had been calling faults bugs since Edison. A relay computer is a wonderful thing to listen to and a hopeless thing to scale: at a few hundred operations a second, our running calculation w × x + b would take most of a second, and a modern GPU does tens of trillions of them in that time.
Where this leaves us
A computer is switches arranged so that the output of one group flips the input of the next, and for that you need a switch that electricity itself can flip. The relay was the first. A small current in a coil pulls an iron arm and closes a separate circuit, and that separation is the source of everything it is good at: a fifth of an amp at the ignition key commanding two hundred amps at the starter, a five-volt chip switching a mains heater without the mains ever touching it, and an air gap that is truly open when it is open. It is also the source of everything it is bad at. An arm has to move, so the relay is slow. Contacts spark, so it wears. A coil needs turns of wire, so it is big. And it is only ever open or closed, so it can switch a signal but never strengthen one.
Zuse and Aiken built real computers from relays and proved the idea. At a few hundred operations a second, though, the idea was all they could prove. The next part is about the device that could do the relay's job a thousand times faster and could also do the one thing the relay never could, make a faint signal strong. It was found by accident inside a light bulb.
Next: The Vacuum Tube: from Edison's lamp to the diode and the triode, what a one-way valve is for, the machines the tube built, why it could never be small or cool enough, and how the transistor fixed exactly those problems.