Explaining how digital systems use numbers for data

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Explaining how digital systems use numbers for data

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which sentence explains how a computer stores a picture?
A A computer stores a picture as numbers, one for each pixel in the grid.
B A computer stores a picture as a tiny photo inside the screen.
2. Which digits does binary use?
A Only 0 and 1
B The digits 0 to 9
3. How do we link binary to a light switch?
A 0 is like on and 1 is like broken
B 0 is like off and 1 is like on
4. A black-and-white pixel grid is stored using 0s and 1s. What could the 0 and 1 stand for?
A 0 is a white pixel and 1 is a black pixel
B 0 is a whole picture and 1 is a sound
5. Which sentence about data types is true?
A The data type does not matter. Every value works the same way.
B The data type decides what you can do with a value.

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1A computer stores a picture as numbers AA computer does not keep a picture as a photo. It turns the picture into numbers, for example pixel values in a grid.
2Binary uses only 0 and 1 BDigital systems turn pictures into numbers, such as a grid of pixels where each pixel has a number.
3A small pixel grid can store a black-and-white picture, where 0 is a white pixel and 1 is a black pixel. CBinary has two digits, which match off (0) and on (1) like a light switch.
4The data type decides what you can do with a value: numbers can be added, but text is joined together. DBinary only has two digits, 0 and 1. The digit 2 is not used in binary.
5Binary uses the digits 0, 1 and 2. E5 + 5 = 10 and "5" + "5" = "55"
6A computer keeps a picture as a photo inside, not as numbers. F0 1 1 0

Definitions

A computer stores a picture as numbers

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
A computer stores a picture as _______.
2.
Binary uses only 0 and _.
3.
In binary, 1 means on and 0 means ___.
4.
A picture is a grid of tiny ______.
5.
The _________ decides what you can do with a value.

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A row = [0, 1, 2, 0]
B for pixel in row:
C if pixel == 1:
D print('black')
Question 2
A bit = 1
B state = 'off'
C if bit = 1:
D state = 'on'
Question 3
A colours = ['white', 'black']
B pixel = 2
C print(colours[pixel])
Question 4
A age = 10
B name = 'Sam'
C print(age + 5)
D print(name - '!')
Question 5
A is_on = True
B bit = 0 if is_on else 1
C print(bit)

Answer Key

Explaining how digital systems use numbers for data
Section A: Quick Questions
Q1
A — A computer stores a picture as numbers, one for each pixel in the grid.
Q2
A — Only 0 and 1
Q3
B — 0 is like off and 1 is like on
Q4
A — 0 is a white pixel and 1 is a black pixel
Q5
B — The data type decides what you can do with a value.
Section B: Match the Pairs
Q1
A computer stores a picture as numbers → Digital systems turn pictures into numbers, such as a grid of pixels where each pixel has a number.
Q2
Binary uses only 0 and 1 → Binary has two digits, which match off (0) and on (1) like a light switch.
Q3
A small pixel grid can store a black-and-white picture, where 0 is a white pixel and 1 is a black pixel. → 0 1 1 0
Q4
The data type decides what you can do with a value: numbers can be added, but text is joined together. → 5 + 5 = 10 and "5" + "5" = "55"
Q5
Binary uses the digits 0, 1 and 2. → Binary only has two digits, 0 and 1. The digit 2 is not used in binary.
Q6
A computer keeps a picture as a photo inside, not as numbers. → A computer does not keep a picture as a photo. It turns the picture into numbers, for example pixel values in a grid.
Section C: Definitions
Q1
A computer stores a picture as numbers — Digital systems turn pictures, colours and text into numbers. Binary uses only 0 and 1, like off and on, and the data type decides what you can do with it.
Section D: Fill in the Blanks
Q1
A computer stores a picture as numbers.
Q2
Binary uses only 0 and 1.
Q3
In binary, 1 means on and 0 means off.
Q4
A picture is a grid of tiny pixels.
Q5
The data type decides what you can do with a value.
Section E: Spot the Error
Q1
A — A black-and-white pixel row uses binary, which has only the digits 0 and 1. The 2 is not a binary digit. It should be row = [0, 1, 1, 0].
Q2
C — A single = stores a value. To compare the bit with 1 you need the double equals ==. It should be if bit == 1:.
Q3
B — One bit can only be 0 or 1, so it picks one of two colours. The number 2 does not match any colour in the list. It should be pixel = 0 or pixel = 1.
Q4
D — Text (a string) can be joined with + but cannot be subtracted. The data type decides what you can do. It should be print(name + '!').
Q5
B — Binary links on and off to 1 and 0. On should be 1 and off should be 0, but this line swaps them. It should be bit = 1 if is_on else 0.