Consider a pipeline processor with $4$ stages $S1$ to $S4$. We want to execute the following loop:
for (i = 1; i < = 1000; i++)
{I1, I2, I3, I4}
where the time taken (in ns) by instructions $I1$ to $I4$ for stages $S1$ to $S4$ are given below:
$$\begin{array}{|c|c|c|c|c|} \hline & \textbf {$S _1$} &\textbf {$S _2$} & \textbf {$S _3$} & \textbf{$S _4$ } \\\hline \textbf{I1}& \text{$1$} & \text{$2$} & \text{$1$} & \text{$2$} \\\hline \textbf{I2} & \text{$2$} & \text{$1$} & \text{$2$} & \text{$1$}\\\hline \textbf{I3}& \text{$1$} & \text{$1$} & \text{$2$} & \text{$1$} \\\hline \textbf{I4} & \text{$2$} & \text{$1$} & \text{$2$} & \text{$1$} \\\hline \end{array}$$
The output of $I1$ for $i = 2$ will be available after
- $\text{11 ns}$
- $\text{12 ns}$
- $\text{13 ns}$
- $\text{28 ns}$