CSE243 Spring 2002
Written assignment 2
Microcode programming

Assigned: Tuesday Feb 19, 2002
Due: Tuesday Feb 26, 2002

Lecture students must hand in this assignment. Lab-only students need not do this assignment.

Prerequisites

Be sure to read chapters 2 and 7 in the Computer Organization book.

For this assignment, use the one-bus architecture shown on p.413 and the three-bus architecture shown on p.424.

The problem

Given the following assembly language program:
; assume PC = 1000, R1 = 100, R2 = 2000, R3 = 300, R5 = 1000
1000:   Move (R3), R4   ; R4 = R3
        Add R3, R4      ; R4 = R3 + R4
        Add (R1)+, R4   ; R4 = (R1) + R4, R1+4
        Jump R2         ; jump to location in R2

2000:   Increment R3    ; add 1 to R3
        Move R3, (R3)   ; mem[R3] = R3
        Jump R5         ; jump to location in R5
list the sequence of microinstructions executed by the program on (A) the one-bus architecture and (B) the two-bus architecture. For each architecture, assume there are at least enough registers to write the program (say, 16).

Do not be concerned with what this assembly program does. It is contrived and meaningless.

Assumptions

Assume the ALU can perform at least the following set of operations:

Assume fetches are done automatically. That means: do not include the microcode to fetch instructions, but instead indicate the places where an instruction fetch-and-decode occurs by writing "<fetch>". For example:
           <fetch>
        1. (microinstructions
        2.   for
        3.    first
        4.     machine
        5.      instruction)
           <fetch>
        6. (next
        7.   machine
        8.    instruction)
           <fetch>
        9. (etc.)

Notation

For the syntax of the microinstructions, it is probably best to use the syntax given in the book (it may differ from the lecture slides). You need not use proper subscripts, as in "PCout" or "R5outB", but at least make it legible, as in "PC-out" or "R5-outB".

Extra credit

I'll give you extra credit if you can animate this graphically (like some of the lecture slides are) using some animation tool (like PowerPoint). Show at least the flow of information between registers and on the internal bus. It is not necessary to include the control unit, but it would be fun to see that in action. If anyone successfully creates this animation, I'll show it during lecture. With your permission, of course.

A final note

If there are any inconsistencies or other problems in this assignment, let me know immediately. jeffm@cse.uconn.edu