Developer
DTU Cyber Systems

Instruction-Set Architecture Simulator

A modular Python simulator for registers, memory, parsing, arithmetic, logic, and branching instructions.

Instruction-set simulator jump exampleA replay of JR R1 from the simulator's test program. At instruction address 10, R1 contains 12; the instruction reads R1 and sets the program counter to 12. JR does not access data memory.PC10 → 12R00R112R29MEMDATA[1] = 9CURRENT INSTRUCTIONJR R1READ R1 → SET PCEXAMPLE REPLAY · DATA MEMORY UNCHANGED
Scroll to inspect the full diagram →
Instruction / state / executionArchitecture abstraction

The problem

Model a small instruction set clearly enough that program execution and state changes can be inspected and tested.

System architecture

  • Modular arithmetic, logic, memory, and branching instruction handling.
  • Explicit register and memory models with program parsing and execution.

Engineering decisions

  • Separate parsing from execution semantics.
  • Expose register and memory state for verification.

Testing and verification

  • Control programs and targeted test cases.

Limitations

  • A learning simulator rather than a cycle-accurate hardware model.

What I would improve next

  • Extend error reporting and trace visualisation.