20 Lecture
CS501
Midterm & Final Term Short Notes
Hazards in Pipelining
Hazards in pipelining refer to situations where the pipeline execution is stalled due to a conflict or dependency between pipeline stages. These hazards can significantly impact the performance of the pipeline by increasing the pipeline latency
Important Mcq's
Midterm & Finalterm Prepration
Past papers included
Download PDF
- What is a hazard in pipelining?
a) A condition where the pipeline execution is stalled
b) A condition where the pipeline execution continues uninterrupted
c) A condition where the pipeline execution reverses
d) A condition where the pipeline execution stops completely
Answer: a) A condition where the pipeline execution is stalled
What is a data hazard?
a) A hazard caused by the use of a shared resource
b) A hazard caused by an instruction that changes the program counter
c) A hazard caused by a dependency between two or more instructions
d) A hazard caused by a structural limitation in the pipeline design
Answer: c) A hazard caused by a dependency between two or more instructions
What is a structural hazard?
a) A hazard caused by an instruction that changes the program counter
b) A hazard caused by a dependency between two or more instructions
c) A hazard caused by a structural limitation in the pipeline design
d) A hazard caused by the use of a shared resource
Answer: c) A hazard caused by a structural limitation in the pipeline design
What is a control hazard?
a) A hazard caused by a dependency between two or more instructions
b) A hazard caused by an instruction that changes the program counter
c) A hazard caused by a structural limitation in the pipeline design
d) A hazard caused by the use of a shared resource
Answer: b) A hazard caused by an instruction that changes the program counter
What is pipeline latency?
a) The number of pipeline stages in the pipeline
b) The time required to complete one pipeline stage
c) The total time required to complete a sequence of pipeline stages
d) The time required to switch between pipeline stages
Answer: c) The total time required to complete a sequence of pipeline stages
What is pipeline throughput?
a) The time required to complete one pipeline stage
b) The total time required to complete a sequence of pipeline stages
c) The number of pipeline stages in the pipeline
d) The rate at which instructions are completed by the pipeline
Answer: d) The rate at which instructions are completed by the pipeline
How can data hazards be resolved in pipelining?
a) By inserting NOP instructions
b) By reordering instructions
c) By forwarding data between pipeline stages
d) By stalling the pipeline
Answer: c) By forwarding data between pipeline stages
How can structural hazards be resolved in pipelining?
a) By inserting NOP instructions
b) By reordering instructions
c) By forwarding data between pipeline stages
d) By adding additional resources
Answer: d) By adding additional resources
How can control hazards be resolved in pipelining?
a) By inserting NOP instructions
b) By reordering instructions
c) By forwarding data between pipeline stages
d) By using branch prediction
Answer: d) By using branch prediction
Which type of hazard can be resolved by instruction reordering?
a) Data hazards
b) Structural hazards
c) Control hazards
d) All of the above
Answer: d) All of the above
Subjective Short Notes
Midterm & Finalterm Prepration
Past papers included
Download PDF
What is a pipeline hazard? A pipeline hazard is a condition that occurs during pipelining where the pipeline execution is stalled due to a conflict or dependency between pipeline stages. What is a data hazard? A data hazard is a type of hazard in pipelining that occurs when a pipeline stage requires data that is produced by a previous pipeline stage that has not yet completed. What is a structural hazard? A structural hazard is a type of hazard in pipelining that occurs when two or more pipeline stages require the same hardware resource, and the resource cannot be used by all of the stages simultaneously. What is a control hazard? A control hazard is a type of hazard in pipelining that occurs when the pipeline needs to make a decision based on a conditional branch instruction that has not yet been resolved. What is pipeline latency? Pipeline latency is the amount of time required to complete a single instruction in a pipelined processor. What is pipeline throughput? Pipeline throughput is the rate at which instructions are completed by a pipelined processor. How can data hazards be resolved in pipelining? Data hazards can be resolved in pipelining by forwarding data between pipeline stages or by inserting pipeline stalls. How can structural hazards be resolved in pipelining? Structural hazards can be resolved in pipelining by adding additional resources or by redesigning the pipeline. How can control hazards be resolved in pipelining? Control hazards can be resolved in pipelining by using branch prediction. What is dynamic scheduling in pipelining? Dynamic scheduling is a technique in pipelining where the hardware dynamically schedules instructions based on their availability, rather than following a fixed sequence of instructions.