CS 207: Computer Organization and Architecture

Midterm exam, due on paper at 9:40AM Friday, October 20, 2006.

This is a an exam. You may consult your notes, any book, and the Internet. You may not speak with any person other than Jeff Ondich, electronically or otherwise, about the content of this exam. If you obtain relevant information from any source other than yourself, cite your sources clearly. Justify your answers. (Note that "justify your answers" implies "show your work.") Have fun.

  1. Integers (8 points)

    • What is the base-ten equivalent of the 32-bit two's complement integer 0xFFFC0785?
    • In base ten, what is the value of the largest 32-bit two's complement integer?
    • In base ten, what is the value of the smallest 32-bit two's complement integer? (Note that "smallest" and "largest" refer to position on the number line so, for example, -2 is smaller than 3.)
    • If you have a 32-bit two's complement integer N > 0, and 2*N is small enough to be representable as a 32-bit two's complement integer, then you can double N by shifting its two's complement representation left by one bit. Now, suppose N < 0. Does shifting left double N? If so, explain why. If not, give an example where it fails.
  2. Instruction sets (10 points)

    Suppose you wanted to modify the PDP-8 instruction set to add two new memory reference addressing modes: pre-decrement and post-increment. (This would bring the total number of addressing modes to four: direct, indirect, pre-decrement, and post-increment.) Pre-decrement would work exactly like indirect addressing, but would decrement the pointer address before using it. For example:

    
            Before                          After
            ============================    ============================
            AC = ????                       AC = 0003
    
            0200 START, CLA                 0200 START, CLA
            0201        TAD PREDEC PTR      0201        TAD PREDEC PTR
            0202        HLT                 0202        HLT
            0203 PTR,   0301                0203 PTR,   0300
            ...                             ...
            0300        0003                0300        0003
            0301        0005                0301        0005
            

    POSTINC would work similarly, but would increment the pointer after using it.

    • For what purposes would these addressing modes be useful?

    • Describe in detail a modification of the machine language memory reference instruction format that would enable you to add these two addressing modes. Instructions must remain 12 bits long, with a 3-bit op-code.
  3. Performance (8 points). Do problem 4.10 from the textbook.

  4. Free points (2 points). I just finished a book. What should I read next?

  5. Digital Logic (10 points)

    • Consider the following boolean function of three variables:

      
                   A   B   C  | Out
                  =================
                   0   0   0  |  0
                   0   0   1  |  1
                   0   1   0  |  0
                   0   1   1  |  1
                   1   0   0  |  1
                   1   0   1  |  1
                   1   1   0  |  0
                   1   1   1  |  1
                  

      • Write a boolean algebraic expression for this function, using a conjunction (sum) of 3-term products, as we did with a similar function in class.
      • Simplify your algebraic expression as much as possible.
      • Draw a circuit implementing this function using AND, OR, and NOT gates. Use as few gates you can.
    • Figures B.8.4 and B.8.5 show the construction and timing of a memory element triggered by the falling edge of the clock. Show how you would modify the circuit in figure B.8.4 to trigger the flip-flop by the rising edge of the clock. Also, show a modified version of figure B.8.5 to illustrate the triggering behavior of your modified flip-flop.