Caffeinated Coder
Book an appointment
Lesson 31 · Build a processor

A complete CPU: fetch, decode, execute

Put the parts together and run a real program. TINY-8, the course's teaching CPU, fetches each instruction from memory, decodes it in the control unit, executes it in the ALU, writes the result back and moves its program counter on, all in one clock cycle. Watch it add 2 + 3, show 5 on its output port, count r2 down to zero with the Z flag and JNZ, and halt after 13 cycles. Then see why the clock has to wait for the slowest instruction.

12 min12 steps5 questionsBeginner
Fig 31 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.