edited by
15,865 views
46 votes
46 votes

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.
$$\begin{array}{ll} \text{ADD} & \text{R5, R0, R1} && \text{; R5 ← R0 + R1} \\  \text{MUL} & \text{R6, R2, R5} && \text{; R6 ← R2 * R5} \\   \text{SUB} & \text{R5, R3, R6} && \text{; R5 ← R3 - R6} \\  \text{DIV} & \text{R6, R5, R4} && \text{; R6 ← R5/R4} \\ \text{STORE} & \text{R6, X} && \text{; X  ← R6} \\ \end{array}$$
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,

  1. $2, 2, 4$
  2. $3, 2, 3$
  3. $4, 2, 2$
  4. $3, 3, 2$
edited by

2 Answers

Best answer
53 votes
53 votes

(C) is the correct option for this question:

RAW

  1. I1 - I2 (R5)
  2. I2 - I3 (R6)
  3. I3 - I4 (R5)
  4. I4 - I5 (R6)


WAR 

  1. I2 - I3 (R5)
  2. I3 - I4 (R6)


WAW

  1. I1 - I3 (R5)
  2. I2 - I4 (R6)
edited by
Answer:

Related questions

18.1k
views
5 answers
45 votes
Ishrat Jahan asked Nov 1, 2014
18,074 views
A pipelined processor uses a 4-stage instruction pipeline with the following stages: Instruction fetch (IF), Instruction decode (ID), Execute (EX) and Writeback ... $12$14$16$
7.4k
views
2 answers
27 votes
Ishrat Jahan asked Oct 31, 2014
7,425 views
A computer system has a level-$1$ instruction cache ($1$-cache), a level-$1$ data cache ($D$-cache) and a level-$2$ cache ($L2$-cache) with the following specifications:\begin{array}{ ... $1$ K x $18$-bit, $512$ x $18$-bit, $1$ K x $18$-bit
12.3k
views
2 answers
42 votes
Ishrat Jahan asked Oct 31, 2014
12,259 views
A cache line is $64$ bytes. The main memory has latency $32$ $ns$ and bandwidth $1$ $GBytes/s$. The time required to fetch the entire cache line from the main memory is:$32$ $ns$64$ $ns$96$ $ns$128$ $ns$
10.3k
views
3 answers
47 votes
Ishrat Jahan asked Oct 31, 2014
10,338 views
The data path shown in the figure computes the number of $1s$ in the $32-bit$ input word corresponding to an unsigned even integer stored in the shift register.The unsigned counter, ... $5, 32, 010$5, 31, 011$5, 31, 010$