Skip to content
Marlbridge

Revision Notes

Data Representation: Revision Notes

Condensed recall notes on binary, hexadecimal, character sets, images, sound and compression for Cambridge IGCSE Computer Science 0478.

Level
IGCSE
Topic
Data representation
Updated

Aligned to Cambridge IGCSE Computer Science (0478), 2026-2028. Official specification .

Syllabus points this page covers

0478

  • 1.1 Number systems
  • 1.2 Text, sound and images
  • 1.3 Data storage and compression

This page covers all 3 subtopics in topic 1, Data representation.

Found an error? Report a correction.

Condensed for the final weeks. For worked examples, use the Data Representation study guide, which covers Topic 1 (1.1 Number systems, 1.2 Text/sound/images, 1.3 Data storage and compression) in full for Cambridge IGCSE Computer Science 0478, 2026–2028 series. For further exam-style practice with worked answers on this topic, see the Data Representation practice questions.

Number conversions

Denary -> Binary : subtract place values 128 64 32 16 8 4 2 1
Binary -> Hex    : split into NIBBLES (4 bits), convert each
Hex digits       : 0-9 then A=10 B=11 C=12 D=13 E=14 F=15

Example  217  ->  11011001  ->  1101 1001  ->  D9

Hex is used because it is compact and readable for humans: MAC addresses, IPv6, colour codes, memory dumps, error codes.

Place values 128 to 1 sit above the bits of 11010010. Bits that are 1 add up to 210. The byte splits into two nibbles, 1101 (13, hex D) and 0010 (2, hex 2), giving D2.
The byte 11010010 is 210 in denary and D2 in hexadecimal.

Binary arithmetic

  • Add column by column, carrying when the total reaches 2.
  • Overflow — the result needs more bits than the register holds; the extra bit is lost and the answer is wrong.
  • Logical shift left = ×2 per place. Right = ÷2 per place. Bits shifted out are lost.
Adding 11010010 (210) and 01100011 (99) gives 100110101 (309), which needs 9 bits. The 8-bit register keeps only 00110101 (53), so the answer is wrong. Overflow occurs because 309 is more than 255.
Adding 210 and 99 in an 8-bit register overflows because 309 needs 9 bits.

Character sets

Set Bits Characters
ASCII 7 128
Extended ASCII 8 256
Unicode 16+ Very wide range of writing systems

Unicode supports a very wide range of languages and scripts but can produce larger file sizes than ASCII, though UTF-8 keeps ASCII characters at a single byte.

File size formulas

IMAGE  size (bits) = width x height x colour depth
SOUND  size (bits) = sample rate x sample resolution x seconds

bits -> bytes : / 8
bytes -> KiB  : / 1024      KiB -> MiB : / 1024
  • Resolution = number of pixels. Colour depth = bits per pixel; n bits gives 2ⁿ colours.
  • Sample rate = samples per second (Hz). Sample resolution = bits per sample.
  • Increasing any of these improves quality and increases file size.
An 800 by 600 image with 24 bits per pixel is 11,520,000 bits. Dividing by 8 gives 1,440,000 bytes, then by 1024 twice gives 1.37 MiB. Halving the colour depth to 12 bits halves the size but leaves only 4096 colours.
The 800 x 600, 24-bit image is 1.37 MiB; halving the colour depth halves the size.
Two graphs show the same wave sampled 6 times and 18 times per cycle. More samples follow the wave more closely but mean three times as much data to store. Example numbers are illustrative.
More samples per second give a closer copy of the sound but a bigger file.
Two graphs show the same wave stored with 2 bits (4 levels) and 4 bits (16 levels) per sample. More bits per sample record each measurement more precisely but make the file bigger. Example numbers are illustrative.
More bits per sample record each measurement more precisely at the cost of a larger file.

Two’s complement

Represents negative numbers in binary. The most significant bit has a negative place value:

8-bit place values:  -128  64  32  16  8  4  2  1

Example: represent -19
  19 in binary        = 00010011
  Flip every bit      = 11101100
  Add 1               = 11101101   <- this is -19

Check: -128+64+32+8+4+1 = -19 (correct)

To convert back to denary, sum the place values directly using the negative value for the leftmost bit — there is no need to reverse the flip-and-add-one process to read a two’s complement number.

Compression

Lossless Lossy
Data All recoverable Permanently discarded
Method Removes redundancy (e.g. RLE) Removes detail humans barely notice
File size Larger Much smaller
Use for Text, program files, spreadsheets Photos, music, video

Never use lossy for a file where every byte matters — a program would not run.

Run length encoding (RLE) replaces a run of identical repeated values with a single value-and-count pair:

Original:   WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW
RLE:        12W 1B 12W 3B 24W 1B 14W

RLE works best on images with large blocks of a single colour (simple graphics, icons); it barely helps a photograph, where colour varies pixel to pixel.

Data storage units

A nibble is 4 bits, and a byte is 8 bits (two nibbles). From the kibibyte upwards, each unit is 1024 times the one before it:

bit -> nibble (4 bits) -> byte (8 bits) -> kibibyte (KiB)
    -> mebibyte (MiB) -> gibibyte (GiB) -> tebibyte (TiB)
    -> pebibyte (PiB) -> exbibyte (EiB)

The “-bi-” (kibi, mebi, gibi…) naming makes explicit that the factor is 1024, not 1000 — a distinction the syllabus is specific about: it names only these binary units, and file-size calculations must use 1024.

A nibble is 4 bits and a byte is 8 bits. From the kibibyte upwards each unit is 1024 times the one below it, up to the exbibyte. Bar length is on a log scale.
Each storage unit from the kibibyte up is 1024 times the previous one, not 1000.

Exam traps

  • Divide by 1024, not 1000, for KiB and MiB.
  • Don’t forget bits → bytes (÷8) before converting further.
  • Sample rate vs sample resolution — these are different things.
  • Hexadecimal is for human readability; the computer stores binary.
  • Lossy compression is permanent — the data cannot be restored.
  • In two’s complement, forgetting to add 1 after flipping the bits — the flip alone gives one’s complement, not two’s complement.
  • Applying RLE to a photograph and expecting a large saving — natural images rarely have long runs of identical values, so lossy compression (e.g. JPEG) suits them far better.
  • Labelling a 1024-based answer “KB” or “MB” — the syllabus units are KiB and MiB, and the answer must be in the unit the question asks for.

Self-test

  1. Convert denary 174 to binary and hex.
  2. An image is 1024 × 768 with 24-bit colour. Give the size in MiB.
  3. What causes overflow?
  4. Why is Unicode preferred over ASCII for a multilingual website?
  5. Which compression type suits a spreadsheet, and why?
  6. Represent −19 in 8-bit two’s complement.
  7. Why does RLE compress a simple icon well but a photograph poorly?

Answers: 1. 10101110 → nibbles 1010 1110 → AE. 2. 1024×768×24 = 18,874,368 bits ÷ 8 = 2,359,296 bytes ÷ 1024 = 2304 KiB ÷ 1024 = 2.25 MiB. 3. The result of a calculation requires more bits than the register can hold, so the most significant bit is lost. 4. ASCII cannot represent non-Latin scripts; Unicode covers a very wide range of the world’s writing systems. 5. Lossless — any discarded data would corrupt values and formulas. 6. Write 19 as 00010011, flip every bit to get 11101100, then add 1 to get 11101101. 7. An icon typically has long runs of identical pixel values that RLE can replace with a single value-and-count pair, while a photograph’s colours vary almost pixel to pixel, giving very few long runs to compress.

Frequently asked questions

How do you calculate the file size of an image in IGCSE Computer Science? Multiply width by height by colour depth to get the size in bits, then divide by 8 for bytes and by 1024 for each step to KiB and MiB.

What is overflow in binary addition? Overflow happens when a result needs more bits than the register can hold, so the extra bit is lost and the answer is wrong.

Why is Unicode used instead of ASCII? ASCII uses 7 bits for 128 characters and cannot represent non-Latin scripts, while Unicode covers a very wide range of the world’s writing systems. Unicode can produce larger files, though UTF-8 keeps ASCII characters at one byte.

Why does run-length encoding work badly on photographs? RLE replaces runs of identical values with a value-and-count pair, but a photograph’s colours vary almost pixel to pixel, so there are few long runs to compress. Lossy compression suits photographs better.

Related resources

Get free revision emails (optional)

Occasional emails with practice questions, worked explanations and links to free resources for the qualification and subjects you choose. No spam, and you can unsubscribe from any email. The free tools on this site never need an email.