How computers count
A computer has only switches that are on or off. Eight of them, fixed at the bottom of the screen, make one byte. Flip them and read the same pattern as a number, a letter, a counter that wraps round, and a colour.
Key takeaways
- A computer stores everything as switches that are on or off. One switch is a bit and eight switches are a byte.
- In binary each switch is worth double the one to its right (1, 2, 4, 8, 16, 32, 64, 128). Eight switches make 256 patterns, the numbers from 0 to 255.
- A letter is a number from an agreed table. In ASCII a capital A is 65 and a small a is 97, which is one switch apart.
- Adding 1 turns switches over and carries to the left. A byte wraps from 255 round to 0.
- A colour on a screen is three bytes, one each for red, green and blue: 16,777,216 colours.
Sources
Most of these sites could not be opened while this page was written, so the facts were checked through search results that quote them. The place values 128 to 1, the 256 patterns of a byte, A as 65 and a as 97 (one switch apart), the 16,777,216 colours of 24-bit colour, and the dates for Leibniz (1703) and for the word bit (a 1947 memo by Tukey, printed by Shannon in 1948) each appeared in at least two places. The sources disagree about exactly when Tukey first used the word, so only Shannon’s 1948 print is given. The panels are simple models made for this page.
- Cognito: binary numbers (GCSE computer science)Place values and converting binary to decimal.
- Oxford Revise: computer science answers, chapter 1 (PDF)Bits, bytes and binary numbers.
- Wikipedia: bitThe bit, and Tukey and Shannon.
- Word Origins: bit and byteWhere the words bit and byte come from.
- History of Information: Leibniz and binary arithmeticLeibniz on counting with 0 and 1, 1703.
- Computing History: Leibniz invents the binary systemThe same story, from a museum.
- Dave Allen: 7-bit ASCII (course slides)Numbers for characters in ASCII.
- Unicodefyi: ASCIIASCII has 128 code points. A is 65 and a is 97.
- Harvard CSCI E-12: colour depth24-bit colour: 256 levels for each of red, green and blue.