Let initial processor with 2.5Ghz is P1 and new processor with 2Ghz is P2.
Old execution time = CPI/2.5 = 4/2.5 = 1.6 ns
This is the usual equation, you all know about it.
With pipelining, each instruction needs old execution time * old frequency/new frequency (without pipelining) = 1.6 * 2.5 / 2 = 2 ns
P1 is upgraded to P2 but still non-pipelined, so the above equation into play again as
Execution Time=old CPI/New Frequency which is 4/2=2ns.
(sir has done that putting old values as ((4/2.5)*2.5)/2=2ns).
{Section-1}
P2 becomes pipelined and we know when we upgrade our processor from non-pipelined to pipelined we achieve a speedup of "number of stages" we have in the pipeline, i.e. 5, over non-pipelined P2.
There are 5 stages and when there is no pipeline stall, this can give a speed up of up to 5 (happens when all stages take same number of cycles). In our case this time will be 2/5 = 0.4 ns. But clock frequency being 2 GHz, clock cycle is 1/2 GHz = 0.5 ns and a pipeline stage cannot be faster than this.
So, what will be the new execution time?
It will be obtained by the formula of speed up,
i.e. Speed up =Old time/new time
So, New time=Speed Up/Old time
=2/5=0.4 nsec.
{Section-1 Ends}
What happened in section-1 is we calculated pipelined processor P2 cycle time from its non-pipelined format.
Now, we calculate Cycle time of pipelined processor P2 like we usually do, In ideal pipeline, CPI is 1, and given clock rate is 2Ghz.
Execution time = CPI/clock rate
=1/2=0.5 nsec
Why there is a difference in the two execution time of the same processor when pipelined. I don't know exactly, may be arjun sir clarify this point. But I can say that the method we are using in section-1 is considering CPI=4 for non-pipeline of P2 as this CPI of old P1, it might happen P1 would have less number of stages than P2, which change the non-pipelined CPI of P2.
If above statement is confusing we can also look at this our new processor P2 has 5 stages if each stage takes 1-cycle time so our new CPI will be 5 which is greater than P1.
As CPI increase in equation Execution time=CPI/clock rate the time execution time increased. remember we still talking about the non-pipelined processor.
but as soon the processor become pipeline its Ideal CPI becomes 1 as at every clock cycle it produces one output. So we can calculate P2 another way which gave an answer as 0.5 nsec.
So, average instruction execution time after pipelining = max (0.4, 0.5) = 0.5 ns.
Everything is working in sequence like P1 non-pipe -> becomes P2 Non-pipe -> from which we calculate P2 pipe execution time -> then we calculate P2 pipe execution time again with default method-> compare both of these -> Max is chosen(don't know why?).
SpeedUp= Non-pipelined of P1/Pipelined of P2
=1.6/0.5
=3.2