Projects · Tools & libraries
Von Neumann Machine Simulator
A teaching simulator for a simple Von Neumann machine, with a native GUI showing the CPU, registers, memory, data bus and console while programs step through.

; assets/countdown.json, opcode << 8 | operand 0x010A LOAD 10 ; cell 10 holds 5 0x0A00 OUT 0x0C0A DEC 10 0x010A LOAD 10 0x0806 JZ 6 0x0701 JMP 1 0xFF00 HALT ; printed 5 4 3 2 1
A two-person Rust project that makes the fetch–decode–execute cycle visible. Programs are 16-bit words (opcode in the high byte, operand in the low byte), and the GUI shows the accumulator, program counter, instruction register, MAR and MBR changing as each instruction runs.
- Views for the CPU, registers, memory, console, data bus and the instruction set.
- Sixteen instructions: LOAD, STORE and arithmetic, jumps, input and output, plus INC, DEC, NULL and TST (skip the next instruction when a memory cell is zero).
- The instruction set is data, loaded and saved as JSON, so exercises can change it. Programs are saved and loaded as JSON too.
- Run at 1 to 10,000 instructions per second, or step through one instruction at a time.
- A data bus between memory and the CPU, with buttons to move a value across it by hand.
- A debug console (a build feature) for setting memory, the accumulator and the program counter directly.
- Arithmetic saturates instead of overflowing (values stay between 0 and 19,999), and division by zero halts the machine with an error in the console, the way a student would expect.
