GATE / CS ARCHIVE

GATE CSE 2024 SET 1 / QUESTION 30

What forwarding solves and what it does not

Computer Organization & Architecture · Pipelining & Hazards · Full GATE CSE 2024 Set 1 paper

GATE 2024 Set 1, Q30 1 mark · MSQ
Report issue

Pipelining & Hazards

Question 30, GATE 2024: A processor has IF, ID, EX, MEM and WB pipeline stages. Which forwarding claims are correct? A An earlier instruction's result is passed from a source stage to a later instruction's destination stage. B MEM output can feed the next instruction's EX input. C Forwarding does not prevent every pipeline stall. D Forwarding needs no extra hardware.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: A, B, C

Approach: Forwarding supplies a computed value before the normal register-file writeback/read sequence has completed.
1. A later instruction may need a value that an earlier instruction has produced but has not yet written to the architectural register file. A bypass path sends that result directly to the consumer's appropriate stage. This is A.
2. A result available at the output of MEM can be routed to an EX input in a following cycle through pipeline registers and bypass selection. Thus B describes a valid forwarding path.
3. Availability still matters: in the usual five-stage pipeline, a load's value arrives too late for the immediately following instruction's EX stage without a load-use bubble. Control hazards and resource conflicts are not universally removed either. Therefore C is true.
4. Forwarding requires extra wires, multiplexers, register-number comparators and control logic to choose the correct source. D is false.
Answer: A, B and C. Forwarding reduces some data-hazard stalls; it does not eliminate timing constraints.

Original paper, page 19 · Answer key