Von Neumann Machine
A downloadable game for Windows and Linux
The Von Neumann machine, also known as the Von Neumann architecture, is a conceptual model for constructing computing systems. This model was proposed by mathematician and physicist John von Neumann in the mid-20th century and is still used in modern computers.
Main Components of the Von Neumann Machine:
Memory:
- Memory is used for storing data and program instructions.
- In the Von Neumann machine, memory is unified, meaning that both data and instructions are stored in the same memory space.
- The memory address space is usually represented as a one-dimensional array of cells, each with a unique address.
Processor (Central Processing Unit, CPU):
- The processor executes the instructions stored in memory.
- The main components of the processor are:
- Arithmetic Logic Unit (ALU): Performs arithmetic and logical operations.
- Program Counter (PC): Holds the address of the current instruction.
- Accumulator Register (ACC): Stores intermediate results of computations.
Input/Output Devices:
- Input devices allow loading data and programs into the computer’s memory.
- Output devices allow displaying the results of program execution on external devices (e.g., display, printer, etc.).
Bus:
- The bus is a system of channels for transferring data between different components of the Von Neumann machine.
- It is usually divided into address, control, and data buses.
Operating Principle:
Program Loading:
- The program and necessary data are loaded into memory.
Instruction Fetching:
- The program counter (PC) points to the current instruction in memory.
- The instruction is fetched from memory and loaded into the instruction register.
Instruction Decoding:
- The processor decodes the fetched instruction to determine what action needs to be performed.
Instruction Execution:
- The processor executes the decoded instruction using the ALU and other registers.
- The program counter is incremented to point to the next instruction.
Repeating the Cycle:
- The fetch-decode-execute cycle continues until the program completes (execution typically stops upon encountering the HALT instruction).
Example Instructions:
In the code you provided, the basic operations that the Von Neumann machine can perform are described:
- LOAD: Load data into the accumulator.
- STORE: Save data from the accumulator to memory.
- ADD: Add a value from memory to the accumulator.
- SUB: Subtract a value from memory from the accumulator.
- MUL: Multiply a value from memory by the accumulator.
- DIV: Divide the accumulator by a value from memory.
- JMP: Unconditional jump to a specified instruction.
- JZ: Jump to a specified instruction if the accumulator is zero.
- HALT: Stop program execution.
Example Program Execution:
0 LOAD 8 10 1 ADD 8 11 2 STORE 8 12 3 HALT 8 10 1 11 2 12 0
1. LOAD 10: Loads the value from address 10 (1) into the accumulator.
2. ADD 11: Adds the value from address 11 (2) to the accumulator (1 + 2 = 3).
3. STORE 12: Stores the accumulator value (3) in address 12.
4. HALT: Stops program execution.
Thus, the Von Neumann machine sequentially executes instructions, manipulating data in memory and using the accumulator for intermediate computations. This model forms the basis of most modern computers, providing a universal way to execute programs.
Status | Released |
Platforms | Windows, Linux |
Author | uxnownerror |
Genre | Simulation |
Tags | 2D, Experimental, Godot, Pixel Art, programming, Retro, Robots, Singleplayer |
Download
Click download now to get access to the following files:
Leave a comment
Log in with itch.io to leave a comment.