How to calculate average CPI for a pipelined processor?

848 Views Asked by At

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!!

0

There are 0 best solutions below