Last Updated : 19 Nov, 2018

For a pipelined CPU with a single ALU, consider the following situations

1. The j + 1-st instruction uses the result of the j-th instruction
    as an operand
2. The execution of a conditional jump instruction
3. The j-th and j + 1-st instructions require the ALU at the same 
   time

Which of the above can cause a hazard ?
(A) 1 and 2 only
(B) 2 and 3 only
(C) 3 only
(D) All of above


Answer: (D)

Explanation: Case 1: Is of data dependency .this can’t be safe with single ALU so read after write.

Case 2:Conditional jumps are always hazardous they create conditional dependency in pipeline.

Case 3:This is write after read problem or concurrency dependency so hazardous

All the three are hazardous

So (D) is correct option.

Quiz of this Question


Share your thoughts in the comments