edited by
4,819 views
5 votes
5 votes

Consider a $5$-stage pipelined processor with Instruction Fetch (IF), Instruction Decode (ID), Execute (EX), Memory Access (MEM), and Register Writeback (WB) stages. Which of the following statements about forwarding is/are CORRECT?

  1. In a pipelined execution, forwarding means the result from a source stage of an earlier instruction is passed on to the destination stage of a later instruction
  2. In forwarding, data from the output of the MEM stage can be passed on to the input of the EX stage of the next instruction
  3. Forwarding cannot prevent all pipeline stalls
  4. Forwarding does not require any extra hardware to retrieve the data from the pipeline stages 
edited by

2 Answers

3 votes
3 votes

Answer: Option C. 

Each Option is discussed in THIS lecture on "Forwarding in pipeline".  

Option A: False.

Correct statement is: In a pipelined execution, forwarding means the result from a destination stage of an earlier instruction is passed on to the source stage of a later instruction. See HERE.

Option B: False, because of "next instruction". 

1. In forwarding, data from the output of the MEM stage can be passed on to the input of the EX stage of the next instruction. FALSE.

2. In forwarding, data from the output of the MEM stage can be passed on to the input of the EX stage of a later instruction. TRUE.

3. In forwarding, data from the output of the MEM stage can be passed on to the input of the EX stage of the next instruction, after a stall. TRUE. 

In the graphical representation of events (timing diagram that we draw for execution), forwarding paths are valid only if the destination stage is later in time than the source stage. For example, there cannot be a valid forwarding path from the output of the memory access stage in the first instruction to the input of the execution stage of the following, since that would mean going backward in time (tine travel). 

Option B is False & Option C is True. Explained HERE. 

Option D: False. We need to create forwarding datapaths. Explained HERE. 

Image Source: COA book by Patterson.

0 votes
0 votes

A C

A. True , bcoz a situation like forwarding to a earlier stage of next instruction will be a  (RAW) data hazards and Pipeline forwarding or bypassing  is technique to avoid stall due to RAW hazards."The forwarding unit detects hazards by comparing the destination registers to the source registers of the current instruction."
So the destination of the forwarding can never be a  earlier stage of next instruction.So such a case will never even arise.
In forwarding the destination is already decided wrt to the source stage and will never be a  earlier stage of next instruction.
ie "earlier stage of next instruction" is not even a possible candidate for destination (otherwise it will be a data hazard)
So A is correct. 

B. False bcoz EX of the next instruction will be overlapping with the MEM of current instruction . So the output of MEM of current can't be given as input to EX of next. 
If you consider split phase ie "writing at rising edge and reading at falling edge" ,this concept has nothing to do with Operand forwarding, it nowhere relates to the concept of operand forwarding.
This was said by Sachin Mittal in a comment. 
https://gateoverflow.in/1391/gate-cse-2005-question-68?show=95597#c95597

This is by ARJUN sir : https://gateoverflow.in/1391/gate-cse-2005-question-68?show=95621#c95621

C. True

D. False... MUX  a special "forwarding" circuit is implemented using the buffers and MUX

Have a read 

https://web.archive.org/web/20131227033204/http://hpc.serc.iisc.ernet.in/~govind/hpc/L10-Pipeline.txt
https://www.cs.uaf.edu/2011/fall/cs441/lecture/09_20_pipelining.html
https://courses.cs.washington.edu/courses/cse378/07au/lectures/L12-Forwarding.ppt

edited by
Answer:

Related questions

2.9k
views
2 answers
3 votes
Arjun asked Feb 16
2,896 views
Consider two set-associative cache memory architectures: $\text{WBC}$, which uses the write back policy, and $\text{WTC}$, which uses the write ... the victim cache block to main memory before loading the missed block to the cache
4.5k
views
2 answers
7 votes
Arjun asked Feb 16
4,465 views
Which of the following statements about a relation $\mathbf{R}$ in first normal form $\text{(1NF)}$ is/are TRUE?$\mathbf{R}$ can have a multi- ... $\mathbf{R}$ cannot have more than one candidate key
3.5k
views
1 answers
2 votes
Arjun asked Feb 16
3,452 views
Let $L_1, L_2$ be two regular languages and $L_3$ a language which is not regular.Which of the following statements is/are always TRUE?$L_1=L_2$ if and only ... $\overline{L_1} \cup \overline{L_2}$ is regular
4.0k
views
2 answers
3 votes
Arjun asked Feb 16
3,977 views
Which of the following statements about threads is/are TRUE?Threads can only be implemented in kernel spaceEach thread has its own file descriptor table ... stackThreads belonging to a process are by default not protected from each other