How computers work
A computer stores everything, from photos to programs, as patterns of 0s and 1s, and works on them with tiny switches. Six units go from the bottom up: binary numbers, bytes and text, logic gates, adding with gates, the CPU's fetch, decode and execute cycle, and memory. You can flip bits, wire gates, watch carries ripple through an adder and step a small computer through its program one phase at a time.
What you will learn
- Read a row of bits as a number
- Find the code of a letter in ASCII and its bytes in UTF-8
- Add binary numbers with carries
- Follow fetch, decode and execute step by step
- Tell memory (RAM) from storage
Units
- 1Bits and binary numbers19 pages21 minExplain5Explore2Problem10Practice1
- 2Bytes, hexadecimal and text22 pages25 minExplain7Explore3Problem10Practice1
- 3Logic gates20 pages22 minExplain6Explore2Problem10Practice1
- 4How gates add numbers20 pages23 minExplain6Explore2Problem10Practice1
- 5What a CPU does19 pages21 minExplain6Explore1Problem10Practice1
- 6Memory and storage19 pages23 minExplain4Explore3Problem10Practice1
About this course
In 1854 the mathematician George Boole published An Investigation of the Laws of Thought, an algebra in which statements are true or false and are joined with and, or and not. For decades only logicians cared. In 1938 Claude Shannon, a student at MIT, showed that circuits of relays and switches obey exactly that algebra: switches in series act like AND and switches in parallel like OR. That link is the idea the whole course follows. Intel's first microprocessor, the 4004 of 1971, held 2,300 transistors wired into gates, and gates are all a processor is made of.
RAM forgets everything when the power goes off, and the final lab shows data cells in green so you can watch the running result grow as 4, 8, 12.
Before you start
The course starts from switches and builds upward, so nothing about computers is assumed. Being comfortable adding numbers in columns with carries helps, because one unit asks you to add 0101 and 0011 on paper in binary, the same way you would in decimal.
Course map
Computer basics and typing · Courses: 4Sources for this course (10)
- (checked 2026-10-17)
- Standards: NIST, "Prefixes for binary multiples" (physics.nist.gov/cuu/Units/binary.html: IEC approved kibi, mebi, gibi in December 1998; 1 B = 8 bit; 1 MiB = 1 048 576 B; 1 MB = 1 000 000 B; 1 GiB = 1 073 741 824 B; historical note: memory makers usually mean 2²⁰ bytes by megabyte, storage makers 1 000 000, and the "1.44 MB" diskette uses a megabyte of 1 024 000 bytes)
- IETF RFC 20 "ASCII format for Network Interchange" (1969, 7-bit codes, A = 65, a = 97, 0 = 48)
- IETF RFC 3629 "UTF-8, a transformation format of ISO 10646" (2003: 1 to 4 octets per character, ASCII unchanged, code points up to U+10FFFF, U+0800 to U+FFFF take three octets, "the first octet of a multi-octet sequence indicates the number of octets", example U+D55C U+AD6D U+C5B4 = ED 95 9C EA B5 AD EC 96 B4)
- Official documentation: MDN Web Docs, "<color>" (hexadecimal colour notation #RRGGBB)
- Intel, "Intel Chips" timeline poster (2012: Intel 4004 of 1971 with 2,300 transistors; 2nd generation Core 2010 with 1.16 billion)
- Teaching model: the toy computer in the network-lab scene (16 cells of 8 bits, 4-bit opcode and 4-bit address) is made for this course, not a real chip. History blocks only (the logic-gates story and the von Neumann paragraph of the-cpu): George Boole, An Investigation of the Laws of Thought (1854, Project Gutenberg 15114)
- Claude E. Shannon, "A Symbolic Analysis of Relay and Switching Circuits", Transactions of the AIEE vol. 57 (1938)
- abstract of his MIT master's thesis. Computer History Museum, The Silicon Engine, "1947: Invention of the Point-Contact Transistor" (Bardeen and Brattain, December 1947, germanium)
- John von Neumann, "First Draft of a Report on the EDVAC" (30 June 1945, Moore School, reprinted in IEEE Annals of the History of Computing 15:4, 1993).
Checked: 2026-10-17