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 and why text is stored using the ASCII and Unicode character sets.
- Describe how sound is sampled, and the effect of sample rate and sample resolution.
- Describe how bitmap images are stored, and the effect of resolution and colour depth.
Textbook: Chapter 1, §1.2.1–1.2.3 (pp. 25–31)
Recap / Warm-Up 5 min
You can store numbers in binary. But a computer also stores letters, music and photos — and every one of them must become binary too.
Quick starter
If each character used 7 bits, how many different characters could you represent?
Reveal the answer
2⁷ = 128 characters — exactly the size of standard ASCII (codes 0–127).
Key Concept 14 min
1 · Text — character sets
A keyboard sends a code, not a letter. A character set is the agreed list that gives every character a unique binary code. Sender and receiver must use the same set, or the text turns to nonsense.
ASCII
- Standard ASCII: 7-bit codes, 0–127 (hex 00–7F).
- Covers the letters, digits and symbols on a standard keyboard.
- Codes 0–31 are control codes (such as carriage return) — not printable.
- Extended ASCII: 8-bit, 0–255 (00–FF): 128 extra codes for some accented letters and graphics.
Unicode
- Represents the characters of all the world's languages, plus symbols and emoji.
- Uses up to 4 bytes (32 bits) per character.
- The first 128 codes are the same as ASCII.
- Used by operating systems, search engines and browsers worldwide.
ASCII groups characters in sequence: A = 65, B = 66 … and a = 97. Lower case is always 32 higher, so only one bit — the 32s bit — differs. That makes changing case a fast, simple operation.
A and a in 7-bit ASCII. Only the 32s bit changes, so a program converts case by flipping one bit.Diagram · Advaslearning Hub2 · Sound
Sound waves are vibrations in the air. Each wave has a frequency and an amplitude (its loudness). Sound varies continuously, so it is analogue. A computer can only store digital values.
So the wave is sampled: an analogue-to-digital converter (ADC) measures the amplitude at regular time intervals. The amplitude cannot be measured exactly, so each sample is an approximate value, stored in binary.
A higher sampling rate captures the wave's shape more often. A larger resolution gives more amplitude levels, so each sample is closer to the real value. Both give a more faithful recording but a bigger file.
| Benefits | Drawbacks |
|---|---|
| Larger dynamic range (quietest to loudest) | Larger file size |
| Better sound quality | Takes longer to transmit / download |
| Less sound distortion | Needs more processing power |

3 · Bitmap images
A bitmap image is a two-dimensional grid (matrix) of pixels (picture elements). Each pixel's colour is stored as a binary number. The number of bits per pixel is the colour depth; n bits give 2n colours.
| Colour depth | 1 bit | 2 bits | 3 bits | 8 bits | 24 bits |
|---|---|---|---|---|---|
| Colours (2ⁿ) | 2 | 4 | 8 | 256 | 16 777 216 |
Image resolution is the number of pixels, written width × height. A 4K screen is 3840 × 2160 = 8 294 400 pixels. With fewer pixels an image has less detail, and when enlarged it looks pixelated — the square pixels become visible.

Worked Example 12 min
Worked example 1 · store the text "Hi!" in ASCII
| Character | Denary code | 7-bit binary | Hex |
|---|---|---|---|
| H | 72 | 1001000 | 48 |
| i | 105 | 1101001 | 69 |
| ! | 33 | 0100001 | 21 |
- Look up each character.
His the 8th capital letter: 65 + 7 = 72.capitals run in order from A = 65. iis lower case: its capitalIis 65 + 8 = 73, and 73 + 32 = 105.!is a symbol; its code is 33 (from the table).- Convert each code to 7 bits. The whole text is stored as 1001000 1101001 0100001 — 3 characters × 7 bits = 21 bits (3 bytes if each is stored in a whole byte).
Beyond ASCII: these Unicode characters have codes far above 127, so ASCII cannot store them.
| Character | Name | Unicode code (denary) | Fits in 8-bit ASCII? |
|---|---|---|---|
| é | e with acute accent | 233 | extended only |
| Ω | Greek capital omega | 937 | no |
| € | euro sign | 8 364 | no |
| 😀 | grinning face emoji | 128 512 | no |
Worked example 2 · how many bits per sample?
Question: a sensor records amplitudes from 0 to 100. State the smallest sampling resolution that can store every level.
- Count the levels: 0 to 100 is 101 different values.the 0 counts as a level too.
- Find the smallest power of 2 that is at least 101: 2⁶ = 64 (too small), 2⁷ = 128 ✓.
- Answer: 7 bits. For comparison, a 0–10 range needs 4 bits (2⁴ = 16 ≥ 11).
Worked example 3 · colour depth for a palette
Question: a logo uses 50 different colours. What colour depth is needed, and how many colours does that allow?
- Try powers of 2: 2⁵ = 32 is fewer than 50; 2⁶ = 64 is enough.
- Answer: a colour depth of 6 bits, allowing 64 colours (14 spare).a pixel cannot use part of a bit, so always round up.
See ASCII codes in code
# Every character has a code for letter in "Hi!": print(letter, ord(letter), bin(ord(letter))) print("Code 97 is", chr(97))
H 72 0b1001000 i 105 0b1101001 ! 33 0b100001 Code 97 is a
Try It Yourself 12 min
Goal: the ASCII code for C is 67. Give the codes for G, c and g, in denary and in 7-bit binary.
Goal: an image uses 8 bits for red, 8 for green and 8 for blue. (a) How many shades of red are there? (b) How many colours can one pixel be? (c) What is the colour depth?
Goal: a podcast is recorded at 22 050 Hz with 8-bit samples; a music studio uses 96 000 Hz with 24-bit samples. Explain two reasons the podcast producer might choose the lower settings, and one thing they lose.
Hint
Think about file size, download time for listeners, and whether speech needs the full range of music.
📝 Exam Practice 10 min
A game developer records sound effects with a microphone. Describe how sampling resolution affects how accurate the stored sound will be.
Mark scheme
- Sampling resolution is the number of bits used for each sample (1).
- A larger resolution gives more possible amplitude values / levels (1)…
- …so each sample is closer to the real amplitude / a more accurate recording / less distortion (1).
- A larger dynamic range can be recorded (1). Max 3.
Explain why Unicode was developed when ASCII already existed.
Mark scheme
- ASCII cannot represent characters of non-Western / non-English languages, e.g. Chinese (1).
- Unicode uses up to 4 bytes per character, so it can represent all the world's languages (1).
(a) A bitmap image uses 16 colours. State how many bits are used to encode one pixel. [1] (b) State two effects of increasing the resolution of this image. [2]
Mark scheme
- (a) 4 bits (2⁴ = 16) (1).
- (b) Any two: more pixels / more detail / less pixelation (1); larger file size (1); longer to download / transfer (1); fewer images fit in storage (1). Max 2.
Describe how sampling is used to record a music sound clip.
Mark scheme
- The amplitude of the sound wave is measured / sampled at set / regular time intervals (1).
- This gives an approximate representation of the sound wave (using an ADC) (1).
- Each sample is encoded as a series of binary digits / using a set number of bits (1).
Recap & Key Terms 3 min
Text is stored with a character set: ASCII (7-bit, 128 characters) or Unicode (up to 32 bits, every language). Sound is sampled: rate = samples per second, resolution = bits per sample. Images are grids of pixels set by resolution and colour depth. More of any of these means higher quality but a larger file.
- ASCII code
- A character set for all the characters on a standard keyboard and control codes (7-bit; extended ASCII is 8-bit).
- Unicode
- A character set which represents all the languages of the world; its first 128 characters are the same as ASCII.
- Sampling rate
- The number of sound samples taken per second in digital sound recording.
- Sampling resolution (bit depth)
- The number of bits used to represent the amplitude of each sound sample.
- Pixel
- Picture element: the smallest element used to make up an image on a display.
- Colour depth
- The number of bits used to represent the colour of each pixel.
- Image resolution
- The number of pixels that make up an image, e.g. 4096 × 3072 pixels.
Homework 1 min
Task (≤ 15 min): (a) Write the word Cab in 7-bit ASCII binary (A = 65, a = 97). (b) An image has a colour depth of 5 bits. How many colours can it show? (c) Explain one drawback of increasing the sampling rate of a recording. [5]
Model answer
- (a) C = 67 =
1000011; a = 97 =1100001; b = 98 =1100010(3 — one per character). - (b) 2⁵ = 32 colours (1).
- (c) More samples are stored each second, so the file is larger / takes longer to download (1).