The datapath and the pipeline

How the control unit drives the datapath, how a five-stage pipeline overlaps instructions, and what data, control and structural hazards cost.

About 2 hours of study

Learning objectives

Lessons

  1. 1

    The datapath and the control unit Intermediate

    How the parts of a processor are wired together for each instruction, and how the control unit drives them with control signals, hardwired or microprogrammed.

  2. 2

    Pipelining Intermediate

    How a pipeline overlaps the stages of many instructions: the five classic stages, the k + n − 1 cycle count, throughput against latency, and unbalanced stages.

  3. 3

    Pipeline hazards Intermediate

    What stops a pipeline from running at full speed: data hazards and forwarding, control hazards and branch prediction, and structural hazards.

Module practice

Module quiz

1. Which control signal is 1 for lw but 0 for add?
2. A 4-stage pipeline runs 10 instructions with no stalls. How many cycles does it need?
3. Stage delays are 100, 200 and 150 ps with no register overhead. What is the pipelined clock period?
4. Which hazard comes from two instructions needing the same hardware unit in one cycle?
5. lw r1, 0(r2) is followed at once by add r3, r1, r4. With forwarding, how many stall cycles?
6. A 2-bit predictor in state 3 (strongly taken) sees two not-taken outcomes in a row. What does it predict next?

‹ Performance and arithmeticCaches and virtual memory ›