Lec 3
Lec 3
Control Hazards
• Branch determines flow of control
– Fetching next instruction depends on branch
outcome
– Pipeline can’t always fetch correct instruction
• Still working on ID stage of branch
• In MIPS pipeline
– Need to compare registers and compute target
early in the pipeline
– Add hardware to do it in ID stage
Prediction
correct
Prediction
incorrect
Right-to-left WB
flow leads to
hazards
Wrong
register
number
there is a typo,
so swap them
Important note:
see the control signals well