GATE CS - COMPUTER ORGANIZATION:CPU Design and Pipelining

Mastering cpu design and pipelining concepts and implementation.

CPU Design and Pipelining for GATE CS

GATE pipeline questions are numerical: speedup, stalls from hazards, and occasionally forwarding. Draw the stage timeline.

Classic 5-stage sketch

IF → ID → EX → MEM → WB. Ideal speedup approaches number of stages when the pipeline is full and hazard-free.

Speedup (idealized)

Without pipeline: time ≈ n×k×tn \times k \times t for nn instructions, kk stages, stage time tt.

With pipeline (no stalls): ≈ (k+n−1)t(k + n - 1) t.

Speedup ≈ (nk)/(k+n−1)→k(n k) / (k + n - 1) \to k as nn grows.

Hazards

HazardCauseMitigations
StructuralResource conflictDuplicate units / separate I/D caches
DataNeed result not readyForwarding, stall, reorder
ControlBranch outcome unknownPredict, delay slot, flush

Worked: load-use stall

If EX needs a value loaded in the previous instruction’s MEM, even with forwarding you may need one stall. GATE states whether forwarding exists — read the assumption.

CPI with stalls

effective CPI=1+stalls per instruction\text{effective CPI} = 1 + \text{stalls per instruction} for a single-issue pipeline that would otherwise be CPI 1.

Previous: ISA. Next: Cache.