CE2704 · Digital Logic Design
Theme 1 · Numbers & codes
Binary addition
The simplest thing a computer does with numbers — add them. Just four rules, and a carry. This is the seed of every adder and of the ALU.
Built from first principles.
Before you start
What you need first
- Number bases & place value — how to read a binary number and its column values (…8 4 2 1).
What you'll be able to do
- Apply the four bit-addition rules, including the carry.
- Add multi-bit binary numbers column by column.
- Spot when a sum overflows the available width.
The only rules you need
Binary addition works exactly like the decimal addition you already know — add one column at a time, and when a column overflows, carry the 1 to the next column on the left.
| Sum | Result | Meaning |
|---|---|---|
| 0 + 0 | 0 | — |
| 0 + 1 | 1 | — |
| 1 + 0 | 1 | — |
| 1 + 1 | 10 | write 0, carry 1 (like 9 + 1 = 10 in decimal) |
| 1 + 1 + 1 | 11 | write 1, carry 1 (when a carry also comes in) |
That last line — 1 + 1 + 1 = 11 — is the case people
forget. It happens whenever a column has both bits set and a carry coming in.
Carrying across columns
📐 Worked example
Add 13 + 11 in 8 bits
13 = 00001101, 11 = 00001011. Add column by column from the
right, carrying where a column makes 10 or 11:
| carry | · | · | · | 1 | 1 | 1 | 1 | · |
| 13 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 |
| + 11 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 |
| = 24 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 |
$$ 00001101_2 + 00001011_2 = 00011000_2 = 24 $$
Check by place value:
00011000 = 16 + 8 = 24. ✓✏️ Try it yourself
Add the 8-bit numbers 00010110 + 00001111. Give the result in
binary and decimal.
Decimal:
00010110 = 22,
00001111 = 15.
Add: the carry ripples left through the
middle columns → 00100101.
Answer: 00100101₂ = 37
(check: 32 + 4 + 1 = 37 ✓).
When the sum doesn't fit: overflow
A fixed-width result can only hold so much. If a carry runs off the top, or the value exceeds the width, the result wraps around — a real source of bugs.
Example: in 4 bits,
1111 (15) +
0001 (1) = 1 0000. The 5th bit can't be stored, so the kept
result is 0000 = 0 — it wrapped.🔭 Looking ahead: this same wrap-around is what makes
two's complement (the next topic) work so neatly for negative numbers,
and it's why choosing a wide-enough data type matters.
Recap — the whole topic on one screen
| Idea | What you own now |
|---|---|
| Bit rules | 0+0=0, 0+1=1, 1+1=10 (carry), 1+1+1=11 (carry) |
| Multi-bit add | Column by column from the right, carrying left |
| Overflow | A carry off the top is lost → the result wraps |