Complete the code to identify the type of hazard caused by data dependency.
if instruction1 writes to register and instruction2 reads from the same register, this is a [1] hazard.
This is a data hazard because one instruction depends on the result of another.
Complete the sentence to explain a pipeline stall cause.
A pipeline stall occurs when the processor must wait because of a [1] hazard.Pipeline stalls often happen due to data hazards where data is not yet ready.
Fix the error in the statement about control hazards.
A control hazard happens when the pipeline must wait for the [1] to be resolved before continuing.
Control hazards occur because the processor waits for the branch decision to know which instruction to fetch next.
Fill both blanks to complete the explanation of structural hazards.
A structural hazard occurs when [1] resources are needed by multiple instructions and the pipeline [2].
Structural hazards happen when hardware resources are insufficient, causing the pipeline to stall.
Fill all three blanks to complete the dictionary comprehension that filters instructions causing hazards.
hazard_instructions = {instr[1] instr_list if 'hazard'[2] instr and instr['type'] [3] 'data'}This comprehension loops over instructions, selects those with 'hazard' in them, and filters for data hazards.
