Adders: how gates do arithmetic
Nobody taught the processor to add. A handful of gates wired together produce the answer, one column at a time.
You already add binary numbers — you did it in primary school with decimal and never noticed. You add the rightmost column first, write down the result, and pass anything that overflowed to the next column on the left. That overflow is called the carry. Adding two binary digits gives only four possible cases, and two of them produce a carry.
0 + 0 = 0 carry 0
0 + 1 = 1 carry 0
1 + 0 = 1 carry 0
1 + 1 = 0 carry 1Everything a single column can doLook at that table again. The sum column is exactly XOR: 1 when the two bits differ, 0 when they are the same. The carry column is exactly AND: 1 only when both bits are 1. So a circuit that adds two bits needs no new invention — it needs one XOR gate and one AND gate. That pair is called a half adder, and it is the smallest piece of arithmetic hardware that exists.
The half adder has a gap: it has nowhere to put a carry arriving from the column on the right. Add a third input for that incoming carry and you get a full adder. It is built from two half adders plus one OR gate: the two half adders produce the sum, and the OR combines the two carries they generate. Chain 64 full adders and you can add two 64-bit numbers.
Practice
In binary, what is 1011 + 0001?
Hints
- Add column by column from the right, exactly like decimal addition.
- The carry from the first column does not disappear — it joins the next column.
15 XP
Match each output of a half adder with the gate that produces it.
Hints
- One row describes a sum output, the other a carry output — they are not the same gate.
- A carry happens only when both bits are 1; a sum is 1 when exactly one of them is 1.
15 XP
Order the steps that add 11 + 1 in binary and get 100.
Hints
- A full adder is a half adder that also has somewhere to put the carry coming in.
- Two half adders give you the sum; the carry out is an OR of what each half produced.
15 XP