Use the menu for detailed help. QUICK HELP:

The Relatively Simple Computer System simulator is an instructional aid for teaching computer system design.  It allows the user to simulate the flow of data within a computer consisting of the Relatively Simple CPU, memory, and a memory-mapped I/O port, as it fetches, decodes, and executes instructions.  It uses animation to illustrate the flow of data between components.

The Relatively Simple CPU can access 64K bytes of memory, each byte being 8 bits wide. The CPU does this by outputting a 16-bit address on its output pins A[15..0] and reading in the 8-bit value from memory on its inputs D[7..0].  This CPU has two programmer-accessible registers: an 8-bit accumulator labeled AC, and an 8-bit general purpose register R.  It also has a 1-bit zero flag, Z. It has sixteen instructions in its instruction set, as shown below.

Instruction

Instruction Code

Operation

NOP

0000 0000

No operation

LDAC

0000 0001

AC = M[ ]

STAC

0000 0010

M[ ] = AC

MVAC

0000 0011

R = AC

MOVR

0000 0100

AC = R

JUMP

0000 0101

Goto

JMPZ

0000 0110

IF (Z=1) THEN Goto

JPNZ

0000 0111

IF (Z=0) THEN Goto

ADD

0000 1000

AC = AC + R, If (AC + R = 0) Then Z = 1 Else Z = 0

SUB

0000 1001

AC = AC - R, If (AC - R = 0) Then Z = 1 Else Z = 0

INAC

0000 1010

AC = AC + 1, If (AC + 1 = 0) Then Z = 1 Else Z = 0

CLAC

0000 1011

AC = 0, Z = 1

AND

0000 1100

AC = AC ^ R, If (AC ^ R = 0) Then Z = 1 Else Z = 0

OR

0000 1101

AC = AC R, If (AC R = 0) Then Z = 1 Else Z = 0

XOR

0000 1110

AC = AC R, If (AC R = 0) Then Z = 1 Else Z = 0

NOT

0000 1111

AC = AC¢, If (AC¢ = 0) Then Z = 1 Else Z = 0

Chapter 4 of Computer Systems Organization and Architecture shows the details of the design of this computer system.

Click here for a video tour of the simulator (requires the Macromedia Shockwave Player, available at www.macromedia.com).

Screenshots:

Main Interface:

System Display:


Program Example:

(1)Enter the following program.

   org 0	;assembly start address
   db 2         ;defines a byte of decimal value 2
   db 4         ;defines a byte of decimal value 4
   org 10       ;assembly start address
   ldac 0       ;load AC with data at location 0
   mvac         ;move AC data to register R
   ldac 1       ;load AC with data at location 1
   add	        ;store the sum of AC, R in AC
   stac 2       ;store AC at location 2
   stac ffffh   ;send AC to I/O Port
   end		;stop

   Also, enter 0 at the memory location text field
   for the assembly start address of the program.

 (2)Assemble the program.
    
   Note that the results dialog box should appear
   with assembly success. Otherwise, make sure you've
   entered the program properly.

 (3)View the System for Simulation

   Start a new simulation by using the run menu or
   type CTRL-N.  The start address dialog box should
   now appear, enter the starting address of where 
   the program is stored. In this case, address 10.
   Note that this program stores data starting at 0
   and stores the assembled program at 10.

   You may also set different parameters for the simulation.
   In the View menu you may uncheck Animation for a quick
   run of the program without animation, choose to only
   view the ISA registers, or set whether to trace by 
   cycle or instruction.

   You will now see the RSCPU System simulation for this
   program.  Use your notes to follow the processes, you 
   may pause/stop the system in the run menu or by typing
   CTRL-S. You may continue as you wish.

(4)View Memory

  After some time, the simulation should end. Hopefully,
  you've noticed the proper system operations. To verify
  the program's objective (adding 2 & 4 and storing it in 
  memory), click on View Memory and note how the data was 
  stored in addresses 0, 1, with the result at 2.

(5)Trace Results

  Once the simulation has successfully completed, click
  on the Trace Results button to view the trace of the 
  program. Notice that a snapshot of the RSCPU's registers
  are noted for every instruction or cycle of the program,
  depending on which parameter was chosen in the View menu
  of the computer system dialog window.