Chapter 1

Text, Sound and Images

How computers turn characters, sound and images into binary using character sets, sampling and pixels.

Representing text

Every character you type must be stored as a binary number. A character set is an agreed list that gives each letter, digit and symbol a unique code. ASCII uses 7 bits, allowing 128 different characters — enough for English but not for other alphabets. Unicode uses more bits per character, so it can represent tens of thousands of symbols from languages worldwide, including Chinese characters and emoji.

Representing sound

Sound is a continuous (analogue) wave, but a computer stores it digitally by sampling — measuring the wave's amplitude at regular intervals. Two settings control quality:

  • Sample rate — how many samples are taken each second (measured in hertz).
  • Sample resolution — how many bits are used to store each sample.

Key idea

A higher sample rate and a higher sample resolution give a more accurate recording, but also a larger file.

Representing images

A bitmap image is a grid of tiny dots called pixels. The colour depth is the number of bits used per pixel: 1 bit gives 2 colours, while 24 bits give millions. More pixels (higher resolution) and greater colour depth improve detail but increase file size. This is why a sharp photograph takes up far more space than a simple logo, and why choosing the right settings is a trade-off between quality and storage.

Example

An image 100 pixels wide and 50 pixels tall with a colour depth of 8 bits needs 100 × 50 × 8 = 40000 bits.

Stuck on this topic? A verified JomKelas tutor can walk you through it.

Find a verified tutor