0

I got two questions about cpu time and CPI but it is hard than I expected because of unfamiliar words :( Could you tell me whether my answer is right or not.

Question : If company A has designed a processor P1 with the following CPIs like below and clock rate of P1 is 2GHz.

Q1: You have written an application program that has 0.1million instructions in a loop that is executed 1000 times with the following instruction mix. What is the expected CPI for this workload? and how long does the benchmark take to execute?

A1: In this processor average CPI =3x0.3+2x0.15+1x0.4+3x0.1+2x0.05=2, cpu time = instruction count * cpi(1/clock rate)=10^5x2x(1/2x(10^9))=10^-4

Q2: Assume new special addition instruction merges the load and add operation. For this new instruction , 1/2 of ALU instruction can be merged with preceding load instruction, the CPI of the new instruction is 5 cycles and clock frequency can be changed to 1 GHz. Then what is the new execution time?

A2: After the new special addition, instruction count is 10^5 , cpi is 5 and clock rate is 10^9 so new excutution time should be 10^5x5x(1/(10^9))= 5x10^-4

instruction type CPI
load 3
store 2
ALU operations 1
branch 3
jumps 2

original frequency before new special addition

instruction type Frequency
load 30%
store 15%
ALU operations 40%
branch 10%
jumps 5%
smrmaak
  • 11
  • 2
  • Use backticks for `code formatting` around your formulas; Markdown uses `*` for *italics*. – Peter Cordes Apr 16 '22 at 08:45
  • 1
    Also, this new load+add instructions seems like total garbage in this hypothetical CPU. Separate load + add costs 4 cycles total, vs. 5, and it cuts the CPU frequency in half? Looks like they need to consider modern x86 implementation techniques (decode to uops) to benefit from increased code density. Or maybe they're trying to illustrate that load/store architectures are simpler to build and work well for in-order pipelines. But with each load costing 3 cycles, it's maybe not even pipelined, which would be weird for 2GHz. – Peter Cordes Apr 16 '22 at 08:50
  • Anyway, the overall CPI isn't 5, just for that new instruction. – Peter Cordes Apr 16 '22 at 08:50
  • @ErikEidt Thank you for your comment. But could you tell me if the answer of Q1? I think the part of the question2 "1/2 of ALU instruction " means half of the ALU operations! – smrmaak Apr 16 '22 at 17:23
  • Is this your homework? Anyway, Q2 looks like that it discusses micro-op fusion with wrong data. I think the answer is $3*0.1+2*0.15+1*0.2+3*0.1+2*0.05=1.2$ $5*0.2=1$ $8*10^4*1.2/(2*10^9)=4.8*10^(-5)$ $2*10^4*1/(1*10^9)=2*10^(-5)$ $4.8*10^(-5)+2*10^(-5)=6.8*10^(-5)$ – moep0 Apr 21 '22 at 02:51

0 Answers0