Syllabus & Goals 3 min
Cambridge 1.2 · Text, sound and images Paper 1 · Computer Systems
By the end of this lesson you can:
- Describe how text is stored using ASCII and Unicode character sets.
- Explain how sound is sampled, using sampling rate and sampling resolution.
- Explain how images are stored using resolution and colour depth.
Recap / Warm-Up 5 min
You can store numbers in binary. But a computer also stores letters, music and photos — and everything must become binary.
Quick starter
If each character used 7 bits, how many different characters could you represent?
Reveal the answer
2⁷ = 128 characters. That is exactly the size of the original ASCII set (codes 0–127).
Key Concept 14 min
1 · Character sets — ASCII and Unicode
A character set gives every letter, digit and symbol a unique binary code so the computer can store text.
| Character | Denary code | Binary (7-bit) |
|---|---|---|
A | 65 | 1000001 |
a | 97 | 1100001 |
Z | 90 | 1011010 |
2 · Representing sound
Sound is an analogue wave — it varies smoothly. A computer can only store discrete numbers, so the wave is sampled: its height (amplitude) is measured at regular time intervals by an analogue-to-digital converter (ADC).
A higher sampling rate or resolution gives better quality but a larger file size.
3 · Representing (bitmap) images
A bitmap image is a grid of pixels. Each pixel's colour is stored as a binary number.
Worked Example 12 min
(a) How many colours does a colour depth give?
Colour depth is bits per pixel, and n bits gives 2ⁿ colours:
| Colour depth | Colours (2ⁿ) |
|---|---|
| 1 bit | 2 |
| 2 bits | 4 |
| 8 bits | 256 |
| 24 bits | 16 777 216 |
(b) Why does 'A' differ from 'a'?
A = 65 = 1000001 and a = 97 = 1100001. They differ by 32 — only the 6th bit changes — so swapping case is a simple, fast operation for the computer.
See it in code
Python (IDLE)
# Every character has an ASCII code letter = "A" print(letter, "has ASCII code", ord(letter)) print("Code 97 is the letter", chr(97))
Output
A has ASCII code 65 Code 97 is the letter a
Try It Yourself 12 min
Goal: The ASCII code for C is 67. What are the codes for D and E?
Hint: the letters run in sequence.
Goal: A photo uses a colour depth of 4 bits. How many different colours can each pixel be? Show the power of 2 you used.
Goal: Explain, with reasons, why a school recording a podcast might choose a lower sampling rate than a music studio.
📝 Exam Practice 10 min
Define the term sampling resolution.
Mark scheme
- The number of bits used to store each sound sample (1).
Explain why Unicode was developed when ASCII already existed.
Mark scheme
- ASCII cannot represent non-Western / non-English characters (1).
- Unicode uses more bits, so it can represent the characters of all the world's languages (1).
Describe how an analogue sound wave is sampled and stored by a computer.
Mark scheme
- The amplitude of the wave is measured at regular time intervals (the sampling rate) (1).
- Each measurement is an approximate value (using an ADC) (1).
- Each sample is encoded / stored as binary digits (1).
Recap & Key Terms 3 min
Text is stored with a character set — ASCII (7-bit) or Unicode (all languages). Sound is sampled: rate = samples/second, resolution = bits/sample. Images are grids of pixels, set by resolution and colour depth. More of any of these means higher quality but a bigger file.
- Character set
- A defined list of characters with a unique binary code each (e.g. ASCII, Unicode).
- Sampling rate
- The number of sound samples taken per second, in hertz (Hz).
- Colour depth
- The number of bits used to store the colour of one pixel — n bits gives 2ⁿ colours.
- Image resolution
- The number of pixels in an image, written width × height.
Homework 1 min
Task (≤ 15 min): A colour image uses 8 bits each for red, green and blue. (a) How many shades of red are there? (b) How many total colours can one pixel be?
Model answer
- (a) 2⁸ = 256 shades of red (and the same for green and blue).
- (b) 256 × 256 × 256 = 16 777 216 colours (a 24-bit colour depth).