Representing text, sound and images
Text, sound and images in binary
- Numbers aren't the only data — text, sound and images all become binary too.
- Each has its own method.
- The trade-off everywhere: better quality means a bigger file.
Representing text
- Each character is given a number, stored in binary. The set of characters + their numbers is a character set.
- ASCII uses 7 bits → 128 characters (enough for English letters, digits, symbols).
- Unicode uses more bits → far more characters (many languages, symbols, emoji) — but the same text takes more storage.
Practice
How many different characters can 7-bit ASCII represent?
7 bits give 2^7 = 128 characters.
Practice
Compared with ASCII, Unicode:
Unicode covers many languages and emoji, needing more bits — so the same text is larger than in ASCII.
Representing sound
- A sound wave is smooth; to store it the computer measures its height at regular moments — sampling.
- Sample rate = samples per second (Hz); sample resolution = bits per sample.
- Higher rate and resolution → a more accurate recording, but a larger file.

Practice
The sample rate of a sound recording is:
Sample rate = samples per second (Hz); sample resolution = bits per sample.
Representing images
- A bitmap image is a grid of dots — pixels.
- Resolution = the number of pixels (e.g. $1920 \times 1080$).
- Colour depth = the number of bits per pixel.
- Higher resolution and colour depth → better quality, but a larger file.
Practice
The colour depth of an image is:
Colour depth is bits per pixel — more bits means more possible colours.
Practice
Increasing an image's resolution and colour depth will:
More pixels and more bits per pixel mean better quality but a larger file.
You've got it
Key idea
- text: a character set maps characters to numbers; ASCII = 7 bits (128), Unicode = more (emoji), bigger files
- sound: sampling records the wave; sample rate (Hz) + sample resolution (bits)
- images: pixels; resolution (pixel count) + colour depth (bits/pixel)
- in all three: higher quality → bigger file