Text, sound and images

Computer Science · Data representation. The idea in plain words, the rules to remember, the mistake to avoid and a worked example, written and checked by Mega Lecture.

Test this topic freeAll Computer Science topics

The idea

Text, sound and pictures must all be turned into binary numbers before a computer can store them.

For text, a character set gives every character its own binary code. ASCII uses few bits, so it covers English letters, digits and symbols. Unicode uses more bits per character, so it covers the characters of many languages and emojis, but files are larger.

Sound is a continuous wave. The computer measures its height (amplitude) many times each second; each measurement is a sample. A picture is a grid of pixels, and each pixel stores a binary code for its colour. In both cases more data gives better quality but a larger file.

Rules to remember

Common mistake

Students mix up sample rate and sample resolution. Rate is how often a sample is taken; resolution is how many bits each sample has.

Worked example

An image must show 300 different colours. What is the smallest colour depth that can be used?

  1. Number of colours = 2colour depth.
  2. 8 bits gives 28 = 256 colours, which is fewer than 300.
  3. 9 bits gives 29 = 512 colours, which is enough.

Answer: The smallest colour depth is 9 bits.

Ask about this

Type what you are stuck on. The helper finds the explanation, worked examples and the notes to read, free and instant.

Keep going

← Number systemsData storage and compression →Take a Computer Science test