• edited by
26,792 views
55 55 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 

3 Answers

41 41 votes

Let's analyze each statement about forwarding in the context of a pipelined processor with stages Instruction Fetch (IF), Instruction Decode (ID), Execute (EX), Memory Access (MEM), and Register Writeback (WB):

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: This statement is CORRECT. Forwarding (also known as bypassing) is a technique used to reduce data hazards by passing the result of an instruction directly to a subsequent instruction that needs it, without waiting for the result to be written back to the register file.

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: This statement is CORRECT. One common form of forwarding involves passing the output of the MEM stage (where the result of a load instruction might be available) directly to the EX stage of the next instruction that needs it.

3. Forwarding cannot prevent all pipeline stalls: This statement is CORRECT. Forwarding helps mitigate certain types of data hazards, particularly read-after-write (RAW) hazards, but it cannot eliminate all types of pipeline stalls. For example, hazards arising from control dependencies (branch instructions) or certain structural hazards might still cause stalls.

4. Forwarding does not require any extra hardware to retrieve the data from the pipeline stages: This statement is INCORRECT. Forwarding requires additional hardware, such as multiplexers and control logic, to select the appropriate data to be forwarded and to ensure that the data is correctly routed to the required pipeline stages.

Therefore, the statements that are CORRECT are:


A) 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.

B) 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.
 

C)Forwarding cannot prevent all pipeline stalls.

41 41 votes

 


  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.”

    • Correct. Forwarding (bypassing) ka basic concept hi yeh hai ki pehle instruction ka output (jo pipeline ke kisi stage par produce hua hai) agle instruction ke required stage tak seedha “forward” kar diya jaata hai, taaki woh data register file me writeback hone se pehle hi use ho sake.
  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.”

    • Correct. Typical 5‐stage pipeline me forwarding paths often EX→EX (same cycle), ya MEM→EX hoti hain. Agar instruction n ka result MEM stage me ready ho jaata hai, toh instruction n+1 ke EX stage ko ye data forward kiya jaata hai.
  3. “Forwarding cannot prevent all pipeline stalls.”

    • Correct. Forwarding data hazards (RAW type) kaafi hat tak solve kar deta hai, par kuch hazards, jaise load‐use hazard (agar data load se turant agle instruction me use ho raha ho aur forward karne ka time na ho), control hazards (branches), ya structural hazards, phir bhi stalls la sakte hain. Forwarding sab stalls ko eliminate nahi kar sakta.
  4. “Forwarding does not require any extra hardware to retrieve the data from the pipeline stages.”

    • Incorrect. Forwarding ke liye bypass paths aur multiplexers chahiye hote hain, jisse aap EX/MEM stage ke outputs ko agle EX stage me daal sako. Yeh sab additional hardware hi hai.

Conclusion

  • Statements (1), (2), aur (3) are Correct.
  • Statement (4) is False.

 

2 2 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
4 flags:
✌ Low quality (Kushal Mukherjee “wrong ans”)
✌ Low quality (romirbedekar60334 “wrong ans”)
✌ Edit necessary (TanayH “option b is true”)
✌ Low quality (priyanshparsai212 “wrong ans”)
Answer:
Position:
Show:

Related questions

48 48 votes
9 9 answers
19.4k
19.4k views
Arjun asked Feb 16, 2024
19,441 views
​​​​Consider two set-associative cache memory architectures: $\text{WBC}$, which uses the write back policy, and $\text{WTC}$, which uses the write through policy. Both o...
79 79 votes
11 answers 11 answers
34.1k
34.1k views
go_editor asked Sep 28, 2014
34,069 views
Consider a $6$-stage instruction pipeline, where all stages are perfectly balanced. Assume that there is no cycle-time overhead of pipelining. When an application is exec...
30 30 votes
3 3 answers
15.1k
15.1k views
Arjun asked Feb 16, 2024
15,122 views
​​​​Which one of the following statements is FALSE?In the cycle stealing mode of DMA, one word of data is transferred between an I/O device and main memory in a stolen cy...
55 55 votes
13 13 answers
22.3k
22.3k views
Arjun asked Feb 16, 2024
22,325 views
The baseline execution time of a program on a $2 \mathrm{GHz}$ single core machine is $100$ nanoseconds ( $n s)$. The code corresponding to $90 \%$ of the execution time ...