When a control hazard occurs, what usually happens is to simply insert 3 bubbles. But, why does the first image says the penalty is only one? What's the case? I would like to know more about control hazards and its solutions, that's the question. I would like to know about the penalties in the case we assume a branch will be always takes, always untaken, and when we do not assume anything. For better understanding, if possibly, I would like to know about what happens in the stages (IF, ID, EX, MEM, WB) too, considering 5 stage pipeline. Also, please clarify if we need forwarding.
When a control hazard occurs, what usually happens is to simply insert 3 bubbles. But, why does the first image says the penalty is only one? What's the case?
I would like to know more about control hazards and its solutions, that's the question. I would like to know about the penalties in the case we assume a branch will be always takes, always untaken, and when we do not assume anything. For better understanding, if possibly, I would like to know about what happens in the stages (IF, ID, EX, MEM, WB) too, considering 5 stage pipeline. Also, please clarify if we need forwarding.
Dependencies in a pipelined processor
There are mainly three types of dependencies possible in a pipelined processor. These are :
1) Structural Dependency
2) Control Dependency
3) Data Dependency
These dependencies may introduce stalls in the pipeline.
Stall: A stall is a cycle in the pipeline without new input.
Structural dependency
This dependency arises due to the resource conflict in the pipeline. A resource conflict is a situation when more than one instruction tries to access the same resource in the same cycle. A resource can be a register, memory, or ALU.
Step by step
Solved in 2 steps