A CPU has five-stage pipeline and runs at 2 GHz frequency. Instruction fetch happens in the first stage of the pipeline. A conditional branch instruction computes the target address and evaluates the condition in the third stage of the pipeline. The processor stops fetching new instructions following a conditional branch until the branch outcome is known. Assume that each stage requires one clock cycle 20% of the instructions are conditional branches. Find the average execution time of the program for 200 instructions is ________.
My attempt plz verfiy
There were 2 stall cycles for pipelining for 20 % of the instructions
Frequency=2 GHz, Cycle time=1/f=0.5 ns
Average execution time= (1+ stall frequency × Stall cycle) x 0.5 ns
= (1+ 0.2 × 2) x 0.5 ns =0.7 ns
For 200 instructions, time=0.7 x 200 =140 ns.
if this is correct then plz check the below link
https://gateoverflow.in/210004/pipelining
where i m doing wrong