- We somehow tricked rocks into thinking. I wanted to understand how, so I built one myself.
This talk starts at the bottom of the computer and works its way up. We’ll start with NAND gates and see how they can be combined into things like multiplexers, flip-flops, registers and ALUs. From there, we’ll build up enough structure to make a CPU, give it an instruction set, and eventually make it possible to write programs for it.
This isn’t just theoretical. I designed a few RISC-style ISAs and implemented them on FPGAs. I built memory-mapped I/O and a simple text-mode GPU, wrote emulators for debugging, and built an assembler for the resulting machines. I even wrote a somewhat cursed RISC-V-to-my-ISA translator so I could get a C compiler running with less than a day’s effort.
Along the way we’ll look at some of the surprisingly complicated things hiding behind simple operations. What does an instruction like ADD actually mean to the hardware? How do registers remember anything? How does a CPU know when to do something? How do you make pixels appear on a display?
The interesting part isn’t just how any one of these pieces works. It’s how we can keep building on top of them without having to understand every layer at the same time. A NAND gate doesn’t know what an instruction is. An ALU doesn’t know what a program is. Yet by giving each layer a useful abstraction, we can build something incredibly complicated out of surprisingly simple pieces.
Then we’ll turn the stack upside down and look at what happens when those abstractions fail us.
We’ll take a deliberately vulnerable C program and follow a simple buffer overflow from the source code, through the compiler, down to machine instructions, registers and stack memory. The same layers that let us forget about the machine are also hiding assumptions that matter when we’re trying to break it.
You don’t need to know FPGA development, Verilog, assembly or CPU design to follow the talk. The goal isn’t to turn everyone into a hardware designer. It’s to show how the machine underneath our software actually gets built, and why understanding a few layers below where you normally work can make computers a lot more interesting.
We took rocks, taught them arithmetic, and then built enough abstractions on top of them to run basically everything we use today.
I think that’s pretty f*cking cool.
