edited by
1,418 views
4 votes
4 votes
Consider a machine with a 5-stage pipeline with a 1ns clock cycle. The second machine with a 12-stage pipeline with a 0.6ns clock cycle. The 5-stage pipeline experiences a stall due to data hazard for every 5 instructions, whereas 12 stage pipeline experiences 3 stalls for every 8 instructions. Branch instructions constitute 20% of the total instructions, and the misprediction rate for both machines is 5%.
If the branch mispredict the penalty for the first machine is 2 cycles but the second machine is 5 cycles, what is the speedup of a 12-stage pipeline over 5 stage pipeline--------------?
edited by

1 Answer

2 votes
2 votes

5 stage pipeline

Branch instructions = 20%

So for other 80% instructions Data Hazard may occur.

So number of stalls due to data hazard = 80% * 1/5 = 0.8*0.2 =0.16 cycles

Number of stalls due to branch instructions= 20% * Branch mis prediction ratio * branch penalty = 0.2*0.05*2 cycles= 0.02

Total stalls/instruction = 0.16+0.02=0.18 stalls.

Average Execution Time A = (1+#stalls)*cycle time = (1+0.18) * 1 ns = 1.18 ns

12 stage pipeline

Branch instructions = 20%

So for other 80% instructions Data Hazard may occur.

So number of stalls due to data hazard = 80% * 3/8 =0.3 cycles

Number of stalls due to branch instructions= 20% * Branch mis prediction ratio * branch penalty = 0.2*0.05*5 cycles= 0.05 cycles

Total stalls/instruction = 0.3+0.05=0.35 stalls.

Average Execution Time B = (1+#stalls)*cycle time = (1+0.35) * 0.6 ns = 0.81ns

SpeedUp of B(12) over A(5) = 1.18/0.81 = 1.456

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
0 answers
2
Na462 asked Nov 14, 2018
731 views
2 votes
2 votes
1 answer
3
Mk Utkarsh asked Oct 23, 2018
2,183 views
Consider the below instructions executed on a 5 stage(IF,ID,EX,MA,WB) RISC pipeline with operand forwarding.I1: ADD R0,R1,R2 (R0=R1+R2)I2: SUB R3,R0,R2I3:MUL R4,R3,R0I4:D...
3 votes
3 votes
2 answers
4
gauravkc asked Jan 24, 2018
1,097 views
R1 <- R1+R2R2 <- R3*R4R3 <- R4-R1R2 <- R3+R4Can someone point out hazards. Thanks :)