retagged by
20,858 views
17 votes
17 votes

A $5$ stage pipelined processor has the following stages:

  • $IF$ : instruction fetch
  • $ID$ : instruction decode
  • $EX$ : execute
  • $MA$ : memory access
  • $WB$ : write back

$$\large\color{red}{IF \rightarrow ID\rightarrow EX\rightarrow MA\rightarrow WB}$$

  • Each stage needs one cycle for all instructions.

$\begin{matrix} I_1.&\text{Load} &R_1 ,\;[1000] &&& : \quad &R_1&\leftarrow &M[1000] \\ I_2.&\text{Load} &R_3 \; ,\; 5(R_2) &&& : \quad &R_3&\leftarrow &M[R_2+5] \\ I_3.&\text{MUL} &R_4 \; ,R_1\;,R_3 \; &&& : \quad &R_4&\leftarrow &R_1\;*\;R_3 \\ I_4.&\text{DIV} &R_5 \; ,R_1\;,R_4 \; &&& : \quad &R_5&\leftarrow &R_1\; \div \;R_4 \\ I_5.&\text{SUB} &R_6 \; ,R_4\;,R_5 \; &&& : \quad &R_6&\leftarrow &R_4\;-\;R_5 \\ \end{matrix}$

No. of cycles needed to execute these instructions using operand forwarding?

retagged by

1 Answer

Best answer
20 votes
20 votes

Operand Forwarding 

  • Data is forwarded when it is ready . It  depends on the type of instruction . for $I_1$ and $I_2$ data can be forwarded from MA stage for other instruction data can be forwardd from EX stage
  • The previous clock cycle  must complete before data being forwarded . Unless split phase technique is used
  • Use split phase access if data is ready- like between WB/RD
  • and also when operand forwarding happens from EX-ID stages, but not from EX-EX stages. We cannot do split phase access between EX-EX, because there is no guarantee that the instruction execution can be done within a half phase.[mostly when it is given in question that there is operand forwarding from A stage to B stage eg:https://gateoverflow.in/8218/gate2015-2_44 ]
  • Here nothing has mentioned about data forwarding from particular stage to other so we can chose the best option possible.

Using Operand Forwarding Techinique it will take 10 clock cycles

Reference

selected by
Answer:

Related questions

0 votes
0 votes
1 answer
1
Deepak9000 asked Nov 5, 2023
256 views
I have a Self doubt question on Operand Forwarding . The data forwarded should be done in EX-EX stage or Mem-EX ? Which one to follow and when ?Using EX-EX we require les...
0 votes
0 votes
2 answers
4