retagged by
5,935 views
2 votes
2 votes

An instruction pipeline has five stages with stage latencies 1 ns, 2ns, 5 ns, 2ns, and 0.5 ns, respectively. A program has 10% branch instructions which execute in the fourth stage and produce the next instruction pointer at the end of the fourth stage.

Calculate the average instruction execution time:

retagged by

3 Answers

1 votes
1 votes

suppose there are n number of instruction out of which 10% are branch and 90% are unbranched

for branched insn CPI =4 because target address available after 4th stage while for unbranched CPI=1

average CPI= ((0.1*n*4) + (0.9*n*1)) / n

                   = 1.3 cycles

avg insn exen time= 1.3*5= 6.5 ns

0 votes
0 votes
You can explain it more easily by taking an example.

Let there is 10 instruction(I1, I2, I3,.....I10) in the program to be executed and there is branch instruction at i3 to i8. Then calculate time take to execute this program.

Total number of cycle to execute i1 to i3 is (5+2-1)

Total number of cycle to execute i8 to i10 is (5+2)

Average time to execute = (13*50/10 = 6.5

Related questions

0 votes
0 votes
1 answer
1
kathan Mistry asked Aug 9, 2022
561 views
In a pipelined architecture Static branch prediction is used with branch taken assumption. Assume that 30% of the instructions executed for a program are branch instructi...