Question 1
0478 Paper 1 — style1 markState the number of bits in one byte. [1]
Model answer
8 (bits).
Why this scores
1 mark for 8. AO1 (knowledge/recall). A byte = 8 bits; a nibble = 4 bits.
Launching your learning experience…
Detailed notes on Data Representation for Cambridge IGCSE Computer Science, covering key concepts, explanations, examples, and exam-focused revision points.
Storage units (KB to TB) and the two big families of compression — lossy and lossless. Match the compression to the use case for top marks.
Mapped to the Cambridge IGCSE 0478 syllabus (2026-2028).
Each step ×1024 (base-2). KB → MB → GB → TB.
Computer-science contexts use base-2 units (powers of 1024) for storage:
| Unit | Base-2 | Base-10 (SI) | Approx. real-world |
|---|---|---|---|
| Byte (B) | 8 bits | 8 bits | One ASCII character |
| Kilobyte (KB) | 2¹⁰ = 1,024 B | 1,000 B | A short email |
| Megabyte (MB) | 2²⁰ ≈ 1.05 M B | 1,000,000 B | A 3-min MP3 |
| Gigabyte (GB) | 2³⁰ ≈ 1.07 B B | 1,000,000,000 B | A 1-hour HD video |
| Terabyte (TB) | 2⁴⁰ ≈ 1.10 T B | 10¹² B | An average laptop SSD |
| Petabyte (PB) | 2⁵⁰ | 10¹⁵ B | Large data centres |
Why two systems? Computer hardware naturally addresses memory in powers of 2 (because addressing is binary). Storage manufacturers historically used base-10 (1 GB = 10⁹ B) to make capacity sound bigger. The discrepancy is why a "1 TB" hard drive shows up as ~931 GB in your operating system.
Cambridge tip. 0478 uses base-2 (1024). Either accepted by mark scheme but show your method.
Two families. Match to use case.
Compression reduces file size. There are two distinct families.
Lossy compression.
Permanently REMOVES data to shrink the file. Decompression cannot recover the original — only an approximation.
Lossless compression.
Reduces size WITHOUT removing data. Decompression perfectly reconstructs the original.
Choosing between them.
| Use case | Choose | Why |
|---|---|---|
| Web image | Lossy (JPEG) | Bandwidth matters; small quality loss imperceptible |
| Logo / diagram | Lossless (PNG) | Sharp edges + transparency; needs precision |
| Music streaming | Lossy (MP3, AAC) | Bandwidth, mobile data |
| Audio production | Lossless (FLAC, WAV) | Editing requires the original |
| Document / source code | Lossless (ZIP) | Even one byte change breaks it |
| Video streaming | Lossy (H.264, AV1) | File sizes otherwise enormous |
| Medical imaging | Lossless | Diagnostic accuracy depends on every pixel |
Cambridge tip. "When would you use X?" questions are routine. Memorise the use-case table.
Replace runs of identical data with count + value.
Run-length encoding is the simplest lossless compression method.
Algorithm: scan the data; whenever you find consecutive identical bytes, replace them with a (count, value) pair.
Worked example. Input: AAAABBBCCDAA.
Output: 4A3B2C1D2A. Original: 12 characters. Compressed: 10 characters (5 pairs).
When RLE works well:
When RLE works poorly:
Why teach RLE? It's the easiest compression to understand, and it's still used in some image formats (BMP, TIFF) and printer protocols. More sophisticated compression (LZ77 in ZIP/PNG, Huffman coding) builds on the same redundancy idea.
Cambridge tip. RLE questions ask you to (a) compress a string and (b) explain how it works and when it's effective. Top-band candidates note BOTH the use cases and the limitations.
See the full worked example for data storage and file compression →
Verbatim phrases and definitions Cambridge mark schemes credit.
Storage-unit conversions and lossy-vs-lossless distinctions appear most series. RLE worked examples (compressing a given string) appear about half the time. Examiner reports flag candidates who don't include WHEN each compression type is appropriate.
Sources: Cambridge IGCSE Computer Science 0478 syllabus (2026-2028); 0478 Examiner Reports 2022-2024; 0478/12 May/Jun 2024 question paper and mark scheme. Last reviewed 2026-05-09.
Step-by-step solutions to past-paper-style questions on data storage and file compression, written exactly the way a tutor would explain them at the board.
Question
State how many bits are in a nibble and how many bits are in a byte. (2 marks)
Step-by-step solution
Step 1
A bit is the smallest unit — a single binary digit, 0 or 1. A nibble is half a byte, so it holds 4 bits.
Step 2
A byte is 8 bits. From there the binary prefixes go up in powers of 1024: 1 kibibyte (KiB) = 1024 bytes, 1 mebibyte (MiB) = 1024 KiB, 1 gibibyte (GiB) = 1024 MiB, 1 tebibyte (TiB) = 1024 GiB.
Answer
A nibble = 4 bits. A byte = 8 bits.
Examiner tip
1 mark each. The 2026-2028 syllabus uses the binary prefixes (KiB, MiB, GiB, TiB), each 1024 of the unit below it — memorise the ladder bit → nibble → byte → KiB → MiB → GiB → TiB.
Question
Convert 5 GiB into bytes, showing your method. (3 marks)
Step-by-step solution
Step 1
Use the chain. 1 KiB = 1024 bytes. 1 MiB = 1024 KiB. 1 GiB = 1024 MiB. Each prefix is 1024 (2¹⁰) of the one below it.
Step 2
Multiply. 5 GiB = 5 × 1024 MiB × 1024 KiB × 1024 bytes = 5 × 1024³ bytes.
Step 3
Calculate. 1024³ = 1,073,741,824. 5 × 1,073,741,824 = 5,368,709,120 bytes.
Answer
5 GiB = 5 × 1024³ = 5,368,709,120 bytes (≈ 5.37 × 10⁹).
Examiner tip
Cambridge uses 1024-based binary prefixes. Award method marks for the 1024³ chain even if the final arithmetic slips. Always show the multiplication.
Question
A memory stick has 16 GiB of free storage. Each photo file is 4 MiB. Calculate how many of these photos can be stored on the memory stick. (4 marks)
Step-by-step solution
Step 1
Work in the same unit. Convert the device capacity to MiB so it matches the file size. 16 GiB × 1024 = 16,384 MiB.
Step 2
Set up the division. Number of files = total free space ÷ size of one file = 16,384 MiB ÷ 4 MiB.
Step 3
Calculate. 16,384 ÷ 4 = 4096.
Step 4
Sense-check / rounding rule. A file only fits if it is complete, so you would round DOWN any remainder. Here it divides exactly, so the answer is 4096 photos.
Answer
16 GiB = 16,384 MiB; 16,384 ÷ 4 = 4096 photos.
Examiner tip
The classic trap is mixing units (dividing GiB by MiB). Convert both to the same unit first. When a remainder occurs, round DOWN — a partial file cannot be stored.
Question
A bitmap image is 800 pixels wide by 600 pixels high. Each pixel is stored using 3 bytes (24-bit colour). Calculate the file size in mebibytes (MiB). (4 marks)
Step-by-step solution
Step 1
Count the pixels. Total pixels = width × height = 800 × 600 = 480,000 pixels.
Step 2
Find the size in bytes. Each pixel = 3 bytes, so 480,000 × 3 = 1,440,000 bytes.
Step 3
Convert to KiB then MiB. 1,440,000 ÷ 1024 = 1406.25 KiB. 1406.25 ÷ 1024 = 1.373… MiB.
Step 4
Round sensibly. File size ≈ 1.37 MiB (to 2 d.p.).
Answer
480,000 pixels × 3 bytes = 1,440,000 bytes = 1,406.25 KiB ≈ 1.37 MiB.
Examiner tip
Image file size = width × height × colour depth (in bytes). Watch the unit asked for — convert with 1024, not 1000. Method marks are awarded for each correct stage even if rounding differs.
Question
Distinguish between lossy and lossless compression. Give one example of each and one situation where each is appropriate. (6 marks)
Step-by-step solution
Step 1
Lossy (2 marks). Removes data permanently to reduce file size. The original cannot be recovered. Reduces quality. Examples: JPEG (images), MP3 (audio), MPEG (video).
Step 2
Lossless (2 marks). Reduces file size WITHOUT removing data. The original can be perfectly reconstructed. Examples: ZIP, PNG, FLAC, RLE.
Step 3
When lossy is appropriate (1 mark). When some quality loss is acceptable for much smaller files — e.g., music streaming, web images, video calls.
Step 4
When lossless is appropriate (1 mark). When perfect reproduction is needed — e.g., text documents, source code, financial records, archival photos.
Answer
Lossy: data permanently removed (JPEG, MP3); good for streaming/web. Lossless: data fully recoverable (ZIP, PNG); essential for documents, code, archives.
Examiner tip
A 6-mark compare question always wants the definition pair, an example each, AND a context each. Do not just define — earn the application marks.
Question
Apply RLE to compress: AAAABBBCCDAA. Show the result and explain how RLE works. (5 marks)
Step-by-step solution
Step 1
RLE works by replacing consecutive identical characters with a count + the character. (1 mark)
Step 2
Identify runs. AAAA = 4 As. BBB = 3 Bs. CC = 2 Cs. D = 1 D. AA = 2 As.
Step 3
Encode. 4A 3B 2C 1D 2A.
Step 4
Compare sizes. Original: 12 characters. Encoded: 10 characters (5 count+character pairs). RLE works best when there are LONG runs of identical data, and can make varied data LARGER.
Answer
Compressed: 4A3B2C1D2A. RLE replaces runs of identical characters with count+character pairs. Effective for data with long repeats; ineffective for varied data.
Examiner tip
RLE is one of the simplest lossless algorithms. Mark scheme typically wants the output PLUS an explanation of how it works. Note RLE is lossless — the original is fully recoverable.
High-scoring sample answers for data storage and file compression on the Cambridge IGCSE 0478 paper, with examiner-style notes mapping each response to the mark scheme and assessment objectives.
State the number of bits in one byte. [1]
Model answer
8 (bits).
Why this scores
1 mark for 8. AO1 (knowledge/recall). A byte = 8 bits; a nibble = 4 bits.
A file is 3 KiB in size. Calculate the size of this file in bytes. [2]
Model answer
1 KiB = 1024 bytes (1 mark for the conversion). 3 × 1024 = 3072 bytes (1 mark for the answer).
Why this scores
1 mark for using 1024, 1 mark for 3072. AO2 (application). Accept correct working even if final value mis-typed; reward the 1024 method.
Give three reasons why a user may wish to compress a file before sending it as an email attachment. [3]
Model answer
Any three of: it reduces the file size so it takes up less storage space; it transmits/downloads faster (less bandwidth used); it may fit within the email attachment size limit; several files can be combined into one (e.g. a ZIP) for convenience.
Why this scores
1 mark per valid reason, max 3. AO1/AO2. Do not credit the same point twice worded differently (e.g. 'smaller' and 'takes less space').
Run-length encoding (RLE) is a form of lossless compression. Apply RLE to the string WWWWWBBWWWB and state the compressed output, then state one type of data for which RLE is well suited. [4]
Model answer
Runs: WWWWW = 5W, BB = 2B, WWW = 3W, B = 1B (1 mark for identifying the runs correctly). Compressed output: 5W 2B 3W 1B (1 mark). RLE is lossless, so the original can be fully reconstructed (1 mark). Well suited to data with long runs of identical values, e.g. simple bitmap/icon images with large areas of a single colour (1 mark).
Why this scores
Marks: correct run identification, correct count+character output, lossless point, suitable data type. AO2/AO3. Accept the output written as 5W2B3W1B.
A portable music player has 2 GiB of free storage. Each song file is 5 MiB. Calculate the maximum number of complete songs that can be stored. Show your working. [5]
Model answer
Convert the capacity to the same unit as the file: 2 GiB × 1024 = 2048 MiB (1 mark for converting GiB→MiB, 1 mark for 2048). Divide: 2048 MiB ÷ 5 MiB = 409.6 (1 mark for the division setup, 1 mark for 409.6). A partial song cannot be stored, so round DOWN to 409 complete songs (1 mark for rounding down to 409).
Why this scores
AO2/AO3. Method marks for converting to a common unit and for the division. The final mark requires rounding DOWN — 409, not 410. A common error is dividing 2 GiB by 5 MiB without converting units.
Explain the difference between lossy and lossless compression. In your answer, give one example of a file type that uses each, and identify one situation where each would be the better choice. [6]
Model answer
Lossy compression permanently removes some data to reduce the file size, so the original file cannot be fully reconstructed and some quality is lost (1 mark). Example: MP3 (audio) or JPEG (images) (1 mark). Lossy is the better choice when smaller files matter more than perfect quality, e.g. streaming music or photos on a website, where the loss is barely noticeable (1 mark).
Lossless compression reduces the file size without removing any data, so the original can be perfectly reconstructed when decompressed (1 mark). Example: ZIP or PNG (or RLE) (1 mark). Lossless is the better choice when every bit must be preserved, e.g. compressing text documents, program source code or financial records (1 mark).
Why this scores
6 marks = 3 per compression type (definition, example, suitable situation). AO1 (definitions) + AO2 (application to context). The original-cannot-be-recovered vs can-be-recovered contrast is the key discriminator examiners look for.
The formulae you need to memorise for data storage and file compression on the Cambridge IGCSE 0478 paper, with every variable defined in plain English and a note on when to use it.
1 KiB=210 B, 1 MiB=220 B, 1 GiB=230 B, 1 TiB=240 B
When to use
Converting between storage units. Each prefix is 1024 (2¹⁰) of the unit below it.
Example
5 GiB = 5 × 2³⁰ ≈ 5.37 × 10⁹ bytes.
file size=width×height×colour depth
When to use
Calculating the storage needed for an uncompressed bitmap image. Keep colour depth in consistent units (bits or bytes).
Example
800 × 600 × 3 bytes = 1,440,000 bytes ≈ 1.37 MiB.
number of files=⌊size of one filefree space⌋
When to use
Working out how many complete files fit on a storage device. Convert both quantities to the SAME unit first, then round DOWN (a partial file does not fit).
Example
16,384 MiB ÷ 4 MiB = 4096 files.
Definitions to memorise and the exact keywords mark schemes credit for data storage and file compression answers — sharpened from recent examiner reports for the 2026 0478 sitting.
A binary digit — a single 0 or 1. The smallest unit of data storage.
4 bits — half a byte.
8 bits. The fundamental unit of digital storage.
1024 bytes (2¹⁰ bytes).
1024 KiB = 2²⁰ bytes (≈ 1 million bytes).
1024 MiB = 2³⁰ bytes (≈ 1 billion bytes).
1024 GiB = 2⁴⁰ bytes (≈ 1 trillion bytes).
Reducing file size to save storage space and reduce transmission time.
Compression that PERMANENTLY removes data to reduce size. Original cannot be reconstructed. e.g., JPEG, MP3, MPEG.
Compression that reduces size WITHOUT data loss. Original is fully recoverable. e.g., ZIP, PNG, FLAC, RLE.
A lossless compression method that replaces runs of identical data with a count + value pair. Effective for repetitive data.
The traps other students keep falling into on data storage and file compression questions — taken from recent Cambridge IGCSE 0478 examiner reports and mark schemes — and how to avoid them.
Why it happens
Confusing the SI/decimal prefixes (kilo, mega) with the binary prefixes (kibi, mebi) used in the 0478 syllabus.
How to avoid it
Use 1024 (2¹⁰) for KiB/MiB/GiB/TiB. 1 KiB = 1024 bytes, 1 MiB = 1024 KiB, and so on up the ladder.
Why it happens
Reading 'how many files fit' too quickly and dividing e.g. GiB by MiB.
How to avoid it
Convert BOTH the device capacity and the file size to the same unit first, then divide. Round DOWN — a partial file cannot be stored.
Why it happens
Data loss sounds negative.
How to avoid it
Lossy is APPROPRIATE for media where some quality loss is imperceptible (audio as MP3, web images as JPEG). It enables streaming and small file sizes that lossless can't match.
Why it happens
Confusing 'compressed' with 'lossy'.
How to avoid it
ZIP is LOSSLESS. The original file can be perfectly recovered after extraction. Otherwise it would be useless for documents, code, etc.
Why it happens
Treating the question as definitional.
How to avoid it
Mark schemes for 6-mark compression questions ALWAYS expect a use-case for each type. Memorise: lossy for streaming/web; lossless for documents/code/archives.
The things students keep getting wrong in this sub-topic, answered.