Laboratory Exercises For Computer Science 211

Microprogramming

Microprogramming

Goals: This laboratory exercise provides experience with microprogramming, following Tanenbaum's Mic-1 microprocessor (section 4.2).

The lab asks you to interpret some microprograms and then write write your own simple microprograms.

Resources: Throughout this lab, you will need to consult Figures 4-8, 4-9, and 4-10 (section 4.2) in Tanenbaum's text.

Collaboration: As with the work for the previous labs, the following steps are to be done on paper collaboratively. Everyone should work in a group of two (preferred) or three students; within a group, each person should take responsibility for leading discussion for some of the problems.

Steps for this Lab: In the following, assume register A contains the address of the variable X, register B contains the address of variable Y, and register C contains the address of variable Z.

  1. Consider Microprogram 1 which implements the Pascal statement Z := X - Y .
    This code may be printed with the command:
    dvips ~walker/public_html/courses/211/labs/micro-code-1.dvi
    
    1. Write a sentence or two to explain why each statement does what is claimed by the comment field.

    2. Explain why the values in the the fields containing dashes (-) do not matter.

    3. Why do you think the value of X is stored in a register (Register D), but the value of Y is never transferred to one of the sixteen internal register?

    4. Why do you think the code uses Register D for X rather than Register A, B, or C?

  2. Consider Microprogram 2 This code may be printed with the command:
    dvips ~walker/public_html/courses/211/labs/micro-code-2.dvi
    
    Annotate each line of the code, following the approach used for the comments from step 1.

    Make a summary statement indicating the overall effect of this code (e.g., the code in step 1 computed Z := X - Y ).

  3. Consider Microprogram 3 This code may be printed with the command:
    dvips ~walker/public_html/courses/211/labs/micro-code-3.dvi
    
    Annotate each line of the code, following the approach used for the comments from step 1.

    Make a summary statement indicating the overall effect of this code.

  4. Write microcode for the Pascal statement
    Z := 8*X - 17;
    


Work to be turned in:


This document is available on the World Wide Web as

     http://www.math.grin.edu/~walker/courses/211/labs/lab.microprogramming.html

created September 21, 1997
last revised September 21, 1997