CS 207
Midterm 1
Ondich
Due on paper at 8:30 AM Friday, October 12, 2001

For this exam, you may use your textbook, the Internet, your notes and assignments, your brain, and divine guidance if available. You may not use other people. If you get stuck, talk to Jeff Ondich, but please don't talk to anyone else about the exam.

  1. (12 points) Complete the following PDP8/E subroutine. Try to minimize the number of instructions executed by the subroutine.

     / Preconditions: The auto-increment location labeled ADDR contains
    / 	the address of the first element of an array of 12-bit words.
    /	The AC contains the number of words in the array.
    /
    / Postconditions: The AC contains the largest item
    /	in the array.  Note that all positive numbers are larger
    /   than all negative numbers.
    
    MAXARRAY,   0000
                ...
                JMP I MAXARRAY
    

    Briefly describe what, if anything, you would do differently if your goal was to minimize the amount of memory taken up by the the subroutine.

    Watch out: is it true that A > B if and only if A - B > 0?

  2. (10 points) Give an example of each of the following situations. If your textbook contains such examples (in the main text or in the problems), you may refer to those examples. You may also just cook up examples of your own. (Note that the "performance" referred to in these situations is a technical term--it's the reciprocal of execution time.)

    Is it possible for machine M1 to have higher MIPS rating, higher clock rate, and lower CPI than M2, but still have worse performance?

  3. (12 points) The table below shows the execution times for all of the PDP8/E instructions (not including op-code 6).

    
    Execution times in micro-seconds for PDP8/E instructions
    --------------------------------------------------------
                             Addressing mode     
                  ------------------------------------------
    Instruction                            Indirect with
       Type       Direct      Indirect     auto-increment
    --------------------------------------------------------
    AND            2.6          3.8             4.0
    TAD            2.6          3.8             4.0
    ISZ            2.6          3.8             4.0
    DCA            2.6          3.8             4.0
    JMS            2.6          3.8             4.0
    JMP            1.2          2.4             2.6
    
    Opcode 7          1.2 (addressing mode irrelevant)
    --------------------------------------------------------
    

    Assume the following:

    Answer the following questions:

  4. (12 points) The diagram below (Digital and Microprocessor Electronics for Scientific Application, Dennis Barnaal, Waveland Press, 1989, page D100) shows a circuit known as a JK flip-flop. The weird black triangle in the middle is a diode--you don't need to worry about it.

  5. (4 points) Who are Gordon Moore and Maurice Wilkes, and why are they important in the history of computer architecture?

  6. (2 points) Direct me, if you wish, to a web site that you find amusing.

  7. (12 points) Read sections A.1 through A.4 of your textbook.