Character Sets – ASCII & Unicode

Character Sets Overview

  • Character set: the list of numeric codes recognised by hardware & software to represent characters.
  • Each character ⟶ unique character code ⟶ stored as binary.

ASCII

  • Original ASCII: 77-bit; represents 128128 characters (codes 0–1270\text{–}127).
  • Extended ASCII: 88-bit; represents 256256 characters (codes 0–2550\text{–}255).
  • Content groups
    • Uppercase A–ZA\text{–}Z: 65–9065\text{–}90
    • Lowercase a–za\text{–}z: 97–12297\text{–}122
    • Digits 0–90\text{–}9: 48–5748\text{–}57
    • Control & punctuation occupy remaining ranges.
  • Example codes: A=65=1000001<em>2A=65=1000001<em>2, a=97=1100001</em>2a=97=1100001</em>2.
  • Codes run in sequence → knowing one code lets you calculate others (e.g. A+4=EA+4=E).

Unicode

  • Universal character set; typical form UTF-16 uses 1616 bits → 65,53665{,}536 possible codes (many modern encodings extend further).
  • First 128128 codes identical to ASCII for compatibility.
  • Supports scripts beyond Latin: Greek, Mandarin, Japanese, emoji, etc.
  • Advantages over ASCII:
    • Vastly larger range of symbols.
    • One standard for multilingual text & modern symbols (e.g. emoji on phones).

Encoding Tables & Code Calculation

  • Character codes are grouped and sequential; patterns aid quick conversion:
    • Add 3232 to convert uppercase → lowercase (e.g. A(65)+32=97(a)A(65)+32=97(a)).
    • Digits follow 4848, so digit nn has code 48+n48+n.
  • Conversion steps
    1. Denary code → binary (e.g. 71→0100011171\rightarrow01000111).
    2. Binary → denary to identify character.

Key Comparisons & Exam Tips

  • Bits per character: ASCII 7/87/8 vs Unicode 1616 (or 8–328\text{–}32 in UTF encodings).
  • Capacity: ASCII 128/256128/256 symbols; Unicode 65,536+65{,}536+.
  • Use Unicode whenever multiple languages or emoji are required; ASCII suffices for basic English text.