GATE / CS ARCHIVE

GATE CSE 2023 / QUESTION 33

GATE CSE 2023 Q33

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

GATE 2023, Q33 1 mark · NAT
Report issue

Pipelining & Hazards

Question 33, GATE 2023: A hazard-free 3-stage pipeline has stage delays 10,20,14 ns, no other delay, and fetches one instruction per cycle. Find total time in ns for 100 instructions, starting with an empty pipeline.
Tap to enlarge
Answer & solution

Official answer: 2040

The pipeline clock must accommodate the slowest stage, 20 ns. Three stages take 3 cycles for the first instruction, followed by one cycle per additional instruction. Thus100 instructions require 100+3−1=102 cycles and 102×20=2040 ns. There are no extra latch delays or hazard stalls by premise.

Teaching detail. A synchronous pipeline cannot clock each stage at its own independent duration: its common cycle length is bounded by the slowest stage. The first instruction leaves stage 3 after three 20 ns cycles. The remaining 99 instructions then finish one per cycle, so the elapsed time is (3+99)·20. Summing delays to get 44 ns per instruction would describe a different, unpipelined calculation. Multiplying only 100·20 overlooks the two extra fill/drain cycles in the finite batch.

Original paper, page 31 · Answer key