Lesson 1: Picture codes
Unit overview - Next: Lesson 2: Colour-number keys
Back to the grade 2 year plan
Goal: Children decode rows of 0s and 1s into a picture, learn the word "pixel", and write the code for a picture.
Length: about 30 minutes.
Materials
- A printed picture zoomed in until its squares show (for example an enlarged printout of a small icon).
- A large 6 by 6 picture grid on the board, with rows numbered 1 to 6 and a code box beside each row.
- Picture grids (6 by 6), two per child, and erasable pencils or one dark crayon.
- Code cards for the boat picture (below), one per pair.
- A tree picture already coloured on a 6 by 6 grid, one per pair, for the main activity.
- Optional, for blind or low-vision children: a raised-line grid with felt squares or counters, and codes in large print or braille.
- Ear defenders and a quiet spot.
Steps
Opening (5 min)
Show a large picture made of squares (an enlarged printout of a small icon). "When a computer shows a picture, the screen is a grid of tiny squares. Each square shows one colour. We call each square a pixel." Write "picture element" on the board, circle "pi" and "el", and write "pixel" underneath.
"A computer can't keep a picture as crayons. It keeps it as numbers. Today our code is: 0 means leave the square blank, 1 means colour it in."
Main activity (17 min)
- Teacher models row 1 (3 min). Write the code 0 0 0 1 0 0 beside row 1 on the board. Point to each number in turn, left to right, and colour the matching square only when the number is 1. (Answer: only square 4 is coloured.)
-
Pairs decode the mystery picture (8 min). Give each pair the boat code card. One child reads each number aloud or points to it; the other colours. Swap readers every row. Do not say what the picture is.
| Row |
Code |
| 1 |
0 0 0 1 0 0 |
| 2 |
0 0 1 1 0 0 |
| 3 |
0 1 1 1 0 0 |
| 4 |
0 0 0 1 0 0 |
| 5 |
1 1 1 1 1 1 |
| 6 |
0 1 1 1 1 0 |
(Answer: a sailing boat. Rows 1 to 3 make a triangle sail to the left of the mast, row 4 is the mast, rows 5 and 6 are the boat. Count of coloured squares: 1, 2, 3, 1, 6, 4, so 17 in all.)
3. Write the code (6 min). Give each pair the coloured tree picture. Together they write the six row codes in the code boxes. Early finishers swap their codes with another pair and colour a blank grid from the other pair's codes to check.
(Answer for the tree: row 1: 0 0 1 1 0 0; row 2: 0 1 1 1 1 0; row 3: 1 1 1 1 1 1; rows 4, 5 and 6: 0 0 1 1 0 0.)
Discussion questions (with answers) (4 min)
- "What does a 0 tell you? What does a 1 tell you?" (0: leave the square blank. 1: colour it in.)
- "Rows 4, 5 and 6 of the tree have the same code. Why?" (The trunk is the same in each row, so the squares are the same.)
- "If one number in the boat code was wrong, what would happen?" (One square would be wrong in the picture; we could find it by checking each number against each square.)
Closing check (with answers) (4 min)
On the board, draw a single row of six squares and write the code 1 1 0 0 1 1. Children show on their fingers how many squares get coloured, then one child colours them. (Answer: four; squares 1, 2, 5 and 6.)
Then colour squares 3 and 4 of a new row. "Show me the code with number cards, or write it." (Answer: 0 0 1 1 0 0.)
Vocabulary
- pixel: one small square of a picture on a screen ("picture element").
- code: numbers or symbols that stand for something.
- row: a line of squares going across.
Differentiation
- More support: use only rows 1 to 4 of the boat, or a 4 by 4 grid; the reader points to each number while the partner colours.
- More challenge: children design their own 6 by 6 picture, write its codes and give the codes (not the picture) to a partner.
Safety
- Usual classroom care with pencils. No screens are needed.
Teacher notes
- Children often read the code right to left, or skip a 0. Ask them to put a finger under each number as they go and move one square across for each number, even when it is 0.
- The idea and the word "pixel" follow CS Unplugged's "Colour by numbers" lesson (see Sources in the unit overview); the boat and tree pictures are the author's own.
- Don't call the rows "binary numbers". At this stage each 0 or 1 is just one square.