KeyStage

Key Stage 3 computing · Data and logic

KS3 binary and decimal conversion: a guide for parents

Computers store everything as binary, a number system that uses only the digits 0 and 1. In Years 7 to 9, children learn how to write whole numbers in binary, how to convert between binary and decimal, and how the same 1s and 0s can stand for text, sound and pictures as well as numbers.

Binary and decimal conversion, explained

Our normal number system, decimal, is base 10. We have ten digits, and each column in a number is worth ten times the one to its right: ones, tens, hundreds, thousands. Binary is base 2. There are only two digits, 0 and 1, called bits (short for binary digits), and each column is worth twice the one to its right: 1, 2, 4, 8, 16, 32, 64, 128. Computers use binary because their parts, from tiny switches in a processor to marks on a storage device, can reliably be in one of two states, on or off.

To convert from binary to decimal, write the column values over the bits and add the values wherever there is a 1. A group of eight bits is called a byte, and its columns, from left to right, are 128, 64, 32, 16, 8, 4, 2 and 1. The largest number a byte can hold is 255, when all the bits are 1, and there are 256 different patterns in total, because 0 counts as one of them. To go the other way, from decimal to binary, children work from the largest column down. Each time the column fits into what is left, they write 1 and take it away. When it does not fit, they write 0.

The curriculum also expects pupils to understand how other kinds of data are stored in binary digits. Text is stored by giving each character a number from an agreed code, such as 65 for a capital A, and storing that number in binary. A picture is stored as a grid of tiny squares called pixels, and the colour of each pixel is stored as numbers. Sound is stored by measuring the height of the sound wave many thousands of times a second and storing each measurement as a number. In every case the computer holds only 1s and 0s, and the program decides what they mean.

The curriculum also asks pupils to understand how instructions are stored and run in a computer. Programs are stored in binary too: each instruction is a binary code, held in the same memory as the data, and the processor fetches and carries them out one after another. This is why binary comes up in lessons on hardware as well as in work on number. Many schools introduce conversions with place-value cards before moving to a written table of column values. Hexadecimal is not required at this stage, though some schools mention it.

Words your child will hear

Binary
A number system with only two digits, 0 and 1, where each column is worth double the one to its right.
Decimal
The ordinary number system we use every day, with ten digits and columns worth ten times each other.
Bit
A single binary digit, either 0 or 1.
Byte
A group of 8 bits, which can show any whole number from 0 to 255.
Place value
The value of a digit based on which column it is in.
Pixel
One tiny square of a picture, stored as a number or numbers.
Character set
An agreed code that gives each letter, number and symbol its own number.

What the National Curriculum says

In Key Stage 3, pupils should be taught to:

  • Understand simple Boolean logic [for example, AND, OR and NOT] and some of its uses in circuits and programming; understand how numbers can be represented in binary, and be able to carry out simple operations on binary numbers [for example, binary addition, and conversion between binary and decimal]
  • Understand how instructions are stored and executed within a computer system; understand how data of various types (including text, sounds and pictures) can be represented and manipulated digitally, in the form of binary digits

Objectives from the National Curriculum in England, © Crown copyright, used under the Open Government Licence v3.0.

A worked example

Convert the 8-bit binary number 10110101 to decimal. Then convert the decimal number 77 to 8-bit binary.

  1. Write the column values for 8 bits, with the biggest on the left, and put the bits underneath.
    128  64  32  16   8   4   2   1
      1   0   1   1   0   1   0   1
  2. Add the values of the columns that contain a 1: 128 + 32 + 16 + 4 + 1. That is 128 + 32 = 160, plus 16 = 176, plus 4 = 180, plus 1 = 181.
  3. Now go the other way with 77. Start with 128: it does not fit into 77, so write 0. Next 64 fits, so write 1, and 77 − 64 leaves 13.
  4. With 13 left: 32 does not fit (0), 16 does not fit (0), 8 fits (1) and leaves 5, 4 fits (1) and leaves 1, 2 does not fit (0), 1 fits (1) and leaves 0.
    128  64  32  16   8   4   2   1
      0   1   0   0   1   1   0   1
  5. Check by converting back: 64 + 8 + 4 + 1 = 77. The check is quick and catches slips in the subtraction.

10110101 is 181 in decimal, and 77 in decimal is 01001101 in 8-bit binary.

Common mistakes and how to help

Reading a binary number as if it were decimal

Binary looks like ordinary digits, so 101 is read as “one hundred and one”. It is in fact 4 + 1 = 5.

What helps: Say binary numbers digit by digit (“one zero one”) and always write the place values above before adding. Writing a small 2 beside it as a reminder of the base also helps.

Getting the column values wrong or in the wrong order

The columns double as they go left, but children sometimes write them from 1 on the left, or add the wrong value after 16 (such as 20 instead of 32).

What helps: Practise writing 1, 2, 4, 8, 16, 32, 64, 128 by doubling until it is automatic. The biggest value always goes on the left, just like hundreds before tens in decimal.

Saying 8 bits can hold up to 256

There are 256 different patterns, but one of them is 0, so the largest number is 255.

What helps: Try a smaller case. Two bits give four patterns, 00, 01, 10 and 11, which are the numbers 0 to 3, not 1 to 4.

Thinking the computer stores numbers, letters and pictures in different ways

They look quite different on screen, so it seems as if different kinds of storage must be involved.

What helps: Show that the same pattern, 01000001, is the number 65 in a calculation but the letter A in a text file. The program decides how to read the bits.

How to help at home

  • Make binary cards. Cut eight pieces of paper and write 128, 64, 32, 16, 8, 4, 2 and 1 on them. Lay them out and turn a card face down for 0 or face up for 1. Ask your child to make a number you call out, then swap roles.
  • Count in binary on your fingers. Each finger of one hand is a bit with values 1, 2, 4, 8 and 16 from the thumb. With a finger up for 1, you can make any number from 0 to 31. Try your age or the day of the month.
  • Write a message in numbers. Give the alphabet numbers (A is 1, B is 2 and so on), then write a short word using those numbers in binary. Swap codes with your child to decode each other’s messages. It shows how characters become bits. Real computers use an agreed character set in which, for example, capital A is 65, but the idea is the same.
  • Spot patterns by doubling. Ask how many different patterns 1, 2, 3 and 4 bits can make. The count doubles each time: 2, 4, 8, 16. Use this to explain why 8 bits make 256 patterns.
  • Talk about pictures. Draw a small grid on squared paper and colour some squares to make a simple picture, writing 1 for coloured and 0 for blank. Then ask your child to read the numbers back to you and redraw the picture, which is how a basic black-and-white image can be stored.

More on data and logic

Everything in Key Stage 3 computing

Updated .