edited by
773 views
1 votes
1 votes

Consider the following sequence of instructions executed on the five-stage pipelined processor:

LW    $1, 30($6)

ADD  $2, $4, $2

ADD  $1, $3, $5

SW   $2, 20($4)

ADD  $1, $1, $4

Assuming there is no forwarding, calculate the number of clock cycles needed to execute above program ?

edited by

1 Answer

0 votes
0 votes

$$\small \begin{array}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|} \hline
&\bf{t_1}&\bf{t_2}&\bf{t_3}&\bf{t_4}&\bf{t_5}&\bf{t_6}&\bf{t_7}&\bf{t_8}&\bf{t_9}&\bf{t_{10}}&\bf{t_{11}}\\
\hline
\textbf{I1}&\text{IF}&\text{ID}&\text{EX}&\text{MEM}&\text{WB}\\
\textbf{I2}&&\text{IF}&\text{ID}&\text{EX}&\text{MEM}&\text{WB}\\
\textbf{I3}&&&\text{IF}&\text{-}&\text{ID}&\text{EX}&\text{MEM}&\text{WB}\\
\textbf{I4}&&&&&\text{IF}&\text{ID}&\text{EX}&\text{MEM}&\text{WB}\\\textbf{I5}&&&&&&\text{IF}&\text{-}&\text{ID}&\text{EX}&\text{MEM}&\text{WB}\\

\hline\end{array}$$

Total $11$ clock cycles required.

Similar to this one https://gateoverflow.in/76963/stall-cycles-without-forwarding

edited by

Related questions

2 votes
2 votes
1 answer
2
0 votes
0 votes
1 answer
4