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?
- In chapter 6, every letter had a number: 'A' is 65. Today let's see where these numbers come from.
- 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.
- English got its numbers early. ASCII gave 128 numbers to letters, digits and symbols, and Unicode kept all of them.
- 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'.
- So it's a rule, not a memory test. A capital letter's number is 64 plus its place in the alphabet.
- 'H' is the 8th letter, so 64 + 8 = 72. Small letters start at 96 instead: 'h' is 96 + 8 = 104.
- Some characters are built from parts. 'é' can be 'e' plus an accent piece. 👍🏽 is 👍 plus a skin-tone piece.
- 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
- Unicode: a table that gives every character in the world a number. 'A' 65, '中' 20013.
- Capital = 64 + place in the alphabet; small letters are 32 later. Some characters are built from parts: é = e + ´.
- To store a number it is split into bytes (0–255): 'A' takes 1 byte, 'é' 2, '😀' 4.