Data Representation — Complete GCSE Computer Science Guide
Binary, denary, hexadecimal, ASCII, file sizes and image representation explained for GCSE Computer Science. Worked conversions, exam technique and common mistakes for AQA, OCR and Cambridge.
Gareth Edgell
Head of CS · Senior Examiner · 15+ years tutoring
Data representation covers roughly 15–20% of the GCSE Computer Science Paper 1 marks. Every exam includes binary conversion, a file size calculation, and at least one question on character encoding or image representation. Calculators are not permitted — every answer must be worked out by hand.
This guide covers every data representation topic you need, with worked examples and exam technique.
Number bases — the fundamentals
Computers store everything as binary (base 2) because transistors have two states: on (1) and off (0). We use denary (base 10) in everyday life. Hexadecimal (base 16) is a shorthand for binary used by programmers.
All three represent the same values — just in different ways.
Binary to denary
Use column headers: 128, 64, 32, 16, 8, 4, 2, 1
Example: Convert 10110101 to denary
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| 1 | 0 | 1 | 1 | 0 | 1 | 0 | 1 |
128 + 32 + 16 + 4 + 1 = 181
Denary to binary
Repeated subtraction (or repeated division by 2):
Example: Convert 93 to binary
- 93 − 64 = 29 → put 1 in the 64 column
- 29 − 16 = 13 → put 1 in the 16 column
- 13 − 8 = 5 → put 1 in the 8 column
- 5 − 4 = 1 → put 1 in the 4 column
- 1 − 1 = 0 → put 1 in the 1 column
Result: 01011101
Verify: 64 + 16 + 8 + 4 + 1 = 93 ✓
Binary to hexadecimal
Hexadecimal uses digits 0–9 then A=10, B=11, C=12, D=13, E=14, F=15.
Method: Split binary into groups of 4 (nibbles) from the right. Convert each nibble to its hex equivalent.
Example: Convert 10110101 to hex
- Split: 1011 | 0101
- 1011 = 8+2+1 = 11 = B
- 0101 = 4+1 = 5 = 5
- Result: B5
Hex to binary: Reverse — expand each hex digit to its 4-bit binary.
Two’s complement (signed integers)
Two’s complement allows computers to store negative numbers. The most significant bit (MSB) has a negative place value.
For 8-bit two’s complement:
- Place values: −128, 64, 32, 16, 8, 4, 2, 1
- Range: −128 to +127
Example: What is the value of 11010110 in two’s complement?
- MSB is 1 → negative number
- −128 + 64 + 16 + 4 + 2 = −128 + 86 = −42
Converting −25 to two’s complement:
- Write +25 in binary: 00011001
- Invert all bits: 11100110
- Add 1: 11100111
Verify: −128 + 64 + 32 + 4 + 2 + 1 = −128 + 103 = −25 ✓
Character encoding
ASCII
- 7-bit code, 128 characters
- Covers: uppercase A–Z (65–90), lowercase a–z (97–122), digits 0–9 (48–57), punctuation
- Exam tip: The ASCII value of ‘A’ is 65. Lowercase letters are 32 more than uppercase. This is tested directly.
Unicode
- Variable length encoding (UTF-8 uses 1–4 bytes)
- Covers over 1.1 million characters — all world scripts, emoji
- UTF-8’s first 128 code points are identical to ASCII (backward compatible)
- Why Unicode over ASCII? ASCII can only represent 128 characters — insufficient for international languages, emoji, mathematical symbols.
Image representation
Calculating image file size
Formula: file size (bits) = width (pixels) × height (pixels) × colour depth (bits per pixel)
Colour depth: number of bits used per pixel
- 1-bit = 2 colours (black and white)
- 8-bit = 256 colours
- 24-bit = 16,777,216 colours (True Colour — 8 bits each for R, G, B)
Example: A 640 × 480 image with 24-bit colour depth. Calculate the file size in kilobytes.
- Bits: 640 × 480 × 24 = 7,372,800 bits
- Bytes: 7,372,800 ÷ 8 = 921,600 bytes
- Kilobytes: 921,600 ÷ 1024 = 900 KB
Always show all three steps — the method marks are available even if you make an arithmetic error.
Metadata
Digital images also contain metadata — information ABOUT the image (dimensions, colour depth, file format, creation date). This adds to the file size but is separate from the pixel data itself.
Sound representation
Formula: file size (bits) = sample rate (Hz) × bit depth × duration (seconds)
- Sample rate: how many times per second the audio is measured (e.g. 44,100 Hz for CD quality)
- Bit depth: how precisely each sample is recorded (e.g. 16-bit)
- Higher sample rate → more accurate reproduction → larger file
- Higher bit depth → more volume levels → larger file
Example: 44,100 Hz sample rate, 16-bit depth, 3-minute stereo recording.
- Duration: 3 × 60 = 180 seconds
- Bits: 44,100 × 16 × 180 × 2 (stereo) = 254,016,000 bits
- Bytes: ÷ 8 = 31,752,000 bytes ≈ 30.3 MB
Common exam mistakes
1. Forgetting to convert from bits to bytes The formula gives file size in bits. Divide by 8 for bytes, then by 1024 for kilobytes. Missing one step is a common error — always show each conversion.
2. Binary to hex with odd number of bits If you have 12 binary digits: split from the RIGHT into groups of 4 — 4 | 4 | 4. Never split from the left.
3. “More pixels = better quality” — incomplete answer The full answer is: “more pixels OR greater colour depth = larger file size AND higher quality/more detail”. Examiners want both.
4. Two’s complement — forgetting to add 1 The process: (1) write positive value, (2) invert ALL bits, (3) add 1. Students often forget step 3. Without adding 1, the number is incorrect.
Practice
Use the Binary & Hex Converter to practise conversions with immediate feedback. The Question Bank has data representation questions across all topics with worked mark schemes. AQA GCSE Revision covers this topic in full.