Computers do all their math in binary – every addition, subtraction, and multiplication inside your CPU follows rules that are actually simpler than decimal arithmetic. This guide teaches binary addition, subtraction, and multiplication with worked examples, so you can do them by hand and understand what the hardware is doing.
Binary Addition: Only 4 Rules
Binary addition has just four cases:
| A | B | Result | Carry |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
The only tricky case is 1 + 1 = 10 (write 0, carry 1) – just like 9 + 1 = 10 in decimal.
Worked Example: 1011 + 1101
Add column by column from the right:
“`
1 1 ← carries
1 0 1 1 (11)
+ 1 1 0 1 (13)
———
1 1 0 0 0 (24)
“`
Step by step, right to left:
- 1 + 1 = 10 → write 0, carry 1
- 1 + 0 + carry 1 = 10 → write 0, carry 1
- 0 + 1 + carry 1 = 10 → write 0, carry 1
- 1 + 1 + carry 1 = 11 → write 1, carry 1
- Final carry → write 1
Result: 11000. Verify in decimal: 11 + 13 = 24, and 11000₂ = 16 + 8 = 24. ✓
Binary Subtraction: Borrowing in Base 2
Subtraction rules (A − B):
| A | B | Result | Borrow |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 |
The key case: 0 − 1 requires borrowing, giving 10 − 1 = 1 (borrow 1), exactly like 10 − 1 in decimal borrowing.
Worked Example: 1101 − 1011
“`
1 1 0 1 (13)
− 1 0 1 1 (11)
———
1 0 (2)
“`
Right to left:
- 1 − 1 = 0
- 0 − 1 → borrow: 10 − 1 = 1, borrow 1
- 1 − 0 − borrow 1 = 0
- 1 − 1 = 0
Result: 10. Verify: 13 − 11 = 2, and 10₂ = 2. ✓
Binary Multiplication: Shift and Add
Binary multiplication is easier than decimal – you only ever multiply by 0 or 1:
Worked Example: 101 × 11
“`
1 0 1 (5)
× 1 1 (3)
———
1 0 1 (101 × 1)
+ 1 0 1 (101 × 1, shifted left 1)
———
1 1 1 1 (15)
“`
- Multiply 101 by the rightmost digit (1): 101
- Multiply 101 by the next digit (1), shifted left one place: 1010
- Add the partial products: 101 + 1010 = 1111
Result: 1111. Verify: 5 × 3 = 15, and 1111₂ = 8 + 4 + 2 + 1 = 15. ✓
A longer example – 1101 × 101 (13 × 5 = 65):
“`
1 1 0 1
× 1 0 1
———
1 1 0 1 (× 1)
0 0 0 0 (× 0, shifted 1)
+ 1 1 0 1 (× 1, shifted 2)
———
1 0 0 0 0 0 1 (65)
“`
Verify: 1000001₂ = 64 + 1 = 65. ✓
Overflow: When Bits Run Out
With a fixed number of bits, results can overflow:
- 8 bits hold 0-255. Adding 200 + 100 = 300 doesn’t fit – the result wraps to 44 (300 − 256).
- This is why programmers care about data types: a `uint8` and a `uint16` behave differently on the same addition.
CPUs handle this with a carry flag – an extra bit that records “the true answer needed one more bit.” Checking the carry flag is how software detects overflow.
Want to verify your hand calculations? Our binary converter converts your binary results to decimal instantly so you can check each step.
Frequently Asked Questions
What is 1 + 1 in binary?
10 (which is 2 in decimal). This is the most important rule in binary arithmetic – the carry is what makes everything else work.
How do computers subtract if they only add?
Most CPUs use two’s complement: to compute A − B, they compute A + (−B), where −B is B’s bits flipped plus 1. So subtraction hardware is really addition hardware with a preprocessing step.
Is binary division possible?
Yes – it’s the reverse of multiplication (shift and subtract), but it’s the slowest of the four operations, which is why division is famously slower than multiplication on CPUs.
Why is binary multiplication simpler than decimal?
In decimal you need a 10×10 multiplication table (100 facts). In binary the “table” is 2×2 – just four trivial cases – so the whole operation reduces to shifting and adding. Try more examples in our binary converter to build intuition.