Digital systems store everything as numbers

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

Digital systems store everything as numbers

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. How does a digital system store a photo?
A As numbers that describe the picture
B As a tiny paper picture inside the computer
2. Which statement is true?
A Computers turn text into number codes
B Computers keep letters as real letters inside
3. Why do computers need data to be changed into numbers?
A Because a digital system can only store and work with numbers
B Because computers get bored of letters and pictures
4. Which kind of data is stored as numbers in a digital system?
A Only maths sums
B Text, pictures and sound
5. What is a number code?
A A secret password to open a computer
B A number that stands for a letter, colour or sound

Match the Pairs

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

Left columnRight column
1A = 65 Aord('H') = 72
2pixel color = 255, 0, 0 BA photo is not stored as a picture. It is converted into numbers that describe the color of each pixel.
3Computers can only store and work with numbers, so text must be converted to numbers first CNumbers that tell the computer how much red, green and blue to show in one dot of a picture
4Sound is converted to a list of numbers so a digital system can store it DA number code that stands for the letter A so a computer can store it
5The word CAT is stored as the letters C, A, T inside the computer Esound = [0, 12, 40, 12, 0]
6A photo is stored as a tiny picture inside the computer, not as numbers FComputers do not store letters as letters. Each letter is converted to a number code, so CAT is stored as numbers like 67, 65, 84.

Definitions

digital data

Fill in the Blanks

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

1.
print(___("A"))
2.
print(___(66))
3.
letter = "A" code = ord(______) print(code)
4.
print(chr(ord("A") _ 1))
5.
print(ord("A") __ 65)

Spot the Error

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

Question 1
A letter = "A"
B code = chr(letter)
C print(code)
Question 2
A word = "CAT"
B codes = []
C for ch in word:
D codes.append(ch)
E print(codes)
Question 3
A colour = (255, 0, 0)
B print("Red:", colour[0])
C print("Green:", colour[2])
D print("Blue:", colour[2])
Question 4
A message = "HI"
B codes = [72, 73]
C print("Stored:", message)
Question 5
A a_code = ord("A")
B b_code = a_code - 1
C print(chr(b_code))

Answer Key

Digital systems store everything as numbers
Section A: Quick Questions
Q1
A — As numbers that describe the picture
Q2
A — Computers turn text into number codes
Q3
A — Because a digital system can only store and work with numbers
Q4
B — Text, pictures and sound
Q5
B — A number that stands for a letter, colour or sound
Section B: Match the Pairs
Q1
A = 65 → A number code that stands for the letter A so a computer can store it
Q2
pixel color = 255, 0, 0 → Numbers that tell the computer how much red, green and blue to show in one dot of a picture
Q3
Computers can only store and work with numbers, so text must be converted to numbers first → ord('H') = 72
Q4
Sound is converted to a list of numbers so a digital system can store it → sound = [0, 12, 40, 12, 0]
Q5
The word CAT is stored as the letters C, A, T inside the computer → Computers do not store letters as letters. Each letter is converted to a number code, so CAT is stored as numbers like 67, 65, 84.
Q6
A photo is stored as a tiny picture inside the computer, not as numbers → A photo is not stored as a picture. It is converted into numbers that describe the color of each pixel.
Section C: Definitions
Q1
digital data — Computers store text, pictures and sound as numbers. Data is converted into number codes so a digital system can store it and work with it.
Section D: Fill in the Blanks
Q1
print(ord("A"))
Q2
print(chr(66))
Q3
letter = "A" code = ord(letter) print(code)
Q4
print(chr(ord("A") + 1))
Q5
print(ord("A") == 65)
Section E: Spot the Error
Q1
B — ord() changes a letter into its number code (A becomes 65). chr() does the opposite, so line 2 should be code = ord(letter).
Q2
D — The list should hold number codes, but this adds the letter itself. Line 4 should be codes.append(ord(ch)) so each letter is converted to a number.
Q3
C — A colour is stored as three numbers: red, green, blue. Green is the second number, at position 1, so line 3 should use colour[1].
Q4
C — The line says what is stored, but it prints the message again instead of the numbers. Line 3 should print codes, the list of numbers 72 and 73.
Q5
B — Letter codes go up by 1 in alphabet order, so B is one more than A. Line 2 should be b_code = a_code + 1 to get B.