Laboratory Exercises For Computer Science 211

Microprogramming

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

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-1, 4-2, 4-5, 4-6, and 4-7 (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 the Local Variable register LV contains the base address of the integer array X.

  1. Consider Microprogram 1 which implements the C or Java statement X[2] = X[1] - X[0] .
    This code may be printed with the command:
    dvips ~walker/public_html/courses/211.fa01/labs/micro-code-1.dvi
    
    1. Write a sentence or two to explain why each statement does what is claimed by the comment field (or correct any mistakes in the code, explaining what was wrong and how the correction fixes the problem).

    2. Why do you think the address of X[1] was stored both in the MAR and OPC?

    3. Why do you think the address of X[1] was stored in OPC rather than in LV?
      (Hint: what might be the long-term use of LV?)

    4. Explain how timings effect what data are available where at each step.

    5. While this code is finished with instruction 4, explain why the bus may not be used for the next job until another clock cycle is finished.

  2. Write a microprogram to compute X[2] = X[0] - X[1] .

    Annotate each step of your microprogram to explain what the line does. Compare the complexity of this program with that the first version?

  3. Write microcode for the C or Java statement
    X[1] = 8*X[0] - 17;
    
    Again, annotate each step of your microprogram


Work to be turned in:


This document is available on the World Wide Web as

     http://www.cs.grinnell.edu/~walker/courses/211.fa01/labs/lab.microprogramming.html

created September 21, 1997
last revised September 25, 2001
Valid HTML 3.2!
For more information, please contact Henry M. Walker at walker@cs.grinnell.edu.