Ch 12 · More Number Representations · Theory
Topic 12 of 14 in Data Representation — How Computers Store Everything as Numbers — 4 lessons.
Binary Subtraction
Computers don't have separate subtraction circuits — they add the negative. To do A − B, they form −B in two's complement and add it. Compute 30 − 12 in 8 bits:
Binary-Coded Decimal (BCD)
BCD stores each denary digit as its own 4-bit code, instead of converting the whole number. So 59 becomes 0101 1001 (5, then 9) — *not* the pure binary 00111011.
Unicode in Bytes: UTF-8
Unicode gives every character a number (a code point), but that number still has to be stored as bytes. UTF-8 is the dominant scheme: it uses 1 to 4 bytes per character, and — crucially — the first 128 characters use a single byte identical to ASCII.
Normalisation, Worked (A Level)
Recall a float is *mantissa × 2^exponent*. Normalising shifts the mantissa so its most significant bits carry real information (no wasted leading zeros), squeezing maximum precision from the bits available.
All topics in Theory Data-representation
- Why Computers Use Binary
- Counting in Binary
- Hexadecimal — Shorthand for Binary
- Binary Addition & Overflow
- Negative Numbers — Two's Complement
- Logical Binary Shifts
- Representing Text
- Representing Images
- Representing Sound
- Storage Units & Compression
- Floating-Point Numbers (A Level)
- More Number Representations
- File Organisation & Access (A Level)
- Check Your Understanding