Foundations
Gates and the Adder
The same truth tables, built out of wire, and then wired into something that adds. This is where a machine stops being magic.
Begin — Unit 01 →What this is
Truth Tables taught you that AND, OR and XOR each have a complete description: a grid
listing every case. Counting in Twos taught you that a number is a row of switches.
Put those together and something surprising falls out. Those grids can be built. Not simulated, not described. Built, out of parts that hold a signal on a wire. And once you have built them, they will do arithmetic.
By the end of this module you will have assembled an adder from three tables you already know, and understood every part of it.
Who it’s for
Anyone who has ever wondered what a processor is.
Not what it does, which you can read anywhere. What it is made of, at the bottom, where the explanations usually stop and say “and then it adds the numbers”.
What you need first
Both of the modules above.
You need Truth Tables, because a gate is a truth table and nothing else. You need Counting in Twos, because an adder adds binary numbers, and watching a carry ripple along a chain means nothing if you do not know what a carry is.
This gates nothing in turn. Nothing later in the curriculum requires it. It is here because it is one of the most satisfying things a beginner can learn, and because after it the word “hardware” stops sounding like a different subject.
The shape
- The same table, drawn — a gate is a truth table with wires. Set the inputs and watch the output follow.
- The half adder — add two bits and you need two answers, a sum and a carry. One is
XORand the other isAND. That is the entire circuit. - The full adder and the ripple — accept a carry as well as produce one, then chain them together and add whole numbers.
What it is not
This is not electronics. There are no transistors here, no voltages and no soldering. A wire carries a 1 or a 0, and that is as deep as we go.
It is also not a shortcut into assembly. Knowing how an adder works will not make you write better code. It will make the machine you are writing code for stop being a mystery, which turns out to matter more than it sounds.