AeroLab Reading room

CS / IGCSE

Data representation and compression

Binary and hexadecimal encode numbers; characters, bitmap images and sampled sound use agreed formats. Resolution, colour depth, sample rate and sample resolution affect storage and quality.

Learning objectives

The big idea

Binary and hexadecimal encode numbers; characters, bitmap images and sampled sound use agreed formats. Resolution, colour depth, sample rate and sample resolution affect storage and quality.

Lossless compression permits exact reconstruction. Lossy methods discard selected information and may suit media, but are unsuitable when every original bit must be recovered.

Equations and relationships

bitmap bits = width × height × bits per pixel

Uncompressed pixel data only; excludes headers and metadata.

Worked example

A 10×10 monochrome image uses 1 bit per pixel. How many pixel bits?

Follow the solution

10×10×1=100 bits before headers or padding.

Investigate and explain

Predict the worked result before calculating. Change one input, record the new result, and explain which assumptions still hold.

Use the prediction activity below; a local model appears only where it supports this topic.

Open the interactive investigation

Check your understanding

1. Which hexadecimal digit equals decimal 15?

  1. E
  2. F
  3. A
Check the answer and reasoning

F

Hexadecimal uses A through F for decimal 10 through 15.

2. A 10×10 monochrome image uses 1 bit per pixel. How many pixel bits?

  1. 10
  2. 100 bytes
  3. 100
Check the answer and reasoning

100

10×10×1=100 bits before headers or padding.

3. Which compression must preserve program source exactly?

  1. Lossless
  2. Lossy
  3. Either always
Check the answer and reasoning

Lossless

A changed character may change program behaviour, so exact reconstruction is necessary.