Formula:
Execution time in case of pipeline implantation = ( k + n - 1) × Tp
Where, k= number of stages
n = number of instructions
Tp= maximum stage delay + buffer delay
Speed up = \(\frac{{Execution\;time\;of\;naive\;pipeline}}{{Execution\;time\;of\;efficient\;pipeline}}\)
Calculation:
Here, total number of instructions are = 20
CASE 1: For naïve pipeline
K = 5
Stage delays are given as: 5, 4,20, 10, 3
Buffer delay = 2 ns
Clock time (Tp) = max {5,4, 20, 10, 3 } + buffer delay = 20 + 2 = 22ns
Execution time (Enp) = (5 + 20 - 1 ) × 22 = 528 ns
CASE 2: For efficient pipeline
K = 6
As OF stage is divides into two stages with delay of 12ns and 8 ns.
Clock time (Tp) = max { 5, 4, 12, 8, 10, 3} + buffer delay = 12 + 2 =14 ns
Execution time (Eep) = (6 + 20 - 1 ) × 14 = 350 ns
So, speed up = \(\frac{{528}}{{350}}\) = 1.508