How a Computer Works: A View from 2026
It has been many years since I read Charles Petzold's book Code: The Hidden Language of Computer Hardware and Software, in which he describes how a computer is built from first principles starting with transistors. And he tells the story so engagingly that I wanted to repeat it myself. Just pick up some wire, light bulbs and batteries, build simple relays, build logic out of the relays, then swap all of it for transistors and start assembling a simple system one that can add two numbers, for example.
The image below shows exactly that: the schematic of a device that adds two numbers, with the limitation that neither number can be greater than 15.

At the same time, I understood that this was too complex and tedious a project. I have friends and the internet is full of enthusiasts who have gone down this road and managed to build an adder, and some got as far as a full arithmetic core of a microprocessor. But all of it is an enormous amount of fine, painstaking work: assembling transistors by hand, and there are very, very, very many of them.

The image above shows a NOR gate, which works on this principle: the output is 1 if both inputs are 0; in every other case it outputs 0.
This gate is what you need in order to build an OR gate, which is then used to build all the rest of the math.
In short, to spare myself the wiring and I will admit I don't know how to solder and don't particularly enjoy it I decided to try building all of it inside a circuit simulator.
The microprocessor
I started simple: build an ordinary adder. Once I had done that, the book went on to explain that we can now teach it to subtract. No sooner said than done. And since we had managed addition and subtraction, we had formally taught the machine to count. All that was left was to add memory in order to organize loops multiplication, for instance, is repeated addition; we all remember from school that 2*5 = 2+2+2+2+2.
But since we want to teach our machine to work with different numbers and perform different operations, we somehow have to teach it to understand which operation we are asking for and off it went. The result was a full arithmetic logic unit.
Unit economics & financial modeling in practice
50€/year
less than €1/week · billed annuallyPlus: theme customization, font settings, article printing and image zoom.
Subscribe to get access.
If you're already a customer, just log in.
we do not store your email, only the encrypted hash, which increases the security of your email.