Pipeline Processor · Computer Organization and Architecture
53 questions · asked in 25 of 27 years (2000–2026)
MCQ 29 · MSQ 2 · NAT 221-mark 23 · 2-mark 30
2000Questions per year2026
Questions 51–53 of 53
For a pipelined CPU with a single ALU, consider the following situations
1. The (j + 1)-th instruction uses the result of 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?
1. The (j + 1)-th instruction uses the result of 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?
Answer: (D)
A hazard is a situation that can stop the next instruction from going ahead in the next cycle.
1. The (j + 1)-th instruction uses the result of the j-th: this is a data hazard (RAW), since the result may not be ready yet.
2. A conditional jump: this is a control hazard, since the next instruction to fetch is not known until the jump is resolved.
3. Both instructions need the ALU in the same cycle: this is a structural hazard, since there is only one ALU.
All three can cause a hazard.
Answer: (D)
1. The (j + 1)-th instruction uses the result of the j-th: this is a data hazard (RAW), since the result may not be ready yet.
2. A conditional jump: this is a control hazard, since the next instruction to fetch is not known until the jump is resolved.
3. Both instructions need the ALU in the same cycle: this is a structural hazard, since there is only one ALU.
All three can cause a hazard.
Answer: (D)
The performance of a pipelined processor suffers if
Answer: (D)
A pipeline gives its best speed-up only when every stage takes the same time and every instruction can enter the next stage each clock. Each option breaks this.
(A) All stages share one clock, so the clock period must fit the slowest stage (plus the pipeline register delay). Faster stages sit idle for part of each cycle, so the gain is less than the ideal.
(B) If an instruction needs a result that the previous instruction has not produced yet (a data dependence), the pipeline must stall. Forwarding removes many of these stalls, but not all: an instruction that uses a loaded value in the very next cycle still waits.
(C) If two stages need the same hardware in the same cycle (a structural hazard), one must wait. For example, IF and MEM both need a single memory port, so a load or store in MEM blocks the instruction fetch.
All three reduce performance.
Answer: (D)
(A) All stages share one clock, so the clock period must fit the slowest stage (plus the pipeline register delay). Faster stages sit idle for part of each cycle, so the gain is less than the ideal.
(B) If an instruction needs a result that the previous instruction has not produced yet (a data dependence), the pipeline must stall. Forwarding removes many of these stalls, but not all: an instruction that uses a loaded value in the very next cycle still waits.
(C) If two stages need the same hardware in the same cycle (a structural hazard), one must wait. For example, IF and MEM both need a single memory port, so a load or store in MEM blocks the instruction fetch.
All three reduce performance.
Answer: (D)
Comparing the time T1 taken for a single instruction on a pipelined CPU with time T2 taken on a non-pipelined but identical CPU, we can say that
Answer: (B)
Here we compare the time for one instruction from start to end (its latency).
Let a CPU have stages with delays .
(non-pipelined).
(pipelined), since the clock must fit the slowest stage plus the latch delay, and the instruction passes through all stages.
The sum of the stage delays is at most , so . They are equal only when all stages are equal and the latch delay is zero. Pipelining does not make one instruction faster. It gives a gain because a new instruction finishes every clock.
So (A) and (C) are wrong. (D) is wrong too: the extra time comes from the latch delays and the unequal stage delays, not from one extra instruction fetch cycle.
Answer: (B)
Let a CPU have stages with delays .
(non-pipelined).
(pipelined), since the clock must fit the slowest stage plus the latch delay, and the instruction passes through all stages.
The sum of the stage delays is at most , so . They are equal only when all stages are equal and the latch delay is zero. Pipelining does not make one instruction faster. It gives a gain because a new instruction finishes every clock.
So (A) and (C) are wrong. (D) is wrong too: the extra time comes from the latch delays and the unequal stage delays, not from one extra instruction fetch cycle.
Answer: (B)
Keep practising