📁 Paper 1 · Topic 1: Data Representation
1.3 Data Storage Units & Compression
Cambridge IGCSE Computer Science 0478 · ~12 min read · ⭐ Pro

Units of Data Storage

Data is measured in units based on powers of 2 (binary system). Cambridge uses the IEC binary prefixes:

UnitAbbreviationValue
Bitb1 binary digit (0 or 1)
Nibble4 bits
ByteB8 bits
KibibyteKiB1024 bytes (2¹⁰)
MebibyteMiB1024 KiB (2²⁰)
GibibyteGiB1024 MiB (2³⁰)
TebibyteTiB1024 GiB (2⁴⁰)

Note: Cambridge 0478 uses 1 KB = 1024 bytes in calculations. Always check the question wording.

File Compression

Compression reduces the size of a file. This saves storage space and reduces transmission time.

There are two main types:

Lossless Compression

  • The original file can be perfectly reconstructed after decompression
  • No data is lost
  • Examples: ZIP, PNG, FLAC
  • Suitable for: text files, databases, executable programs, files where accuracy is critical

Lossy Compression

  • Some data is permanently removed during compression
  • The original cannot be perfectly reconstructed
  • Achieves much greater compression ratios than lossless
  • Examples: JPEG, MP3, MP4, AAC
  • Suitable for: images, audio, video where small quality losses are acceptable

Run-Length Encoding (RLE)

RLE is a simple lossless compression technique. Consecutive repeated values (a run) are stored as a single value and a count, rather than repeating the value many times.

Example: AAAABBBCCDDDDDD → (A,4)(B,3)(C,2)(D,6) — stores 12 characters as 6 pairs

RLE is effective when there are many long runs of the same value (e.g. simple images, fax data). It is not effective for data with little repetition.

FeatureLossyLossless
Data lossYes — permanentNo
File size reductionGreaterLess
Decompression qualityApproximation of originalExact original
Typical useJPEG images, MP3 audioZIP archives, PNG images
Exam tip: Cambridge often asks you to compare lossy and lossless compression. Key difference: lossless can restore the original exactly; lossy cannot. RLE is a lossless technique — you may be asked to apply it or explain how it works on a simple sequence.
⚠️ Common Mistakes
  • Saying MP3 is lossless — it is lossy (some audio data is permanently discarded)
  • Saying lossy compression is always bad — it is acceptable for audio/video where quality loss is barely perceptible
  • Confusing 1 KB = 1000 bytes (SI) vs 1 KiB = 1024 bytes (binary) — Cambridge uses 1024 in calculations
Video coming soon
Click slide or press arrow keys to navigate
✍️

Worksheet — Storage & Compression

5 questions · 9 marks

Q1Convert 4096 bytes to KiB.[1]
✅ Mark scheme
4096 ÷ 1024 = 4 KiB [1]
Q2State the difference between lossy and lossless compression.[3]
✅ Mark scheme
Lossy compression permanently removes some data [1]; the original cannot be perfectly reconstructed [1]. Lossless compression preserves all data and the original can be exactly restored [1].
Q3Apply RLE to the following sequence: BBBBBAAACCCCCCC. Show the encoded result.[2]
✅ Mark scheme
Identifies runs correctly [1]; (B,5)(A,3)(C,7) [1]
Q4Give a suitable file type to store a photograph where storage space is limited and small quality losses are acceptable.[1]
✅ Mark scheme
JPEG [1] (or any lossy image format)
Q5Give two reasons why compression is used when storing or transmitting files.[2]
✅ Mark scheme
Reduces storage space used [1]; reduces the time taken to transmit/upload/download the file [1]
Quiz — Storage & Compression
Q 1 of 8
Score
/ 8
Click to reveal
TermDefinition
🎯

Mini Test — Storage & Compression

10 minutes · 9 marks

← 1.2c Sound Topic 1: Data Representation Next: Topic 2 — Data Transmission →
🔒
Pro Content
Subscribe to access all lessons.
£7.99/month
or £59/year
Subscribe now →