1.3

Topic 1

Data storage and compression

  • IGCSE Computer science 0478
  • 2 min read
  • Syllabus 2026, 2027 and 2028

Objectives

  1. 1

    Understand how data storage is measured

  2. 2

    Calculate the file size of an image file and a sound file, using information given

  3. 3

    Understand the purpose of and need for data compression

  4. 4

    Understand how files are compressed using lossy and lossless compression methods

Cambridge IGCSE Computer Science 0478 syllabus 2026-2028, 1.3 Data storage and compression (copied for internal use as permitted by Cambridge)

Detailed · Deep study

1Measuring data storage

UnitSize
bit1 binary digit
nibble4 bits
byte8 bits
kibibyte (KiB)1024 bytes
mebibyte (MiB)1024 KiB
gibibyte (GiB)1024 MiB
tebibyte (TiB)1024 GiB
pebibyte (PiB)1024 TiB
exbibyte (EiB)1024 PiB

2Calculating file sizes

Worked example

Image file

An image is 1920 × 1080 pixels with a colour depth of 24 bits. Calculate its size in MiB.

  1. 1

    Bits.

    bits

  2. 2

    Bytes.

    bytes

  3. 3

    MiB.

Answer5.93 MiB

Worked example

Sound file

A 3-minute track is sampled at 44 100 Hz with a 16-bit sample resolution (mono). Calculate its size in MiB.

  1. 1

    Bits.

  2. 2

    Bytes, then MiB.

Answer15.1 MiB

3Why compress data?

  • less storage space is needed on devices and servers
  • less bandwidth is used when sending files
  • files transmit faster (shorter download and upload times)
  • streaming is smoother and costs less data

4Lossy and lossless compression

LossyLossless
what happensdata is permanently removedno data is lost; the original can be restored exactly
methodsreduce resolution or colour depth; reduce sample rate or resolution; remove sounds people cannot hear (e.g. MP3), detail the eye does not notice (e.g. JPEG)run length encoding (RLE); finding repeated patterns
file sizemuch smallersmaller, but not as small as lossy
use forphotos, music, videotext, program files, spreadsheets – where every bit matters
Fig. 1Run length encoding.

Run length encoding (RLE) stores each run of identical data as a count and the value. It works well for data with long runs, such as simple images with large areas of one colour.

5Exam focus

Key words: bit; nibble; byte; KiB; MiB; GiB; file size; compression; lossy; lossless; run length encoding.

Quick self-check

Answer in your head first, then reveal.

  1. 2048 (1).

  2. (1) = 468.75 KiB (1).

  3. No data can be lost (1); otherwise the program would not run correctly (1).

  4. 4A 3B 6C (1).

  5. Any two: less bandwidth; faster upload; less storage (2).

Finished this subtopic? Track it on your subject page.