This mini-lesson covers AQA 4.5 β Fundamentals of data representation, the most calculation-heavy topic on the course. Every number below is one you must be able to work out by hand, in an exam, without a calculator.
Work through each screen, answer the questions as you go (some are recall, some are calculations you must actually work out) and collect β stars. Press Start when you're ready.
A number base is just a set of column values. Denary uses powers of 10, binary powers of 2, hexadecimal powers of 16 (digits 0β9 then A=10, B=11, C=12, D=13, E=14, F=15).
Denary β binary: work left to right through the column headings, taking each one you can. 217 β 128 = 89; 89 β 64 = 25; 32 is too big (0); 25 β 16 = 9; 9 β 8 = 1; 4 and 2 too big; 1 β 1 = 0. Result 11011001.
Binary β hex: split into nibbles of 4 bits and convert each: 1101 = 13 = D, 1001 = 9. So 11011001 = D9. Check: D9 = 13 Γ 16 + 9 = 208 + 9 = 217 β
Why hex exists: it is human shorthand for binary. One hex digit = exactly 4 bits, so a byte is always 2 hex digits. It is shorter, far less error-prone to read, and maps back to binary with no arithmetic. Memory addresses, colour codes (#FF8800) and MAC addresses are all written in hex.
Units: AQA uses decimal prefixes β 1 kB = 10Β³ bytes, 1 MB = 10βΆ, 1 GB = 10βΉ, 1 TB = 10ΒΉΒ². The binary prefixes are separate: 1 KiB = 2ΒΉβ° = 1024 bytes, 1 MiB = 2Β²β° bytes.
To store negative numbers, the most significant bit is given a negative weight. In 8 bits:
To negate a number: write the positive value in binary, flip every bit, then add 1.
Range in n bits: from β2βΏβ»ΒΉ to +2βΏβ»ΒΉ β 1. For 8 bits that is β128 to +127 β note the asymmetry: there is one more negative value than positive, because 0 uses up a positive-looking pattern.
Why two's complement won: there is only one representation of zero (sign-and-magnitude has +0 and β0), and subtraction becomes addition: A β B is computed as A + (βB) using the ordinary adder circuit. One piece of hardware does both.
Put a binary point in a fixed position and the columns to its right carry negative powers of 2:
With a fixed point, the number of bits before and after the point is decided in advance. That fixes both the range and the precision β and you cannot trade one for the other.
The fatal flaw: many everyday denary fractions have no exact binary representation. 0.1 in binary is 0.0001100110011β¦ recurring forever. Truncating it introduces a tiny error β which is precisely why 0.1 + 0.2 does not equal 0.3 in most languages, and why money is stored in whole pence.
Floating point stores a number in two parts, in the form:
The mantissa carries the significant digits (and so sets the precision); the exponent says where the binary point goes (and so sets the range). For a fixed total word length, giving bits to one takes them from the other β that is the central trade-off.
Normalisation squeezes the maximum precision out of the mantissa by removing leading redundant bits:
In both cases the first two bits differ. The exponent is adjusted to compensate for each shift, so the value is unchanged.
Mantissa 0.1101000, exponent 0011 (= +3).
Shift the point 3 places right: 0110.1000
= 4 + 2 = 6, plus 0.5 β 6.5
Because a mantissa has finitely many bits, most reals can only be stored approximately. The gap between the true value and the stored one is a rounding error β and errors accumulate across millions of operations.
The relative error is usually the meaningful one: an absolute error of 1 km is catastrophic in surveying and irrelevant in astronomy.
| More bits in the⦠| Effect |
|---|---|
| mantissa | greater precision (finer detail), smaller range |
| exponent | greater range (bigger and smaller magnitudes), coarser precision |
The bug that costs lives: in 1991 a Patriot missile battery tracked time as a 24-bit fixed-point count of tenths of a second. 0.1 has no exact binary form, so after 100 hours of running, the accumulated rounding error was about a third of a second β enough to misplace an incoming missile by half a kilometre. 28 people died. Rounding error is not an academic curiosity.
ASCII uses 7 bits for 128 characters (often stored in a byte with the top bit spare). It cannot represent Greek, Arabic, Chinese or an emoji. Unicode was created to fix exactly that: it assigns a unique code point to every character in every script, needing 16 bits or more per character.
Data in transit gets corrupted. Four standard defences:
Detect vs correct: parity, checksums and check digits only detect β the data must be re-sent. Majority voting and other error-correcting codes can repair the data in place. That matters enormously for a spacecraft that cannot simply be asked to re-transmit.
A bitmapped image is a grid of pixels. Resolution = pixels across Γ down. Colour depth = bits per pixel, giving 2βΏ possible colours (24-bit gives 2Β²β΄ β 16.7 million).
800 Γ 600 pixels at 24-bit colour
= 480 000 pixels Γ 24 bits = 11 520 000 bits
= 11 520 000 Γ· 8 = 1 440 000 bytes (β 1.44 MB)
A vector image instead stores objects (line, circle, fill) with properties. It scales to any size with no loss of quality and is usually far smaller β but it is hopeless for a photograph.
Sound is a continuous analogue wave, sampled by an ADC. Sampling rate (Hz) = samples per second; sample resolution = bits per sample.
10 s of mono at 44 100 Hz, 16-bit
= 44 100 Γ 16 Γ 10 = 7 056 000 bits
= 882 000 bytes
Nyquist: to reproduce a frequency f you must sample at at least 2f. Human hearing tops out near 20 kHz β which is exactly why CD audio samples at 44.1 kHz. MIDI stores no sound at all: it stores instructions (note, pitch, velocity, duration), so it is tiny and endlessly editable, but it can never capture a real singer.
Lossless compression discards nothing: the original is restored bit for bit. Essential for text, code and executables β a program with a few bits missing is not a program.
Lossy compression permanently throws data away, exploiting the limits of human perception β MP3 removes frequencies you cannot hear, JPEG discards fine colour detail your eye ignores. It achieves far higher compression ratios, and the discarded data is gone forever.
Exam trap: RLE is lossless, even though it is used on images. Being used on media does not make a method lossy β what matters is whether the original can be reconstructed exactly.
Caesar cipher β shift each letter by a fixed amount. Trivially broken: there are only 25 keys, and frequency analysis cracks it instantly because E remains the commonest letter.
Vernam cipher (one-time pad) β XOR the plaintext with a truly random key that is at least as long as the message and is used exactly once. It is the only cipher that is mathematically unbreakable: every possible plaintext of that length is equally likely. Decryption is the same operation again, because XOR is its own inverse.
| Symmetric | Asymmetric |
|---|---|
| One shared key encrypts and decrypts | A public key encrypts; only the matching private key decrypts |
| Fast β good for bulk data | Slow β used to exchange a symmetric key, and for digital signatures |
| The problem: how do you share the key securely? | Solves key distribution: the public key can be shouted from the rooftops |
Hashing is not encryption. A hash is one-way β it is designed to be impossible to reverse. Passwords are stored as hashes so that a stolen database reveals nothing usable. Encryption is designed to be reversed by whoever holds the key; hashing is designed never to be reversed at all.
Tap a technique, then tap the group it belongs to.
Tap an item on the left, then its partner on the right.
Bases: 217 = 11011001 = D9 Β· one hex digit = 4 bits Β· 1 kB = 10Β³ B, 1 KiB = 2ΒΉβ° B
Two's complement: MSB is negative Β· negate = flip and add 1 Β· 8-bit range β128 to +127 Β· subtraction becomes addition
Fractions: columns right of the point are Β½, ΒΌ, β β¦ Β· 0110.1010 = 6.625 Β· 0.1 has no exact binary form
Floating point: mantissa Γ 2^exponent Β· normalise: positive starts 0.1, negative starts 1.0 Β· mantissa = precision, exponent = range
Coding & errors: ASCII 7-bit vs Unicode Β· parity/checksum/check digit detect Β· majority voting corrects
Images & sound: size = w Γ h Γ depth Β· size = rate Γ resolution Γ time Γ channels Β· Nyquist: sample at 2f
Compression: lossless (RLE, LZW) recovers exactly Β· lossy (MP3, JPEG) discards permanently
Encryption: Caesar (weak) Β· Vernam (unbreakable, one-time pad) Β· symmetric = fast, asymmetric = solves key exchange Β· hashing is one-way
That is the whole of AQA 4.5. Press Finish to see your score.
You've worked through Fundamentals of data representation for AQA A-level Computer Science (7517). π
Your stars: 0 / 0
Next: test yourself in the Evaluate stage Confidence Quiz, then lock it in with Verify.