VN Architecture Simulator was created to help CS students and just computer inthusiasts visualize the data movements in the registers and memory within a tiny, learning computer architecture.
This is an accumulator-machine (and not a add-subtract-register machine like MIPS for example). The architecture was adopted and inspired from Von Neumann Architecture, who is practically one of the fathers of computing.
Users are welcome to follow the steps to run this simulator, write their own tiny "assembly" code following the ISA described below and run their own probrams on this simulator. Sample programs are provided in description.
There is a lot of abstraction in this simulator. Going one abstraction level lower would invlolve representing the registers and the components in the logic-gate-level.
- 0000 - 00 - FETCH
- 0001 - 01 - LOAD
- 0010 - 02 - ADD
- 0011 - 03 - STORE
- 0100 - 04 - SUB
- 0101 - 05 - INPUT
- 0110 - 06 - OUTPUT
- 0111 - 07 - HALT
- 1000 - 08 - JMP
- 1001 - 09 - SKIPZ
- 1010 - 10 - SKIPG
- 1011 - 11 - FETCL
-
Clone this repository into your computer directory
-
Write a "assembly" VM-program and name it specifically "input.txt". (in the same directory as proj.c) Structure of program lines: %d %d //Coments Example: 1 0 //Load memory address 0
-
Go to the directory of this cloned repository. Type command "make". Then type command "./runme"
-
NOTE: address one in the Memory is reserved for value 1 (one)
-
NOTE: the written "assembly" code should assume that first line of it starts at a line 20. This is because lines 0-19 are reserved for calculations and variables.
-
NOTE: the input.txt code is space friendly, except for the very first line. There should be no whitespace before the first line of code (the first line should exclusively start with the code).
- SHIFT (left) key on keyboard starts the execution of the program (sets the fetch-execute cycle to fetch the operation)
- N key on keyboard sets the speed at normal (1000 ms per standard animation)
- D key on keyboard sets the speed at double (500 ms per standard animation)
- Q key on keyboard sets the speed at quadriple (250 ms per standard animation)
- M key on keyboard sets the speed at maximum (45 ms per standard animation)
- A key on keyboard toggles the animation (greed register values traveling between registers)
- To write input to console, click on the console, enter a number, and press ENTER
- ESC key on keyboard halts the simulation.