Menu
Home Explore People Places Arts History Plants & Animals Science Life & Culture Technology
On this page
Operand forwarding
CPU optimization technique to improve instruction-level parallelism

Operand forwarding (or data forwarding) is an optimization in pipelined CPUs to limit performance deficits which occur due to pipeline stalls. A data hazard can lead to a pipeline stall when the current operation has to wait for the results of an earlier operation which has not yet finished.

We don't have any images related to Operand forwarding yet.
We don't have any YouTube videos related to Operand forwarding yet.
We don't have any PDF documents related to Operand forwarding yet.
We don't have any Books related to Operand forwarding yet.
We don't have any archived web articles related to Operand forwarding yet.

Example

ADD A B C #A=B+C SUB D C A #D=C-A

If these two assembly pseudocode instructions run in a pipeline, after fetching and decoding the second instruction, the pipeline stalls, waiting until the result of the addition is written and read.

Without operand forwarding
12345678
Fetch ADDDecode ADDRead Operands ADDExecute ADDWrite result
Fetch SUBDecode SUBstallstallRead Operands SUBExecute SUBWrite result
With operand forwarding
1234567
Fetch ADDDecode ADDRead Operands ADDExecute ADDWrite result
Fetch SUBDecode SUBstallRead Operands SUB: use result from previous operationExecute SUBWrite result

In some cases all stalls from such read-after-write data hazards can be completely eliminated by operand forwarding:345

With operand forwarding (enhanced)
123456
Fetch ADDDecode ADDRead Operands ADDExecute ADDWrite result
Fetch SUBDecode SUBRead Operands SUB: use result from previous operationExecute SUBWrite result

Technical realization

The CPU control unit must implement logic to detect dependencies where operand forwarding makes sense. A multiplexer can then be used to select the proper register or flip-flop to read the operand from.

See also

References

  1. "CMSC 411 Lecture 19, Pipelining Data Forwarding". University of Maryland Baltimore County Computer Science and Electrical Engineering Department. Retrieved 2020-01-22. http://www.csee.umbc.edu/~squire/cs411_l19.html

  2. "High performance computing, Notes of class 11". hpc.serc.iisc.ernet.in. September 2000. Archived from the original on 2013-12-27. Retrieved 2014-02-08. https://web.archive.org/web/20131227033204/http://hpc.serc.iisc.ernet.in/~govind/hpc/L10-Pipeline.txt

  3. Gurpur M. Prabhu. "Computer Architecture Tutorial". Sections "Forwarding". and "Data Hazard Classification". https://web.cs.iastate.edu/~prabhu/Tutorial/PIPELINE/forward.html

  4. Dr. Orion Lawlor. "Pipelining, Pipeline Stalls, and Operand Forwarding". https://www.cs.uaf.edu/2011/fall/cs441/lecture/09_20_pipelining.html

  5. Larry Snyder. "Pipeline Review". https://courses.cs.washington.edu/courses/cse378/09au/lectures/cse378au09-15.pdf