4 lessons
The ALU: the calculator hiding inside every CPU
The Arithmetic Logic Unit is the one circuit that actually computes things. Here's how it's built, and how a single opcode picks between add, subtract, AND, OR and more.
The datapath: wiring the register file, ALU and memory together
The ALU alone can't do anything without wires connecting it to registers and memory. Here's how those wires form the datapath, one instruction type at a time.
The control unit: the conductor that sets every switch
Every multiplexer and every ALU operation needs to be set correctly, every single cycle. The control unit is the circuit that does exactly that, decoded straight from the opcode.
How does a CPU actually multiply and divide?
The ALU we built only adds, subtracts and does logic. Multiplication and division need their own algorithms, built entirely out of that same adder - here's exactly how, with worked examples.