The Performing CPU

  1. Suppose that the instruction frequencies and clock cycle counts for a an ISA are as shown in the table below:

    Ins Type #Ins(Freq) CCt
    ALU .44 1
    Load .21 2
    Store .12 2
    Branch .23 2

    A proposed modification to the ISA would replace one fourth of the ALU instructions, that are paired with a loaded operand that is never used again, with a new ALU2 instruction that incorporates the previously loaded operand in the instruction word. While the addition of this ALU2 instruction decreases the number of load instructions, the number of clock cycles for a branch is increased to three. The ALU2 instruction takes one clock cycle. So, the designers plan to use an optimizing compiler that will discard a third of the remaining ALU instructions.

    Will this modified protocol improve the average execution time? Justify your answer using a quantitative approach, with the following table, to help you.
    Ins Type #(Not Freq) CCt
    ALU .22 1
    ALU2 .11 1
    Load .10 2
    Store .12 2
    Branch .23 3

    Incorrect Answer:

    Let CCT be the clock cycle time. Assume that it remains the same after the modification. Let IC be the instruction counts of the original system.

    $CPU_{old} = (1*0.44 + 2*0.21 + 2*0.12 + 2*0.23)*IC*CCT = 1.56*IC*CCT$
    $CPU_{new} = (1*0.22 + 1*0.11 + 2*0.10 + 2*0.12 + 3*0.23)*IC*CCT = 1.46*IC*CCT$

    Speedup = $CPU_{old} / CPU_{new} = 1.56/1.46 = 1.07$

    Note: This answer is numerically correct, but textually incorrect. Why? What's wrong with it.1

  2. Two machines use the same number of instructions to execute a given set of programs, and have the same clock cycle times. Must their performance be the same, or can the workload execution time differ on the two machines. Give a reasonable explanation to justify your conclusions. (This is a thought question. There are lots of right answers here. Think of at least two.)

    Answer: No, it is possible that their performance is not the same.

  3. A modification to a computer system and its operations decreases the number of stores by 50%, increases the number of ALU operations by 20%, and increases the number of loads by 20%. The original system took 1 clock cycle per ALU instruction, and 2 clock cycles for all other instructions. In the new system, stores take 3, branches now take 2 clock cycles and loads and ALUs only take 1 clock cycle.

    Answer: Evaluate the effect of the modification quantitatively.

    Let CCT be the clock cycle time. Assume that it remains the same after the modification. Let $IC_{STORE}$, $IC_{ALU}$, $IC_{LOAD}$ and $IC_{BR}$ be the instruction counts of the STORE, ALU, LOAD and BRANCH operations in the original system.

    Speed up
    = $(CCT*(IC_{STORE}*2+IC_{ALU}*1+IC_{LOAD}*2+IC_{BR}*2))
/ (CCT*(0.5IC_{STORE}*3+1.2IC_{ALU}*1+1.2IC_{LOAD}*1+IC_{BR}*2))$
    = $(2IC_{STORE}+IC_{ALU}+2IC_{LOAD}+2IC_{BR})
/ (1.5IC_{STORE}+1.2IC_{ALU}+1.2IC_{LOAD}+2IC_{BR})$

MM Hugue 2018-09-06