Skip to content

Ten Fingers, Two Wires

Why we count in tens and the machine counts in twos, and how a row of switches spells an ordinary number.

You already know how to count. What you may not know is why you count that way. Once you see the reason, binary stops being strange.

Ten is a habit

We count in tens. Three hundred and sixty-five is 3 hundreds, 6 tens and 5 ones. Each place is worth ten times the place to its right.

That feels like the only way numbers could work. It is not. We count in tens because we have ten fingers. Nothing about the numbers requires it.

The machine has two

A computer counts on wires, and a wire has two states. Current flows, or it does not. On, or off. 1, or 0.

That single on-or-off is the smallest piece of information there is, and it has a name. It is a bit.

One bit cannot say much. To count past one the machine does what you do when you run out of fingers on one hand. It uses more.

Counting past one

Line up several bits and give each one a place. Each place has two states rather than ten, so each place is worth twice the one to its right. The places run 1, 2, 4, 8, 16, doubling as you go left.

Read the switches 1 0 1. That is one 4, no 2, and one 1. Together they make 5.

Write BIN in front of a row of switches to write a number the machine’s way:

SHOW BIN 101
Output
5

The pattern is the number. BIN does no sum you could not do yourself. It reads the switches the machine’s way and shows you the answer in yours.

Turn another switch on

You can watch place value work. Add a switch on the left, in the 8s place:

SHOW BIN 1101
Output
13

Five became thirteen. The new switch sits in the 8s place, so it added eight. Every switch is worth its own place and nothing else.

Eight of them make a byte

Bits rarely travel alone. The machine handles them in eights, and eight bits have a name you will meet on every page from here. They are a byte.

How high can eight switches count? Turn them all on:

SHOW BIN 11111111
Output
255

128, 64, 32, 16, 8, 4, 2, 1. Add those up and you get 255. That is the most a single byte holds. It is why 255 turns up everywhere once you know to look for it: colour values, character counts, the score that rolls over.

When it’s wrong, see why

  • A digit that isn’t 0 or 1. A switch has two states, so those are the only digits BIN takes. A 2 in the row is not a binary number.
  • The number is far bigger or smaller than you expected. You may be reading the row backwards. The rightmost switch is the 1s, and the places grow as you move left.
  • A leading zero did nothing. That is correct. BIN 0101 and BIN 101 are the same number, the way 0007 and 7 are.

What you’ve learnt

  • We count in tens out of habit, not because numbers demand it.
  • A bit is one switch: on or off, 1 or 0.
  • Each place is worth twice the one to its right, so a row of switches spells an ordinary number.
  • Eight bits make a byte, which counts from 0 to 255.
  • BIN writes a number as its switches.

What’s next

You can write a number in twos as well as tens. In Unit 2 we add a third way of writing one, and see why programmers reach for it constantly.