Transcript
This season, we built a computer, starting from a single switch. Today, let's watch all of it work together, by following one key press all the way through. Press A. Here's what happens in the next small fraction of a second.
The keyboard's chip raises an interrupt. The processor saves where it was, and jumps to the handler. The handler is just numbers: instructions stored in memory, each one an opcode and some fields. To fetch them, the CPU turns virtual addresses into real ones through the TLB, and finds most instructions already waiting in the cache. In the pipeline, instructions are fetched, decoded and executed, out of order when they can be, with jumps guessed ahead, while the control unit flips the right switches on every tick. The key arrives as the number sixty-five, the letter A, and lands in a register made of flip-flops. The ALU compares and adds, with negative numbers in two's complement, using adders built from gates, and gates built from switches. Then the letter is drawn: thousands of pixels, each three numbers for red, green and blue, worked out with multiplications and floating-point math. And when you save your work, it's written to flash cells on an SSD, where it stays even with the power off. All of that happens in a small fraction of a second.
So how do we measure how fast all this is? The time a program takes is three numbers multiplied together. How many instructions it runs, how many ticks each instruction takes on average, and how long one tick lasts. A billion instructions, half a tick each, at four billion ticks a second: one eighth of a second. And that gives three ways to go faster: fewer instructions, fewer ticks per instruction, or shorter ticks. Every trick this season was one of those.
Billions of steps every second, and every single one comes down to switches, turning on and off. That's the end of season one. Thanks for building a computer with us.
That's the end of season one. Thanks for building a computer with us.