Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

GATE | GATE IT 2006 | Question 78

  • Last Updated : 11 Sep, 2020

A pipelined processor uses a 4-stage instruction pipeline with the following stages: Instruction fetch (IF), Instruction decode (ID), Execute (EX) and Writeback (WB). The arithmetic operations as well as the load and store operations are carried out in the EX stage. The sequence of instructions corresponding to the statement X = (S – R * (P + Q))/T is given below. The values of variables P, Q, R, S and T are available in the registers R0, R1, R2, R3 and R4 respectively, before the execution of the instruction sequence.


The number of Read-After-Write (RAW) dependencies, Write-After-Read( WAR) dependencies, and Write-After-Write (WAW) dependencies in the sequence of instructions are, respectively,
(A) 2, 2, 4
(B) 3, 2, 3
(C) 4 ,2, 2
(D) 3 ,3, 2

Answer: (C)

Explanation: Read After Write :

1. ADD -> MUL (R5)
2. MUL -> SUB (R6)
3. SUB -> DIV (R5)
4. DIV -> STORE (R6) 

Write After Read :

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

1. MUL -> SUB (R5)
2. DIV -> STORE (R6) 

Write After Write :

1. ADD -> SUB (R5)
2. MUL – DIV (R6) 

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :