Level 18: FINALE: The Ershov Computer
Task
Build an 8-bit computer! Harvard architecture: ROM (instructions) + RAM (data) + PC + Register + ALU + Decoder + Clock.
The final level — build a complete 8-bit computer with Harvard architecture!
Solution
Main processor cycle: Clock → PC (program counter) → ROM (instruction memory) → Decoder → Register + ALU → RAM (data memory).
Build the main blocks:
1. ProgramCounter — from Register8 + ALU8 + BusConstant(1), same as level 16. Feed PC output to ROM address input.
2. ROM — instruction memory (256 bytes). Addr input receives address from PC, Data output gives the instruction byte.
3. Splitter — break the ROM output into two parts: - Bits 4-7 → Opcode (command code). - Bits 0-3 → Operand (operand, e.g. address or value).
4. Decoder — recognizes the Opcode and produces 5 control signals: - ALUOp0, ALUOp1 — ALU operation select (ADD=00, AND=01, OR=10, ...). - MemWr — RAM write enable. - JumpUncond — unconditional jump (JMP). - JumpCond — conditional jump (JZ — if ALU result = 0). JMP and JZ signals go through OR to the PC Load input.
5. Register8 — holds the intermediate result. Data comes from ALU output or RAM.
6. ALU — performs operations on the operand and register.
7. RAM — data memory (256 bytes). Reads/writes data at the address from the instruction operand.
After assembly, open the "Assembler" tab, write a program (ADD, STA, HLT), press "Compile", and run the clock ticks.