Skip to content

Topic 1 · Data representation

Why computers use binary

12 minFree preview

The big idea

Inside a computer, everything is a switch that is either off or on. Billions of tiny transistors in the processor and memory each hold one of two states. We write those two states as 0 and 1.

A number system that uses only 0 and 1 is called binary (base 2). That's why computers use binary for all data: numbers, letters, photos, music, videos and the programs themselves. Before a computer can process any data, it has to be turned into binary.

In one sentence: computers use binary because their circuits (logic gates and registers) only have two states, on and off, and binary only needs two digits.

Three number systems you need

SystemBaseDigits it usesWhere you see it
Denary100 1 2 3 4 5 6 7 8 9Everyday counting
Binary20 1Inside the computer
Hexadecimal ("hex")160–9 and A B C D E FA short way for humans to write binary

Place values

In denary, each column is worth 10 times the one to its right: ones, tens, hundreds…

Binary works the same way, but each column is worth 2 times the one to its right. For an 8-bit number the place values are:

1286432168421

To read a binary number, add up the place values that have a 1 under them.

Example: what is 01001010 in denary?

1286432168421
01001010

64 + 8 + 2 = 74

Try it yourself with the bits below: tap them to switch them on and off.

Bits, nibbles and bytes

  • A bit is one binary digit (a 0 or a 1).
  • A nibble is 4 bits.
  • A byte is 8 bits.

The biggest number you can store in 8 bits is 11111111 = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. So one byte can hold 256 different values (0 to 255).

Key terms

TermMeaning
BinaryA base-2 number system that uses only the digits 0 and 1
DenaryA base-10 number system (the one we use every day)
BitA single binary digit
ByteA group of 8 bits
RegisterA small, very fast storage location inside the CPU that holds binary values
Place values: flip the bits
Tap a bit to switch it between 0 and 1 and watch the denary value change.

Quiz

Quick check: why binary

4 questions

Enjoying this? Create a free account to save your progress and take the quizzes.