edited by
10,350 views
34 votes
34 votes
An instruction pipeline consists of $4$ stages – Fetch $(F)$, Decode field $(D)$, Execute $(E)$ and Result Write $(W)$. The $5$ instructions in a certain instruction sequence need these stages for the different number of clock cycles as shown by the table below $$\begin{array}{|c|c|c|c|c|} \hline \textbf{Instruction} & \textbf {F} &\textbf {D} & \textbf {E} &  \textbf{W } \\\hline \textbf{1}& 1 & 2  & 1 & 1 \\\hline \textbf{2} & 1 & 2 & 2  & 1\\\hline  \textbf{3}& 2 & 1  & 3 & 2 \\\hline \textbf{4} & 1 & 3 & 2  & 1 \\\hline \textbf{5} & 1 & 2 & 1  & 2 \\\hline \end{array}$$ Find the number of clock cycles needed to perform the $5$ instructions.
edited by

3 Answers

Best answer
45 votes
45 votes

Answer: 15 cycles are required.

$$\begin{array}{c|ccccccccccccc}
&t_1&t_2&t_3&t_4&t_5&t_6&t_7&t_8&t_9&t_{10}&t_{11}&t_{12}&t_{13}&t_{14}&t_{15}\\\hline
I_1&\text{F}&\text{D}&\text{D}&\text{E}&\text{W} \\ 
I_2&&\text{F}&-&\text{D}&\text{D}&\text{E}&\text{E}&\text{W}\\
I_3&&&&\text{F}&\text{F}&\text{D}&-&\text{E}&\text{E}&\text{E}&\text{W}&\text{W}\\
I_4&&&&&&\text{F}&-&\text{D}&\text{D}&\text{D}&\text{E}&\text{E}&\text{W}\\
I_5&&&&&&&&\text{F}&-&-&\text{D}&\text{D}&\text{E}&\text{W}&\text{W}\\
\end{array}$$

edited by
8 votes
8 votes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
F D D E W                    
  F - D D E E W              
      F F D - E E E W W      
          F - D D D E E W    
              F - - D D E W W

therefore 15 clock cycles needed.

edited by
6 votes
6 votes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
F D D E W                    
  F - D D E E W              
    F F - D - E E E W W      
        F - D D D - E E W    
          F - - - D D - E W W

I think this should be correct answer

 

Answer:

Related questions

54 votes
54 votes
3 answers
2
Kathleen asked Sep 23, 2014
15,413 views
A certain processor supports only the immediate and the direct addressing modes. Which of the following programming language features cannot be implemented on this proces...
35 votes
35 votes
4 answers
3
Kathleen asked Sep 23, 2014
8,961 views
The main difference(s) between a CISC and a RISC processor is/are that a RISC processor typicallyhas fewer instructionshas fewer addressing modeshas more registersis easi...