GATE / CS ARCHIVE

GATE CSE 2015 SET 3 / QUESTION 49

GATE CSE 2015 Set 3 Q49

Computer Organization & Architecture · Pipelining & Hazards · Full GATE CSE 2015 Set 3 paper

GATE 2015 Set 3, Q49 2 marks · MCQ
Report issue

Pipelining & Hazards

Question 49, GATE 2015: Instructions have form OP Ri,Rj,Rk, which reads Rj,Rk and writes Ri. The sequence is I1: ADD R1,R2,R3; I2: MUL R7,R1,R3; I3: SUB R4,R1,R5; I4: ADD R3,R2,R4; I5: MUL R7,R8,R9. Consider S1: I2 and I5 have an anti-dependence; S2: I2 and I4 have an anti-dependence; S3: in a pipeline, an anti-dependence always causes at least one stall. Options: (A) S1 only; (B) S2 only; (C) S1 and S3 only; (D) S2 and S3 only.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

1. I2 reads R3 and I4 later writes R3, a write-after-read anti-dependence, so S2 holds.

2. I2 and I5 both write R7, an output dependence rather than anti-dependence. In-order reads/writes or register renaming can avoid stalls for anti-dependences, so S3 is false. Thus only S2, B.

Original paper, page 70 · Answer key