Professional Documents
Culture Documents
23EC1202
DIGITAL DESIGN & COMPUTER ARCHITECTURE
Session – 29 & 30
To understand the concept of instruction pipelining and identify, analyze, and mitigate pipeline hazards
INSTRUCTIONAL OBJECTIVES
This Session is designed to:
1. Comprehend the Concept of Instruction Pipelining
2. Identify and Analyze Pipeline Hazards
3. Capable of analyzing a given pipeline scenario, implementing suitable hazard mitigation
LEARNING OUTCOMES
• Pipelining is a process where multiple instructions are executed concurrently in a sequential manner. It
allows the CPU to overlap different stages of instruction processing, resulting in improved throughput.
1 2 3 4 5 6 7 8 9 10 1 12
I1 F1 D1 E1 W1
1
Conventional Sequential Execution I2 F2 D2 E2 W2
F3 D3 E3 W3
1 2 3 4 5 6 7 8
Pipelined Execution I1 F1 D1 E1 W1
F2 D2 E2 W2
I2
F3 D3 E3 W3
3
Conventional Sequential Execution
Pipelined Execution
Four Stage Pipeline
F: Fetch, Read the instruction from the Step 1 2 3 4 5 6 7 8 9
memory.
1 F1 D1 E1 W1
2 F2 D2 E2 W2
D: Decode, decode the instruction and fetch
the source operand (s). 3 F3 D3 E3 W3
4 F4 D4 E4 W4
E: Operate, perform the operation.
5 F5 D5 E5 W5
location.
5
Instruction Execution in a Six Stage Pipeline
Timing diagram of Six stage Pipelining
7
Pipeline Hazards
• While pipelining can significantly enhance performance, it also introduces several design issues
and challenges.
• Hazards are conditions when the regular execution of instructions is interrupted, causing delays or
inaccurate outcomes.
• Pipeline, or some portion of the pipeline, may stall because conditions do not permit continued
execution then pipeline hazard occurs. Such a pipeline stall is also referred to as a pipeline bubble.
Types of Pipeline Hazards
• Structural Hazards: These take place when many instructions concurrently use the same hardware
resource. A structural hazard appears, for instance, when two instructions must access the memory
unit simultaneously. Conflict and execution delays may result from this.
• Data Hazards: Data hazards in pipelining emerge when the execution of one instruction is
dependent on the results of another instruction that is still being processed in the pipeline.
• Control Hazards: Control hazard emerge as a result of the program's branching structure. The
pipeline is required to predict the result of a conditional branch instruction before it is actually
executed. Incorrect predictions result in control hazards, which waste cycles.
STRUCTURAL HAZARDS
10
DATA HAZARDS
11
CONTROL HAZARDS
• Control hazard occurs whenever the pipeline makes incorrect branch prediction decisions,
resulting in instructions entering the pipeline that must be discarded. A control hazard is often
referred to as a branch hazard.
12
Instruction Level Parallelism
• Instruction Level Parallelism (ILP) refers to a concept used to enhance the performance of modern
• ILP allows multiple instructions to be executed simultaneously, thereby improving overall processor
• It refers to the compiler design techniques and processors designed to execute operations, like
memory load and store, integer addition, and float multiplication, in parallel to improve the
13
Serial Vs Parallel Computing
How Parallel processing works ?
Parallel processing
• Parallel processing may occur in the instruction stream, in the data stream, or in both.
18
Single Instruction, Multiple data stream(SIMD)
19
Multiple Instruction, Single Data Stream (MISD)
P
O
O
L
20
Multiple Instruction, Multiple Data Stream (MIMD)
A) A technique to reduce the execution time of instructions by breaking down the instruction execution
process into several stages.
B) A process to execute multiple instructions in a single clock cycle.
C) A method to increase the clock speed of the processor.
D) A technique to reduce power consumption in processors.
`
2. What is a data hazard in instruction pipelining?
A) Out-of-order execution.
B) Increasing cache size.
C) Decreasing clock speed.
D) Reducing pipeline stages.
REFERENCES FOR FURTHER LEARNING OF THE SESSION
Reference Books:
1. Computer Organization by Carl Hamacher, Zvonko Vranesic and Saftwat Zaky.
2. Computer System Architecture by M. Morris Mano
3. Computer Organization and Architecture by William Stallings