Hades logoHades applet banner
PRIMA processor (primitive machine)

applet icon

The image above shows a thumbnail of the interactive Java applet embedded into this page. Unfortunately, your browser is not Java-aware or Java is disabled in the browser preferences. To start the applet, please enable Java and reload this page. (You might have to restart the browser.)

Circuit Description

This applets shows a RT-level circuit realization of the PRIMA processor (primitive machine). This simple 8-bit accumulator machine is used as a first example of a von Neumann machine in our introductory lectures on computer science.

The 8-bit accumulator machine has the following main components:

  • random-access main-memory of 256 words (256x8)
  • 8-bit accumulator, plus 1-bit carry/overflow register
  • 8-bit ALU with 16 different operations

  • 8-bit instruction register BR ('Befehlsregister' in German)
  • 8-bit address register AR
  • 8-bit program counter PC

  • hard-wired control logic STW ('Steuerwerk' in German)
The right side of the schematics shows the processor datapath with ALU, accumulator, and main memory. The next column of components to the left holds the program counter with assorted logic. During normal program execution, the program counter is incremented via the incrementer and the upper 2:1 multiplexer. For jump and branch instructions, this multiplexer is enabled, and the program counter is loaded with the current contents from the address register AR.

The lower multiplexer decides whether the RAM address is taken from the program counter (during the fetch_instruction and fetch_address cycles), or from the address register (for load and store instructions).

The BR register holds the current instruction; its output value is the main input to the control unit (on the lower left) that generates the several register-enable and multiplexer-control signals. In order to avoid cluttering the schematics with dozens of control signals, all control signals are drawn as a single bus that runs on the top of the schematics and connects to the several registers and muxes.

A few links to further documentation:

NOTE: To keep the schematics as readable as possible, the version of PRIMA demonstrated in this applet is slightly different from the original version shown in the lecture slides. First, the applet uses an 8-bit ALU and accumulator register instead of the full 9-bit variants required by the original specification. Also, the carry-out from the ALU and the ALU output are not used in the control-unit. This saves a lot of bit-twiddling and a few global buses that would run across the whole schematics.

The demo program used in this applet consists of just four instructions:

label  addr  data  mnemonic
             (hex)
       0     0f    LD1
       1     00
loop:  2     0a    INCR
       3     00
       4     48    ST 20
       5     20
       6     80    BR 2
       7     02
The program first loads the value 1 into the accumulator. It then increments the accumulator, store the result into memory address 20, and jumps back to the increment instruction. This is an endless loop, so that the program will continue to increment the accumulator value and save it to the memory over and over again.

Print version | Run this demo in the Hades editor (via Java WebStart)
Usage | FAQ | About | License | Feedback | Tutorial (PDF) | Referenzkarte (PDF, in German)
Impressum http://tams.informatik.uni-hamburg.de/applets/hades/webdemos/50-rtlib/90-prima/prima.html