Cover lesson · Computer Science · Year 7 · Beginner
LNF: Numeracy → Developing mathematical proficiency → Conceptual understanding
Name: Class: Date:
What this practises: numeracy in Computer Science. Pupils see one idea, a picture stored as numbers, in several forms: a drawing, rows of bits, a colour code, a run-length code and a file size. They connect pixels to area, bits to doubling, and bits to bytes, and judge whether answers make sense. This builds towards GCSE Computer Science Unit 1, Section 1.2.1 (representing images and calculating file sizes).
Print: this sheet, one per pupil, and the stimulus sheet “The Gwennol app: icons made of numbers”, one between two. Pupils need a pencil. Coloured pencils are useful for Step 4 but not essential. No calculators and no computers.
Run: 5 min read sections 1 to 6 and do Step 1 · 8 min Step 2, decode the home icon · 8 min Step 3, encode the favourites icon · 8 min Step 4, the 4-colour icon · 10 min Step 5, file sizes · 7 min Step 6, run-length encoding · 4 min success criteria. Total 50 minutes.
Collect: this sheet. The worked example has every answer. Checkpoints: Icon A is a house with a door; an 8 by 8 icon with 1 bit per pixel is 64 bits = 8 bytes; Icon B takes 36 characters in run-length code instead of 64.
A computer stores every picture as numbers. Today you will show the same icon in five different ways: as a picture, as bits, as a colour code, as a run-length code and as a file size. Each way tells you something different.
| Question | Answer |
|---|---|
| How many pixels are in an 8 by 8 icon? In a 16 by 16 icon? | |
| How many bits are in 1 byte? | |
| How many colours can you show with 1 bit? With 2 bits? With 3 bits? |
Icon A in section 7 is stored as 8 rows of bits. Shade a square for every 1 and leave it white for every 0. What is the picture?
The picture is: ______________________________
Icon B in section 7 is a picture. Write each row as 8 bits (black = 1, white = 0).
| Row | Bits | Row | Bits |
|---|---|---|---|
| 1 | 5 | ||
| 2 | 6 | ||
| 3 | 7 | ||
| 4 | 8 |
Icon C uses the Gwennol 4-colour code, 2 bits per pixel. Write the letter (W, Y, G or O) in each square, or colour it in.
(b) Icon C has 16 pixels. How many bits does it use altogether? Why is it not 16?
Use the formulas in section 5.
| Icon | Pixels | Bits per pixel | Bits | Bytes |
|---|---|---|---|---|
| 8 by 8, 2 colours | ||||
| 8 by 8, 4 colours | ||||
| 8 by 8, 16 colours | ||||
| 16 by 16, 4 colours |
(b) Harri makes his icon twice as wide and twice as high. He says the file will be twice as big. Is he right? Use your table to explain.
(c) Nia says, “I can show 3 colours with 1 bit per pixel.” Explain why she is wrong. What is the smallest number of bits per pixel she needs for 3 colours?
Write each row of Icon B as runs (see section 6). Count the characters.
| Row | Runs | Characters | Row | Runs and characters |
|---|---|---|---|---|
| 1 | 5 | |||
| 2 | 6 | |||
| 3 | 7 | |||
| 4 | 8 |
(b) Total characters in run-length code: ______ compared with 64 bits. Which row is longer in run-length code than in bits? Why?