Skip to content

Build a CPU (RISC-V)

Build a RISC-V RV32I simulator: register file, instruction decoding (R/I/S/B/U/J formats), ALU + load/store + branch + jump execution, calling convention, syscalls, and the fetch-decode-execute loop. Same architecture as Spike, QEMU's RISC-V mode.

advanced10 lessons4 chapters10 graded exercisesPython

No sign-up needed for lesson 1 · certificate on completion · sign up to save progress

What you’ll have built

Chapter by chapter. Every step is a graded exercise.

  • Architecture Basics
  • Instruction Decoding
  • Execution
  • Production
Starts in Python — solve in the language you choose in the editor, same tests either way.

Curriculum

4 chapters, 10 lessons. Each lesson is a short read, one graded exercise, and a quiz.

  1. 1What a CPU DoesRead · exercise · quiz
  2. 2RISC-V Instruction FormatsRead · exercise · quiz
  3. 3Memory LayoutRead · exercise · quiz
Loading reference solution…