Mission 1 · Spec 4.5.1 – 4.5.3
Number systems, bases and units
Natural, integer, rational, irrational, real and ordinal numbers; binary, decimal and hexadecimal; and decimal versus binary prefixes.
- Starter 5 min
- Learn 15 min
- Lab 15 min
- Quiz 10 min
- Exam 15 min
The missing gigabytes
A "1 TB" drive shows up as about 931 GB on a computer. Has someone stolen 69 GB?
Reveal
No. The manufacturer uses decimal prefixes (1 TB = 1012 bytes); the operating system reports binary units (GiB = 230 bytes). 1012 ÷ 230 ≈ 931.
Key ideas
| Set | Symbol | Contains |
|---|---|---|
| Natural numbers | ℕ | {0, 1, 2, 3, …} (AQA includes 0). Used for counting |
| Integers | ℤ | Whole numbers, positive and negative |
| Rational numbers | ℚ | Numbers that can be written as a fraction of two integers |
| Irrational numbers | Can't be written as a fraction, e.g. √2, π | |
| Real numbers | ℝ | All rational and irrational numbers: possible real-world quantities |
| Ordinal numbers | Describe position: first, second, third |
Bases
Decimal (base 10), binary (base 2), hexadecimal (base 16). Hex is used as a shorthand for binary because it is shorter, easier to read and converts directly (one hex digit = 4 bits).
Units
Binary prefixes: Ki (210), Mi (220), Gi (230), Ti (240). Decimal prefixes: k (103), M (106), G (109), T (1012). A byte is 8 bits; n bits give 2n different values.
Decimal vs binary prefixes
Which set?
The smallest set each number belongs to.Bit flipper
Exam-style questions
1. How many bytes are in 3 MiB? Give your answer as a power of 2 multiplied by an integer.
[1 mark]Mark scheme
- 3 × 220 (= 3,145,728) bytes (1)
2. Explain why hexadecimal is often used instead of binary.
[2 marks]Mark scheme
- It is more compact / easier for humans to read and write, so fewer errors (1)
- It is easy to convert, as each hex digit represents exactly 4 bits (1)
TUTOR NOTES
- Watch out: AQA A Level expects kibi/mebi prefixes, unlike GCSE.
Mission 2 · Spec 4.5.4
Unsigned, two's complement and fixed point
Unsigned binary arithmetic, signed two's complement, and fixed point binary fractions.
- Starter 5 min
- Learn 15 min
- Lab 20 min
- Quiz 10 min
- Exam 15 min
Where does the point go?
If 1011 is 11, what could 10.11 mean in binary?
Reveal
2 + ½ + ¼ = 2.75. Place values after the binary point are ½, ¼, ⅛… That's fixed point binary.
Key ideas
Unsigned binary
n bits represent 0 to 2n − 1. Addition and multiplication of unsigned binary integers.
Two's complement
The MSB has a negative place value. Range −2n−1 to 2n−1 − 1. Negate by flipping bits and adding 1. Subtraction is addition of the negated value.
Fixed point
The binary point is in a fixed position. Precision is fixed by the number of fraction bits; many decimal fractions (e.g. 0.1) can't be represented exactly.
Two's complement explorer
Subtraction by addition
Fixed point
Exam-style questions
1. Represent −19 as an 8-bit two's complement number.
[1 mark]Mark scheme
1110 1101(1)
2. An 8-bit unsigned fixed point number has 4 bits before the binary point. Convert 0110.1100 to decimal.
Mark scheme
- 6.75 (1)
TUTOR NOTES
- Check: 19 = 0001 0011 → flip 1110 1100 → +1 = 1110 1101.
Mission 3 · Spec 4.5.4
Floating point and errors
Floating point representation in two's complement, normalisation, range versus precision, rounding errors (absolute and relative), and underflow and overflow.
- Starter 5 min
- Learn 15 min
- Lab 20 min
- Quiz 10 min
- Exam 15 min
0.1 + 0.2
In many programming languages, 0.1 + 0.2 == 0.3 is False. Why?
Reveal
0.1 and 0.2 can't be stored exactly in binary, so small rounding errors appear. That's why programs compare floats with a tolerance rather than ==.
Key ideas
Floating point
Mantissa × 2exponent, both in two's complement. More mantissa bits: more precision. More exponent bits: more range.
Normalisation
Positive mantissas start 01, negative start 10. Normalised numbers have maximum precision and a unique representation.
Errors
Absolute error = |actual − stored|. Relative error = absolute error ÷ actual value. Relative error matters more when values are small.
Underflow and overflow
Overflow: the number is too large for the exponent. Underflow: too close to zero to be represented, so it becomes 0.
Fixed point vs floating point: floating point has a far greater range for the same bits; fixed point is simpler and faster to process and has consistent absolute precision.
Floating point builder
Exam-style questions
1. A value of 3.3 is stored as 3.25. Calculate the absolute and relative errors.
[2 marks]Mark scheme
- Absolute error = 0.05 (1)
- Relative error = 0.05 ÷ 3.3 ≈ 0.0152 (1.52%) (1)
2. Explain the effect of allocating more bits to the exponent and fewer to the mantissa.
[2 marks]Mark scheme
- The range of numbers that can be represented increases (1)
- The precision decreases (1)
TUTOR NOTES
- Exam habit: show normalisation steps: each shift left of the mantissa decreases the exponent by 1.
Mission 4 · Spec 4.5.5
Information coding and error checking
Character codes (ASCII and Unicode), and detecting and correcting errors with parity, majority voting, checksums and check digits.
- Starter 5 min
- Learn 15 min
- Lab 20 min
- Quiz 10 min
- Exam 15 min
The barcode beep
A supermarket scanner sometimes refuses to beep and makes the cashier scan again. How does it know it misread the barcode?
Reveal
The last digit is a check digit calculated from the others. If the scanner's calculation doesn't match, it knows there was an error.
Key ideas
Character form of a decimal digit
The character "7" (ASCII 55) is different from the number 7 (binary 0111).
ASCII and Unicode
ASCII: 7 bits, 128 characters. Unicode: represents characters from all writing systems; its first 128 codes match ASCII. Introduced so text could be shared internationally.
Parity bit
An extra bit makes the number of 1s even (or odd). Detects a single-bit error but can't correct it or detect two errors.
Majority voting
Each bit is sent (typically) three times; the majority value is used. Can correct errors, but increases the amount of data.
Checksum
A value calculated from the data (e.g. sum MOD 256) is sent with it; the receiver recalculates and compares.
Check digit
A digit calculated from the others (e.g. ISBN, barcodes) to detect data entry errors, including swapped digits.
Error detection and correction
Exam-style questions
1. Explain how majority voting allows errors to be corrected, and one drawback.
[3 marks]Mark scheme
- Each bit is transmitted an odd number of times, e.g. three (1)
- The receiver uses the value that appears most often, so a single error in each group is corrected (1)
- Drawback: much more data must be transmitted / can't correct if two copies are corrupted (1)
2. Explain why a parity bit cannot detect all errors.
[2 marks]Mark scheme
- If an even number of bits are flipped (1)
- the parity is unchanged, so the error is not detected (1)
TUTOR NOTES
- Lab prompt: flip two bits in the parity demo. Is the error spotted?
Mission 5 · Spec 4.5.6
Images, sound, compression and encryption
Bitmaps and vector graphics, analogue and digital sound, the Nyquist theorem and MIDI, run length encoding and dictionary compression, and the Caesar and Vernam ciphers.
- Starter 5 min
- Learn 20 min
- Lab 25 min
- Quiz 10 min
- Exam 15 min
Zoom until it breaks
Zoom far into a photo and it goes blocky; zoom into a company logo on a website and it often stays sharp. Why?
Reveal
The photo is a bitmap (a grid of pixels). The logo is often a vector graphic: shapes described by their properties, redrawn perfectly at any size.
Key ideas
Bitmaps
Size in pixels (width × height), resolution (dots per inch), colour depth. Storage = width × height × colour depth (plus metadata).
Vector graphics
Objects and their properties (e.g. circle: centre, radius, fill colour) stored in a drawing list. Scale without losing quality; small files for simple images; unsuitable for photographs.
Digital sound
Analogue signals are converted by an ADC (and back by a DAC). Size = sample rate × sample resolution × duration. Nyquist: sample at at least twice the highest frequency to reproduce it accurately.
MIDI
Stores event messages (note on/off, pitch, velocity, instrument) instead of samples. Tiny files and easy editing, but can't record voices or real performances.
Compression
Lossy vs lossless. Run length encoding (runs → count and value) and dictionary-based methods (repeated patterns replaced by references).
Encryption
Caesar cipher: easily cracked by brute force or frequency analysis. Vernam cipher: XOR with a truly random, single-use key at least as long as the message, giving perfect security. Other ciphers are only computationally secure.
Pixel studio
Sampling scope
Run length encoding
Caesar cipher
Vernam cipher
Exam-style questions
1. The highest frequency humans can hear is about 20 kHz. Using Nyquist's theorem, explain why CDs use a sample rate of 44.1 kHz.
[2 marks]Mark scheme
- Nyquist: the sample rate must be at least twice the highest frequency to be reproduced (1)
- 2 × 20 kHz = 40 kHz, so 44.1 kHz captures all audible frequencies (with a margin) (1)
2. Explain why the Vernam cipher is said to offer perfect security when used correctly.
[3 marks]Mark scheme
- The key is truly random and at least as long as the message (1)
- The key is used only once (1)
- so the ciphertext contains no pattern / any plaintext of that length is equally likely, so it can't be broken even with unlimited computing power (1)
TUTOR NOTES
- Link: computational security (e.g. AES, RSA) depends on how long it would take to break, not on impossibility.