suppose there is only 1 instruction.
time to execute that instruction without pipeline = 5 clock cycles (since there are 5 stages and each stage takes 1 cc)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
for pipeline format
3rd stage is capable of knowing Branch Address (given)
=> number of stall cycles = 2
f % instructions are branch instructions
=> stall frequency = f
CPI of pipeline = (1 + stall Freq * stall cycles) clocks
= (1 + f * 2) clocks
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
speed up = time to execute in non pipeline/ time to execute in pipeline
=> 3 = 5/ (1+2f)
=> 1+2f = 5/3
=> 2f = 2/3
=> f = 1/3.