GATE / CS ARCHIVE

SIMILAR QUESTIONS / COMPUTER ORGANIZATION & ARCHITECTURE

Time a hazard-free instruction batch including pipeline fill

5 questions solved the same way, newest first. Back to Computer Organization & Architecture

How these are solved

Choose the clock period from the slowest stage plus stated register/latch overhead and use instruction count plus stage count minus one cycles. The 2017 variant computes this for two stage partitions and compares their times;

2 marks · NAT
Report issue

Pipelining & Hazards

Question 56, GATE 2025: A five-stage pipeline has stage delays 180,250,150,170,250 ns. Each inter-stage latch adds 10 ns. With no stalls, how long does execution of 1000 instructions take, in microseconds to two decimal places?
Tap to enlarge
Answer & solution

Official answer: 260.20 to 261.20

Our answer: 261.04

A synchronous pipeline clock must allow its slowest stage plus the latch overhead to complete. Thus T_clock=max(180,250,150,170,250)+10=260 ns. Adding all five stage delays would instead describe an unpipelined or differently timed design; faster stages must still wait for this common clock.

The first instruction completes after five cycles. Once the pipeline is full, one further instruction completes per cycle, so 999 additional instructions take 999 more cycles. Total cycles=k+n−1=5+1000−1=1004.

Execution time is 1004·260=261040 ns. Dividing by 1000 ns per microsecond gives 261.04 μs. The fill/drain accounting is already included in k+n−1; adding separate extra fill and drain terms would double-count. The value lies within the published acceptable range 260.20 to 261.20 μs. Answer: 261.04.

Original paper, page 43 · Answer key

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

2 marks · NAT
Report issue

Pipelining & Hazards

Question 53, GATE 2021: A five-stage pipeline has stage delays 150,120,150,160,140 ns, and its interstage registers each have 5 ns delay. With no stalls, find the total execution time of 100 independent instructions in ns.
Tap to enlarge
Answer & solution

Official answer: 17160

The clock period is the slowest combinational stage delay plus the pipeline-register delay: 160+5=165 ns. Five stages take five clocks for the first instruction and one clock for each of the remaining 99. Total cycles=5+99=104, so execution time is 104*165=17160 ns under the standard synchronous-pipeline timing convention.

The clock cannot use the average stage delay: every stage must finish before the next common edge, so the 160 ns stage controls. Add 5 ns register overhead once per clock interval to obtain 165 ns, rather than summing all register delays into one stage. The first instruction completes after five clocks and the hundredth after 99 additional clocks. This separates pipeline latency from steady-state throughput and avoids the error 100×5×165.

Original paper, page 40 · Answer key

2 marks · NAT
Report issue

Pipelining & Hazards

Question 50, GATE 2017: Five pipeline stages IF,ID,OF,EX,WB take 5,4,20,10,3 ns; interstage buffer overhead is 2 ns. NP uses these five stages. EP splits OF into OF1=12 ns,OF2=8 ns. Find EP speedup over NP for 20 independent hazard-free instructions, to two decimals.
Tap to enlarge
Answer & solution

Official answer: 1.49 to 1.52

Our answer: 1.51

1. The clock period is the slowest stage plus buffer overhead. NP therefore has period max(5,4,20,10,3)+2=22 ns. Its five-stage pipeline needs 5+(20−1)=24 cycles, or 528 ns.

2. EP has stages 5,4,12,8,10,3 ns, so its period is 12+2=14 ns. Six stages need 6+19=25 cycles for the same twenty instructions, or 350 ns.

3. Speedup is old time/new time=528/350=1.508571..., rounding to 1.51. Using only the clock ratio 22/14 neglects the extra fill cycle.

Original paper, page 22 · Answer key

2 marks · MCQ
Report issue

Four-stage pipeline completion time

Pipelining & Hazards

Question 69, GATE 2004: A four-stage pipeline has stage delays 150,120,160,140 ns and interstage-register delay 5 ns. With a constant clock period, how long does it take to process 1000 items?
Options:
(A) 120.4 μs
(B) 160.5 μs
(C) 165.5 μs
(D) 590.0 μs
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. The common clock period is the slowest stage plus register delay: max(150,120,160,140)+5=165 ns. A four-stage pipeline needs 4 cycles for its first item and 999 more for the remaining items.

2. Total time is (1000+4−1)×165=165495 ns=165.495 microseconds, rounded to 165.5 microseconds, C. This is the standard balanced-clock pipeline timing model.

3. Teaching check: Pipeline throughput is set by the slowest stage, not the sum of stage delays. The sum matters for an unpipelined path; the pipelined batch takes a fill of four cycles plus one cycle for each subsequent item. Include the register delay in every clock period.

Original paper, page 10