0

For a question on a practice exam, it asks:

Consider a program consisting of 100 ld instructions in which each instruction is dependent on the instruction immediately preceding it, e.g.,

ld x2,0(x1)

ld x3,0(x2)

ld x4,0(x3)

What would the average CPI be in the pipelined processor with forwarding?

It also says the supposed answer is (5 + (99 * 2)) / 100 = 2.03. I understand 5 is the number of steps per instruction, and there are read/write processes for each step, however I have several questions regarding this:

  1. First, why is 5 being added to 99*2 instead of multiplied, even though each instruction has 5 steps?
  2. How would you calculate the answer assuming no forwarding?

Thanks!!

  • As someone who has worked in the field, I'm pretty sure that question doesn't make any sense without more context. What is "the pipelined processor"? – Veedrac Dec 21 '18 at 07:59
  • But I *think* what it's saying is that the first 99 instructions can forward with 2-cycle latency, but the last only retires in its 5th cycle since there's nothing to forward to. (This is a silly number and not really what people mean by CPI, but it would explain the math.) – Veedrac Dec 21 '18 at 08:01

0 Answers0