Pipeline dependencies and model assumptions
Pipelining & Hazards

Answer & solution
Official answer: B
Our answer: B in the classic in-order fixed-stage model; WAR/WAW can also be hazards in broader pipeline models.
Givens and goal
Which register dependence can cause a data hazard in a pipelined processor? A read-after-read, B read-after-write, C write-after-read, D write-after-write. The source does not explicitly constrain instruction issue or completion order.
Approach
Explain the true producer-consumer hazard, then state the narrower pipeline model needed to make the official MCQ selection unique.
Step-by-step solution
1. Suppose instruction I1 computes R1=R2+R3 and the following instruction I2 computes R4=R1+1. I2 must read the value produced by I1, so this is a read-after-write (RAW) dependence on R1.
2. If I2 reaches its register-read/use stage before I1’s result is available, it can read the old R1. That is a data hazard. Forwarding or a stall may be needed to preserve the intended computation. Thus B is a genuine hazard category.
3. In the conventional single-issue, in-order, fixed-stage pipeline, reads occur in an earlier fixed stage than writes. A later instruction cannot overtake an earlier read or write. Under those assumptions, WAR and WAW dependencies do not cause hazards, and B is the intended unique answer. RAR is not a hazard because neither instruction changes the shared register.
4. The unrestricted wording is broader. A write-after-read (WAR) hazard can arise if an earlier instruction is delayed before reading R1 and a later instruction overwrites R1 first. A write-after-write (WAW) hazard can arise if a slow earlier instruction and a fast later instruction both write R1, but the earlier write completes last, leaving the wrong final value.
5. Therefore preserve official B for scoring, with the qualification that C and D can also be hazard categories in pipelines permitting the relevant reordering. Register renaming and ordering mechanisms may prevent them, but are not specified.
CS-2026-S1-Q16-PIPELINE-MODEL. This is a model-dependent uniqueness issue, not an official key correction. The published single-answer selection requires the narrower pipeline convention described above.































![Question 77, GATE 2008: A processor has one branch delay slot. Which instruction can be moved into it without other program changes?
I1: ADD R2←R7+R8
I2: SUB R4←R5−R6
I3: ADD R1←R2+R3
I4: STORE Memory[R4]←R1
BRANCH to Label if R1==0
(A) I1
(B) I2
(C) I3
(D) I4](../../../assets/questions/CS-2008-Q77-1.webp)
![Question 77, GATE 2008: A processor has one branch delay slot. Which instruction can be moved into it without other program changes?
I1: ADD R2←R7+R8
I2: SUB R4←R5−R6
I3: ADD R1←R2+R3
I4: STORE Memory[R4]←R1
BRANCH to Label if R1==0
(A) I1
(B) I2
(C) I3
(D) I4](../../../assets/questions/CS-2008-Q77-2.webp)
![Question 77, GATE 2008: A processor has one branch delay slot. Which instruction can be moved into it without other program changes?
I1: ADD R2←R7+R8
I2: SUB R4←R5−R6
I3: ADD R1←R2+R3
I4: STORE Memory[R4]←R1
BRANCH to Label if R1==0
(A) I1
(B) I2
(C) I3
(D) I4](../../../assets/questions/CS-2008-Q77-3.webp)


![Question 68, GATE 2005: Five one-cycle stages IF instruction fetch, RD decode/register read, EX ALU/address, MA data memory (stores use data read in RD), WB register write. Instructions I1:R0←M[loc1], I2:R0←R0+R0, I3:R2←R2−R0. Total cycles from first fetch through final completion? A8; B10; C12; D15. The source does not explicitly state forwarding.](../../../assets/questions/CS-2005-Q68-1.webp)




![Question 8(a), GATE 2002: The circuit takes three-bit inputs A=a₂a₁a₀ and B=b₂b₁b₀ and produces Z=z₃z₂z₁z₀. All registers load simultaneously on falling CLOCK edges; the clock period exceeds every circuit’s settling time. The diagram has R0 (6 bits) holding b₂,a₂,b₁,a₁,b₀,a₀. A full adder takes R0’s b₀,a₀ with carry-in 0. R1 (6 bits) holds the forwarded b₂,a₂,b₁,a₁ and this adder’s carry and sum. A second full adder takes R1’s b₁,a₁ and that stored carry. R2 (5 bits) holds the forwarded b₂,a₂, the second adder’s carry and sum, and the forwarded least-significant sum. A third, unregistered full adder takes R2’s b₂,a₂ and stored carry; its carry and sum are z₃,z₂, while R2’s stored sums directly provide z₁,z₀. Initially R0, R1, R2 are all zero. For clock numbers 1 through 8, A is [110,011,111,101,000,000,000,000] and B is [101,101,011,110,000,000,000,000]. Determine the sequence of eight four-bit output values Z.](../../../assets/questions/CS-2002-Q63-1.webp)
![Question 8(a), GATE 2002: The circuit takes three-bit inputs A=a₂a₁a₀ and B=b₂b₁b₀ and produces Z=z₃z₂z₁z₀. All registers load simultaneously on falling CLOCK edges; the clock period exceeds every circuit’s settling time. The diagram has R0 (6 bits) holding b₂,a₂,b₁,a₁,b₀,a₀. A full adder takes R0’s b₀,a₀ with carry-in 0. R1 (6 bits) holds the forwarded b₂,a₂,b₁,a₁ and this adder’s carry and sum. A second full adder takes R1’s b₁,a₁ and that stored carry. R2 (5 bits) holds the forwarded b₂,a₂, the second adder’s carry and sum, and the forwarded least-significant sum. A third, unregistered full adder takes R2’s b₂,a₂ and stored carry; its carry and sum are z₃,z₂, while R2’s stored sums directly provide z₁,z₀. Initially R0, R1, R2 are all zero. For clock numbers 1 through 8, A is [110,011,111,101,000,000,000,000] and B is [101,101,011,110,000,000,000,000]. Determine the sequence of eight four-bit output values Z.](../../../assets/questions/CS-2002-Q63-2.webp)
![Question 8(a), GATE 2002: The circuit takes three-bit inputs A=a₂a₁a₀ and B=b₂b₁b₀ and produces Z=z₃z₂z₁z₀. All registers load simultaneously on falling CLOCK edges; the clock period exceeds every circuit’s settling time. The diagram has R0 (6 bits) holding b₂,a₂,b₁,a₁,b₀,a₀. A full adder takes R0’s b₀,a₀ with carry-in 0. R1 (6 bits) holds the forwarded b₂,a₂,b₁,a₁ and this adder’s carry and sum. A second full adder takes R1’s b₁,a₁ and that stored carry. R2 (5 bits) holds the forwarded b₂,a₂, the second adder’s carry and sum, and the forwarded least-significant sum. A third, unregistered full adder takes R2’s b₂,a₂ and stored carry; its carry and sum are z₃,z₂, while R2’s stored sums directly provide z₁,z₀. Initially R0, R1, R2 are all zero. For clock numbers 1 through 8, A is [110,011,111,101,000,000,000,000] and B is [101,101,011,110,000,000,000,000]. Determine the sequence of eight four-bit output values Z.](../../../assets/questions/CS-2002-Q63-3.webp)















