← How computers work

Data representation

Everything is numbers, then how a few bits hold them.

Start1. Everything is numbers
For teachers For Year 8 · 9 lessons (and 1 optional)

Everything a computer stores is numbers: text as character codes, pictures as pixels, sound as samples. Then how those numbers are stored with only 0s and 1s: binary place value, how many numbers a few bits can hold, logic gates, and the chain from any data down to bytes.

  • For Year 8
  • Lessons 9 (and 1 optional)
  • Do first No earlier course needed
Teacher guide

Data as numbers

Text, pictures and sound are all stored as numbers, and the encoding decides what they mean: character codes, RGB pixels, shapes and sound samples.

1Everything is numbersNot started
2Text as numbersNot started
3Colour and imagesNot started
3.5Shapes as numbersNot started

A vector picture stores shapes, not pixels: a circle is where its centre is, how big it is and its colour, a few numbers in all. The computer draws it again at any size, so it stays sharp, and it stays small. Photos suit bitmaps; logos, icons and fonts suit vectors. 3D models are numbers too: a list of corners (x, y, z) and the faces that join them.

  1. Engage: zoom in
  2. Explore: sharp at any size? › Zoom in
  3. Explore: sharp at any size? › More pixels
  4. Explain: a picture as shapes
  5. Elaborate: change the numbers › Bigger
  6. Elaborate: change the numbers › Move it
  7. Elaborate: change the numbers › A 3D model
  8. Elaborate: the club badge
  9. Evaluate: look back › Vector or bitmap?
  10. Evaluate: look back › Look back
Start lesson
4Sound as numbersNot started

Binary numbers

Read and write numbers in binary, work out how many numbers a set of bits can hold, see why computers are built on switches and logic gates, and trace any data down to its bytes.

5Bits and binary numbersNot started
6How many patterns?Not started
6.5Hex: binary in fours OptionalNot started

Hexadecimal (hex) has sixteen digits, 0 to 9 then A to F (10 to 15). One hex digit is exactly four bits, so a byte is always two hex digits: 1010 0011 is A3. It's a short way to write binary, used for web colours, memory addresses and error codes. Like binary, it's a public rule, not a secret.

  1. What is FF?
  2. Try: every card up
  3. Worked example: four bits, one digit › A byte, two digits
  4. Worked example: four bits, one digit › Find the mistake
  5. Worked example: four bits, one digit › Byte to hex
  6. Vary: make the hex › 0F
  7. Vary: make the hex › 80
  8. Vary: make the hex › A3
  9. Practise: hex in the wild › A web colour
  10. Practise: hex in the wild › Hidden?
  11. Practise: hex in the wild › Review: binary
  12. The badge colour
Start lesson
7Why binary: logic gatesNot started
8Bits all the way downNot started

Progress is saved in this browser only. Nothing is sent anywhere.

For teachers: Teacher guide (notes, answers, solutions, slides and worksheets)