Part 2 · Advanced Architecture · levels 17–29

The second part assembles the parts of the first one into a real computer: a decoder reads the instruction byte, ROM holds the program, RAM holds the data, and the assembler translates text into machine code. The finale — Snake, running on your processor.

Open in the game →Course curriculum

The main ideas of the part

  • The decoder turns an instruction byte into control signals: the high bits say what to do, the low bits say with what.
  • Harvard architecture: program and data live in separate memories — ROM and RAM.
  • Assembly is the language of the machine: one line — one byte of code in the "opcode + operand" format.
  • Flags and conditional jumps give programs branches and loops: JZ is physically a multiplexer in front of the program counter.
  • I/O ports are just memory addresses: the gamepad, the display and the RNG are read and written with ordinary instructions.

What you will have built by the end

By the end of the part you will have a complete 8-bit Harvard processor with an assembler, flags and I/O ports — and programs with loops running on it, up to the Snake of level 29.

Levels of the part

  1. 17. Anatomy of a Decoder — build an opcode decoder from AND chains and verify recognition of a given code Open in the game →
  2. 18. FINALE: The Ershov Computer — assemble a Harvard-architecture processor and clock through the instruction cycle (ROM → decoder → ALU → accumulator) Open in the game →
  3. 19. Step Forward (PC+2) — retune the program counter to a +2 step and demonstrate on a program why the variable step is needed (word format) Open in the game →
  4. 20. Dual Read — wire two ROM banks to a single PC and demonstrate dual fetch of opcode and operand Open in the game →
  5. 21. Pointers — use the IX register for indirect addressing in a program and explain the pointer's role Open in the game →
  6. 22. Bus Conflict — diagnose a bus conflict and restore device separation with an address decoder Open in the game →
  7. 23. Gamepad — write a program that reads an input port and explain the difference between LDA N and ADD N Open in the game →
  8. 24. Manual Pixel — explain the memory-mapped display port protocol (X, Y, pixel) and light up a pixel Open in the game →
  9. 25. Negative Check — explain status flags (two's complement) and write a program with a conditional JN jump Open in the game →
  10. 26. Dice Roll — wire the LFSR as a third source onto the bus, generate a sequence of "random" numbers, and explain the pseudorandomness Open in the game →
  11. 27. Hello, Ports! — read and modify a ready-made assembly program to meet a new condition Open in the game →
  12. 28. Moving Dot — write a complete program with RAM variables, input, branching, and a loop Open in the game →
  13. 29. FINALE: Snake — design the game "Snake" in assembly: state, input, rendering Open in the game →

Each level number leads to its library guide; "Open in the game" goes straight to the level in the simulator.

Up next: Part 3 · Verilog →