GATE / CS ARCHIVE

GATE CSE 2003 / QUESTION 10

Three pipeline hazard classes

Computer Organization & Architecture · Pipelining & Hazards · Full GATE CSE 2003 paper

GATE 2003, Q10 1 mark · MCQ
Report issue

Pipelining & Hazards

Question 10, GATE 2003: For a pipelined CPU with one ALU, consider I. Instruction j+1 uses instruction j’s result; II. A conditional jump executes; III. Instructions j and j+1 need the ALU simultaneously. Which can cause a hazard? A. I and II only; B. II and III only; C. III only; D. All three.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. A data hazard concerns operand availability, a control hazard concerns which instruction address to fetch, and a structural hazard concerns resource availability. These are separate reasons a pipeline may need a stall or other mitigation. A single ALU does not eliminate the data or control cases.

2. Using a preceding result can cause a data hazard; a conditional branch causes a control hazard; simultaneous demand for the single ALU causes a structural hazard. Therefore all three can cause hazards, D. The question asks possibility, not that every instance necessarily stalls.

Original paper, page 2