A modern computer is far too complicated to understand all at once. A phone runs apps written in languages like Swift or Kotlin, which become machine instructions, which a processor carries out with billions of transistors, which work because of how electrons behave in silicon. Nobody thinks about all of that at the same time. Instead, we cut the machine into levels of abstraction: each level offers a set of objects and operations, and hides how the level below implements them.
This whole site is organized that way. This chapter explains the idea, compares the site's levels with the classic six-level model, and gives a short history of how the levels appeared.
Languages, levels and virtual machines
It all starts from a simple problem. The hardware can only execute its own machine language, call it L0, which is convenient for circuits and miserable for people. So we invent a nicer language, L1. There are two ways to run an L1 program on an L0 machine:
- Translation: convert the whole L1 program into an equivalent L0 program first, then run that. A compiler or an assembler does this.
- Interpretation: write an L0 program, the interpreter, that reads the L1 program as data and carries out each instruction in turn.
Either way, it is simpler to pretend that there is a machine whose native language is L1: a virtual machine, M1. Programmers write for M1 and don't care whether it's real circuits, an interpreter, or a translator underneath. Then you can build L2 on top of L1, L3 on top of L2, and so on. Each language defines a machine, and each machine defines a language.
The chapter on compiled and interpreted languages shows the two techniques, and the JIT compilers that mix them, on real code.
Two more words are worth keeping. A level's architecture is what its user can see: its data types, operations and features. The implementation is how it's built, which the user shouldn't need to know. And the operating system was originally a level too: its system calls are extra instructions that the hardware doesn't have, carried out by the kernel, as the system calls chapter explains.
Six classic levels, ten on this site
A classic way to describe a computer uses six levels, numbered from the bottom. This site uses ten, numbered by depth from the user. The table lines them up:
| This site (depth) | Classic level | How the level above is supported |
|---|---|---|
| 0. Applications & the user | - | - |
| 1. Problems & algorithms | - | - |
| 2. Programming languages | 5. Problem-oriented language | translated by a compiler (or interpreted) |
| 3. Assembly language | 4. Assembly language | translated by an assembler |
| 4. Operating system | 3. Operating system machine | partly interpreted by the OS |
| 5. Instruction set architecture | 2. ISA | interpreted by microcode, or executed directly |
| 6. Microarchitecture | 1. Microarchitecture | carried out by hardware |
| 7. Digital logic | 0. Digital logic | - |
| 8. Devices & chips | below the six: the device level | - |
| 9. Physics of computing | below the six: solid-state physics | - |
The middle six are the classic six, in the same order. The differences are at the ends, and in the numbering:
- Numbering by depth. The classic model counts up from the hardware, because that's how the machine is built. This site counts down from the user, because that's how a reader arrives: you start from something you use every day and zoom in.
- Two levels on top. Applications and algorithms aren't virtual machines with a language of their own, in the strict sense. They are levels of description: what the user sees and does, and the step-by-step method a program follows before it's written in any language. This site adds them because the question "what really happens when I click?" starts there.
- Two levels at the bottom. The classic model stops at gates and leaves transistors to electrical engineering and physics. This site goes further down, to how a transistor switches and how a bit is stored physically, because that's where the limits on speed and power come from.
The site also has this Foundations track, which isn't a level: binary, two's complement, floating point, character codes, byte order, error correction and units are used at every level, so they're explained once here.
Hardware and software are equivalent
A central idea of computer organization is that hardware and software are logically equivalent. Any operation done by software could be built into hardware, and any hardware instruction can be simulated by software. Where the line falls is a question of cost, speed and how often the thing needs to change.
The line has moved many times. The first computers of the 1940s had just two levels: the machine language and the circuits that ran it. In 1951, Maurice Wilkes proposed adding a level in between: a small, fixed interpreter inside the CPU, the microprogram, that would carry out each machine instruction as a sequence of simpler steps, and so simplify the hardware. By the 1970s nearly every big machine was microprogrammed, and instruction sets grew as designers added instructions just by extending the microcode. Then in the 1980s, RISC designs removed the microprogram and executed simple instructions directly in hardware. Today's x86 chips do both: common instructions are decoded straight into internal operations, and rare complex ones fall back to microcode. The microcode chapter follows that story in detail.
The site's simulator is an example of the equivalence too: it is an x86-64 processor implemented in software, running in your browser.
A short history
Computer history is usually divided into generations by the switching technology. The dates below are the ones historians agree on; a few often-repeated mistakes are corrected after the table.
| Era | Year | Milestone |
|---|---|---|
| Mechanical | 1642 | Blaise Pascal's adding machine |
| 1670s | Gottfried Leibniz's machine that also multiplies and divides | |
| 1830s | Charles Babbage designs the Analytical Engine: store, mill, punched-card program, conditional branches. Never completed. | |
| 1843 | Ada Lovelace publishes the first program written for it | |
| Relays | 1941 | Konrad Zuse's Z3, a working programmable relay computer |
| 1944 | Howard Aiken's Harvard Mark I | |
| Vacuum tubes | 1943–44 | Colossus, the first electronic digital computer, built in secret in Britain |
| 1945 | ENIAC completed: 18,000 tubes, programmed by rewiring | |
| 1945 | John von Neumann's report on the EDVAC describes the stored-program design | |
| 1948 | The Manchester "Baby" runs the first stored program | |
| 1949 | EDSAC, the first stored-program computer in regular service | |
| Transistors | 1947 | The transistor is invented at Bell Labs |
| 1956 | TX-0 at MIT, an early transistorized computer | |
| 1959–60 | DEC PDP-1, the first minicomputer | |
| 1964 | CDC 6600, the first supercomputer, with parallel functional units | |
| Integrated circuits | 1958–59 | Jack Kilby and Robert Noyce invent the integrated circuit, independently |
| 1964 | IBM System/360: the first family of compatible machines at different prices | |
| 1965 | DEC PDP-8, the first mass-market minicomputer | |
| VLSI | 1971 | Intel 4004, the first single-chip microprocessor, 2,300 transistors |
| 1976 | Cray-1 vector supercomputer | |
| 1981 | IBM PC, built around the Intel 8088 | |
| 1985 | Intel 80386 (32-bit x86); Acorn's first ARM processor | |
| 1995 | Pentium Pro: out-of-order execution reaches the PC | |
| 2001 | IBM POWER4, the first dual-core processor chip | |
| 2003 | AMD64 extends x86 to 64 bits | |
| 2007 | iPhone: the smartphone era begins | |
| 2020 | Apple M1: Macs move from x86 to ARM | |
| 2022 | Frontier, the first supercomputer to pass 10¹⁸ operations per second on the standard benchmark |
A few details of this history are often told wrong:
- Colossus was not built to break Enigma messages, and Alan Turing did not design it. It attacked a different cipher, the Lorenz teleprinter cipher used by the German high command, and was designed by the Post Office engineer Tommy Flowers. Enigma was attacked with electromechanical machines called bombes, which Turing did help design.
- The Z1 (1936–38) is sometimes listed as the first relay machine. It was purely mechanical; Zuse's relay machine was the Z3 of 1941.
- EDSAC (1949) is sometimes called the first stored-program computer. The Manchester Baby ran a stored program a year earlier, in June 1948; EDSAC was the first one used for regular work.
- The transistor was announced in 1948, but it was first demonstrated in December 1947. The two inventions of the integrated circuit are a year apart: Kilby's was 1958, Noyce's planar version 1959.
- The Cray-1 is sometimes dated 1974. It was first delivered in 1976.
Moore's law, and what happened next
In 1965, Gordon Moore observed that the number of components on a chip was doubling every year. In 1975 he revised it to every two years. The popular version, "every 18 months", is neither of Moore's figures.
The two-year version held remarkably well. The Intel 4004 of 1971 had 2,300 transistors; Apple's M2 Ultra, the chip in the computer this chapter was written on, has 134 billion, launched in 2023. That's a factor of about 58 million, or 25.8 doublings in 52 years: one doubling every 2.0 years.
What didn't keep growing is the clock. Until the early 2000s, smaller transistors could also switch faster at lower voltage, so each generation got a faster clock for the same power. Around 2005 that stopped: voltage couldn't drop further without transistors leaking, and chips hit the limit of the heat they could shed. Clock rates have stayed around 3 to 6 GHz since. The extra transistors went into more cores, bigger caches, and specialized units: GPUs, neural-network accelerators, video encoders. The turn to multicore was already clear by the early 2010s; the specialization is the newer part.
The computer zoo, then and now
A classic "computer zoo" sorts computers by price, from a $0.50 chip in a greeting card to a $5 million mainframe. The categories still make sense, but the examples have aged:
- Microcontrollers are still sold by the billion for cents apiece, and the 8-bit AVR is still around, though 32-bit ARM Cortex-M chips now do much of that work.
- Game consoles and phones. The examples of the early 2010s, the PlayStation 3, the Xbox 360 and the first tablets, are long obsolete. Sony's and Microsoft's current consoles use x86 chips from AMD, and phones now outnumber every other kind of general-purpose computer.
- Personal computers. x86 used to be found in nearly all PCs, Macs included. Since 2020, Macs use Apple's own ARM chips.
- Supercomputers. In the early 2010s they were sometimes written off as a dying breed, replaced by clusters of commodity servers. The largest machines are indeed built from many server nodes, but they are far from dying: the leading systems now pass 10¹⁸ operations per second, mostly using GPUs.
- RFID. RFID chips in euro banknotes were once expected; that never happened.
This site uses three example architectures: x86-64 for its simulator, ARM64 for its measurements, and RISC-V, an open ISA anyone can implement. The x86, ARM and RISC-V chapter tells their histories.
Takeaways
- A computer is a stack of virtual machines. Each level offers a language; programs in it are either translated to the level below or interpreted by a program running on it.
- The classic six levels (digital logic, microarchitecture, ISA, operating system machine, assembly, problem-oriented languages) are the middle six of this site's ten. This site adds applications and algorithms above, devices and physics below, and numbers levels by depth from the user.
- Hardware and software are equivalent: where the boundary falls is an engineering choice, and it keeps moving (microcode in the 1950s–70s, RISC in the 1980s, hybrid decoders today).
- The generations follow the switch: gears, relays, vacuum tubes, transistors, integrated circuits, VLSI.
- Moore's law held at about one doubling every two years from 2,300 transistors in 1971 to 134 billion in 2023; clock rates stopped rising around 2005, so the transistors went into cores and specialized units.
- Colossus attacked the Lorenz cipher, not Enigma; the Manchester Baby ran the first stored program in 1948; the transistor dates from 1947.