Midterm Exam, CSCI 312, Fall 2017


  1. [6 points] Draw a diagram that represents the WOMBAT CPU. Label all parts.
  2. Fetch-Decode-Execute
    1. [6 points] Describe what happens at each phase of the Fetch-Decode-Execute cycle.

    2. [4 points] Using RTN, describe at a component level what occurs during the Execute phase of a WOMBAT add instruction.

  3. [4 points] Registers
    1. What is a special purpose register? Give an example of a special purpose register in the WOMBAT architecture.

    2. What is a general purpose register? Give an example of a general purpose register in the WOMBAT architecture.

  4. [8 points] The authors of our book describe four factors that affect CPU performance. Name each and describe how it affects the performance of a program.

  5. [2 points] A CPU has a clock that runs at 2.0 GHz. Assume the CPI for this machine is 1. How long does it take to execute a single instruction. Please give your answer in proper units. Please show all work.

  6. A processor, running at 2GHz, has three classes of instructions with characteristics for a given program listed in the table below.
    Class CPI Frequency
    A 1 20%
    B 2 20%
    C 4 60%
    1. [2 points] Compute the average CPI for this machine.

    2. [2 points] If the program requires 2x109 instructions, how long will it take to execute this program.

    3. [2 points] A programmer has written an optimizer for the compiler that will reduce the frequency of instructions in class C to 40% but increase the frequency of instructions in class A and B to 25% and 35% respectively. In addition, the number of instructions required for the program will change to be 2.3x109. Should you use this compiler optimization and why? Show all work and an unsupported answer is wrong.

  7. For a 4 input MUX
    1. [4 points] Describe the input, output and function of this MUX.

    2. [2 points] Draw a circuit to implement this MUX.

  8. [6 points] Design and implement a circuit which takes two bits as input and adds a third bit such that the number of 1s in the three bits is always odd. Your answer should include a truth table, an equation and a circuit.