Module 3 Pipelining
Module 3 Pipelining
Advantages of Pipelining:
1. The cycle time of the processor is reduced.
2. It increases the throughput of the system
3. It makes the system reliable.
Disadvantages of Pipelining:
1. The design of pipelined processor is complex and costly to manufacture.
2. The instruction latency is more.
Instruction Pipeline:
Four-segment instruction pipeline:
Six-segment instruction pipeline:
If the instruction processing is split into six phases, the instruction pipeline will have six
different for execution of instruction.
Let us consider the following decomposition of the instruction execution:
● Fetch Instruction (FI): Fetch the instruction from memory
● Decode Instruction ((DI): Decode the instruction.
● Calculate address (CA): calculate the effective address.
● Fetch Operands (FO): Fetch each operand from memory.
● Execute Instruction (EI): execute the instruction.
● Write Operand (WO): Store the result in memory.
• Address calculations for memory operations are performed based on the addressing
scheme.
Stalls: The periods in which the decode unit, execute unit, and the write unit are idle are
called stalls. They are also referred to as bubbles in the pipeline.
Hazard: Any condition that causes the pipeline to stall is called a hazard. There are three
types of hazards are possible:
• Data Hazard: A data hazard is any condition in which either the source or the
destination operands of an instruction are not available at the time expected in the
pipeline. As a result, some operation has to be delayed, and the pipeline stalls.
• Instruction hazards: The pipeline may also be stalled because of a delay in the
availability of an instruction. For example, this may be a result of a miss in the cache,
requiring the instruction to e fetched from the main memory. Such hazards are often
called control hazards or instruction hazards.
• Structural hazard: Structural hazard is the situation when two instructions require
the use of a given hardware resource at the same time. The most common case in
which this hazard may arise is in access to memory.
Data Hazard:
Control Hazards:
Occur due to branch (conditional jump) instructions.
Example: If the pipeline fetches the next instruction before knowing the outcome of a
conditional branch.
A variety of approaches have been taken for dealing with conditional branches:
● Multiple streams
● Prefetch branch target
● Loop buffer
● Branch prediction
● Delayed branch