Sorry, but this app needs Javascript to run :/

How this App works

Hello. In order for you to understand what this App does, I want to show you some basics of this app.

Control Buttons

At the top of the application you can see a row of control buttons:

Blocks

This computer is made up by multiple blocks like any other neumann-maschiene. Every block has it's own unique set of functions. A normal computer is much more complex than this, but the principle is the same.

RAM

The current program is stored in the RAM. Every entry is separated as mentioned in entry.

Control Unit

As the name suggests, the control unit manages everything that is done. To know what needs to be done it has a list of µCodes that gets executed when a instruction is requested.

These µCodes can be found in the table. Every instruction consists of up to 10 µCodes.
When a entry is executed, the first three digits (the instruction) gets multiplied by 10. This now is written into the µCounter and the µCodes for it get's executed.

Example:
When the entry 001 00000 gets executed, the µCounter would be set to 0010. Now every µCode starting at location 0010 in the µCodes gets executed.

ALU

The Arithmetic Logic Unit is pretty simple in this case.

The ALU can only increment or decrement the accumulator. But it can read numbers from databus.

Databus

Via the databus values and entries can be transported between RAM, Control Unit and ALU.

Addressbus

With the addressbus the Control Unit can control which value is selected in RAM. On a normal computer there are a lot more things attached to this bus.

Entry

Each entry consists of a instruction and an argument. That's why the entrys in RAM and in µCodes are displayed separately.

0 0 2   0 0 5 0 4
Instr   Argument

Here, the first 3 digits are the opCode of the instruction. When you try to load this part into the µCode Counter of the Control Unit, it will be automatically multiplied by 10.
In this example µCodes starting at the Address 20 will be executed.

The last 5 digits are a numerical value that can be used as an argument for the command.

µCodes

Every instruction consists of a list of µCodes. Here is an explanation for all of them:

µCode Description
ProgCounter -> AddrBus Load the value from program counter to addressbus
InstrReg -> ProgCounter Load the argument from instruction register to program counter
ProgCounter ++ Increment program counter by 1
Acc == 0 => InstReg -> ProgCounter If the accumulator is 0 then write the argument from instruction register to program counter
Ram -> DataBus Load selected value from RAM to databus
DataBus -> Ram Write value from databus to selected value in RAM
DataBus -> InstReg Write entry from databus to instruction register
DataBus -> Acc Write value from databus to accumulator
Acc -> DataBus Load value from accumulator to databus
Acc ++ Increment accumulator by 1
Acc -- Decrement accumulator by 1
Acc << DataBus Shift the Accumulator left by the value in databus
Acc >> DataBus Shift the Accumulator right by the value in databus
Acc + DataBus Add the value of the databus to the accumulator
Acc - DataBus Subtract the value of the databus from the accumulator
Acc * DataBus Multiply the value of the databus with the accumulator
Acc / DataBus Divide the accumulator by the value of the databus
Acc AND DataBus Do a bitwise AND to accumulator with the value of the databus
Acc OR DataBus Do a bitwise OR to accumulator with the value of the databus
Acc XOR DataBus Do a bitwise XOR to accumulator with the value of the databus
Acc NOT DataBus Do a bitwise NOT to accumulator with the value of the databus
InstReg -> µCounter Take the instruction from instruction register, add a 0 at the tail and write it to µCounter
InstReg -> AddrBus Write the argument from instruction register to addressbus
InstReg -> DataBus Write the argument from instruction register to databus
µCounter = 0 Set µCounter to 0
Signal End of Program Show an alert that the end of program is reached.

Source

This is a hobby project so please don't take my code as a "best-practice" implementation.

See Source Code

This project is my take on Johnny-Simulator.