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

  1. Why Computers Use Binary
  2. Counting in Binary
  3. Hexadecimal — Shorthand for Binary
  4. Binary Addition & Overflow
  5. Negative Numbers — Two's Complement
  6. Logical Binary Shifts
  7. Representing Text
  8. Representing Images
  9. Representing Sound
  10. Storage Units & Compression
  11. Floating-Point Numbers (A Level)
  12. More Number Representations
  13. File Organisation & Access (A Level)
  14. Check Your Understanding