From counting in binary to adding
The carry rule you already know
Binary addition follows the same carry rule you use in decimal: add each column, and when a column overflows its single digit, carry into the next column, which is the paper procedure an adder turns into gates.
Builds onBinary numbers
You can already read and write binary numbers. This bridge takes the one step from *representing* a number to *operating* on it, and shows that binary addition is the decimal addition you learned as a child, just with a smaller alphabet. Get this and the half adder that follows will feel like nothing more than wiring up a rule you already trust.
When you add
27 + 15 on paper you do not think about it as a big mysterious operation. You add the ones column (7 + 5 = 12), write the 2, and carry the 1 into the tens column. Adding is just: work column by column from the right, and whenever a column's sum is too big to fit in one digit, carry the overflow left. Binary addition is the identical procedure. The only thing that changes is that a binary column overflows much sooner, as soon as the sum reaches two.The four one-column cases
Because each binary column holds only
0 or 1, adding two bits has just four cases. Three of them fit in a single digit; the fourth overflows and carries:| A | B | carry | sum |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 0 |
0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 in binary (write 0, carry 1). Read left-to-right: the two-bit answer is carry sum.That last row is the whole trick. In decimal
9 + 1 = 10: the column rolls over and you carry. In binary the roll-over happens at 1 + 1: the answer is 10 (two), so you write 0 in this column and carry 1 into the next. A worked example: 011 (three) plus 001 (one). Rightmost column 1 + 1 = 10, write 0 carry 1. Middle column 1 + 0 + carry 1 = 10, write 0 carry 1. Left column 0 + 0 + carry 1 = 1. Result 100, which is four. Correct. Try any addition in the binary calculator and watch the carry row form column by column.The classic slip is forgetting the carry *coming in* from the column to the right. In binary that incoming carry can make a column add three bits (
1 + 1 + 1 = 11, write 1 carry 1), which is why a full adder has three inputs, not two. Add the two number bits and the carry-in, every column.Try it
Add the binary numbers
101 and 011 by hand, column by column with carries. What is the result in binary, and does it match the decimal sum?Answer
Rightmost:
1 + 1 = 10, write 0 carry 1. Middle: 0 + 1 + carry 1 = 10, write 0 carry 1. Left: 1 + 0 + carry 1 = 10, write 0 carry 1, which spills into a fourth column as 1. Result 1000 (eight). In decimal 5 + 3 = 8. It matches.Frequently asked
How do you add two binary numbers?
The same way as decimal: add column by column from the right, and carry into the next column whenever a column overflows. A binary column overflows at
1 + 1, which equals 10 (write 0, carry 1).What is a carry in binary addition?
A carry is the overflow passed from one column into the next when that column's sum is too big to fit in a single digit. In binary,
1 + 1 produces a 0 in the column and a carry of 1 into the next.Why does a full adder have three inputs?
Because a middle column must add its two number bits plus the carry coming in from the column to its right. Three one-bit inputs (
A, B, carry-in) can sum to as much as 11 (three), giving a sum bit and a carry-out.Next, the half adder turns the four-case table above into two gates: XOR for the sum, AND for the carry. That is the moment paper arithmetic becomes a circuit.
Every lesson here builds toward one thing: a working CPU, from the transistor up.
Open the free lab →