Calculating in the binary system
Column arithmetic works in all positional systems just as in the decimal system: the places are handled from right to left. In addition, when a column sum reaches or passes the base, the part equal to the base goes to the next place. The binary addition table is very short: 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, 1 + 1 = 10 (write 0, carry 1). Three ones give 1 + 1 + 1 = 11: write 1, carry 1. In subtraction, when 1 cannot be taken from 0, we “borrow” from the left neighbour: 10 – 1 = 1. The multiplication table: 0 · 0 = 0, 0 · 1 = 0, 1 · 0 = 0, 1 · 1 = 1; in column multiplication, for every digit 1 of the multiplier we write the multiplicand shifted one place further left, then add the rows. To check a result you can count: in the list 0, 1, 10, 11, 100, 101, 110, 111, 1000 … the number 110 stands sixth after 0, so it equals six, and 1000 equals eight.
| Addition | Multiplication |
|---|---|
| 0 + 0 = 0 | 0 · 0 = 0 |
| 0 + 1 = 1 | 0 · 1 = 0 |
| 1 + 0 = 1 | 1 · 0 = 0 |
| 1 + 1 = 10 | 1 · 1 = 1 |
00100101₂ = 32 + 4 + 1 = 37
The buttons flip the bits: 1 means the place value is added, 0 means it is not
When a counter shows 999 and 1 is added, it becomes 1000: every 9 turns to 0 and one place to the left changes. In binary, 0111 plus 1 gives 1000, that is 7 + 1 = 8. The carry rule is the same in every system.
A computer engineer designs adding circuits for chips, a programmer works with bit operations, and a counter maker plans a counting mechanism.
On paper count in binary from 0 up to 1000 by adding 1 each time: 0, 1, 10, 11, ... Mark the steps where a carry happens.
| carry | 1 | 1 | 1 | 1 | |
|---|---|---|---|---|---|
| 1 | 0 | 1 | 1 | ||
| + | 1 | 0 | 1 | ||
| = | 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | ||
| · | 1 | 1 | |||
| 1 | 0 | 0 | 1 | ||
| + | 1 | 0 | 0 | 1 | 0 |
| = | 1 | 1 | 0 | 1 | 1 |
“Binary relay”: in each team pupils take turns to compute one place of a column sum (passing the carry to the next pupil). The fastest team without errors wins.