Once numbers are stored in binary, the computer has to do arithmetic with them. The good news is that binary addition uses just four rules — far fewer than the addition tables you learned as a child. And there is a beautifully lazy trick, the binary shift, that multiplies or divides by two just by sliding the digits sideways.
The four rules of binary addition
Add column by column from the right, exactly as in denary — but you only ever meet these cases:
| Sum | Write | Carry |
|---|---|---|
| 0 + 0 | 0 | — |
| 0 + 1 | 1 | — |
| 1 + 1 | 0 | carry 1 |
| 1 + 1 + 1 | 1 | carry 1 |
The key idea is that 1 + 1 = 10 in binary (that's "two"), so you write 0 and carry the 1 into the next column — just like 5 + 5 = 10 makes you carry in denary.
That is 22 + 13. Working right to left: 0+1=1; 1+0=1; 1+1=0 carry 1; 0+1+1(carry)=0 carry 1; 1+0+1(carry)=0 carry 1; 0+0+1(carry)=1; 0+0=0; 0+0=0.
Result: 0010 0011. Check: 32 + 2 + 1 = 35, and 22 + 13 = 35. ✓
Overflow
A byte holds only 8 bits. If an addition needs a ninth bit, that bit "falls off the end" and the answer is wrong — this is overflow. For example 11111111 + 00000001 (255 + 1) should be 256, but 256 needs 9 bits, so the byte wraps round to 00000000. The computer must flag this so it isn't ignored.
Binary shifts — multiply and divide by two
Sliding every bit one place left multiplies the number by 2; sliding one place right divides it by 2. Think of it like adding or removing a zero in denary (50 → 500 is ten times bigger); in binary the factor is two. New empty positions are filled with 0.
00000110 is 6. Every bit moves one column left, a 0 fills the gap on the right: 0000 1100 = 12. Indeed 6 × 2 = 12. ✓
Shift 00011000 (24) right by 1 → 0000 1100 = 12, and 24 ÷ 2 = 12. ✓
Tip: a left shift of n places multiplies by 2n (shift 3 places = ×8), and a right shift of n divides by 2n. Count the places, not the individual doublings.