AI Anatomy Class · Part 3 · Turning text into numbers

28. Letters inside a computer

Q. Every letter has a number inside the computer. But who picked those numbers, and does anyone have to memorize them?

  1. In chapter 6, every letter had a number: 'A' is 65. Today let's see where these numbers come from.
  2. Unicode is one big table that numbers the world's characters. 'A' is 65, '中' is 20013, the smiley is 128512. Over 150,000 in all.
  3. English got its numbers early. ASCII gave 128 numbers to letters, digits and symbols, and Unicode kept all of them.
  4. The numbers follow the alphabet: one more is the next letter. A is 65, B is 66, and so on up to Z, 90. And 32 more gives 'a'.
  5. So it's a rule, not a memory test. A capital letter's number is 64 plus its place in the alphabet.
  6. 'H' is the 8th letter, so 64 + 8 = 72. Small letters start at 96 instead: 'h' is 96 + 8 = 104.
  7. Some characters are built from parts. 'é' can be 'e' plus an accent piece. 👍🏽 is 👍 plus a skin-tone piece.
  8. A byte holds only 0 to 255, so big numbers are split up. 'A' takes 1 byte, 'é' 2, '😀' 4. Bytes are what tokens are made of.

Chapter summary