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.

In simpler words

Computers turn text, sound and pictures into binary. For text, each letter has its own code. ASCII has codes for English letters. Unicode covers many languages but uses more bits. Sound is measured many times each second; each measurement is a sample. A picture is a grid of dots called pixels, each with a colour code. More data means better quality but bigger files.

An everyday comparison

Sampling sound is like a flipbook. Each page is one snapshot; more pages per second make smoother movement, and more detail on each page makes each picture sharper. Sample rate is pages per second; sample resolution is detail per page. The comparison stops working because a flipbook records pictures, while a sound sample stores just one number for the height of the wave.

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.

In the exam

Define each term exactly. Character set: the characters a computer can use, each with a unique binary code. Sample rate: samples per second, in hertz. Sample resolution: bits per sample. Colour depth: bits per pixel. Compare ASCII and Unicode by bits and number of characters. When asked about quality, state that increasing a value improves accuracy and also increases file size.

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