← 🚰 Instruction Pipelining & Hazards
Subtopic 6 of 8

2.6Operand forwarding (bypass)

The idea

Forwarding (bypassing) sends a result straight from where it is produced to where it is needed, instead of waiting for the register write.

Think of it like this: Passing a note directly to the next person instead of filing it and making them look it up.

Why it exists

It removes most RAW stalls with a little extra wiring.

How it works

  1. Without forwarding the consumer waits until the producer writes back.
  2. With forwarding, the ALU output is fed to the next instruction's EX stage next cycle.
  3. A load's data only exists after MEM, so a load-use dependency still costs 1 stall.

Worked example: ADD then dependent SUB

No forwarding: 2 stalls. With forwarding: 0. LW then dependent ADD: 1 stall even with forwarding.

Now play with it

  • →Flip through the three tabs and compare how many "stall" cells appear.
12345678
ADD R1,R2,R3IFIDEXMEMWB
SUB R4,R1,R5IFstallstallIDEXMEMWB

SUB must wait until ADD has written R1 (cycle 5): 2 stalls.

Check yourself

With full forwarding, how many stall cycles does LW R1 followed by an instruction using R1 need?

Remember: Forwarding fixes ALU→ALU. Load-use always costs 1.
Exam notes (the dense version)

Send ALU result straight to the next EX input. Removes most RAW stalls. A load-use dependency still needs 1 stall.

Previous year questions: Instruction Pipelining & Hazards (15)

PYQs are grouped by topic, so this is the full set for Instruction Pipelining & Hazards; try the ones that match this subtopic. Open all 15 on the topic page.