CO-Pipelining-Q12

+2 votes

Consider the code below:

1 ADDI  R1, R1, -8  

2 LOAD  R2, 4(R1)

3 ADD R3, R2, R4

4 LOAD  R4, 8(R1)

5 SUB R5, R3, R4

Following are the pipeline stages: IF, ID, EX, MEM, WB

The number of data dependencies in the code?

(Assume no data forwarding.)

(A) 4

(B) 5

(C) 3

(D) 2

asked Jun 12 in Computer Organization by gbmentor (54,290 points)
reshown Jun 13 by gbmentor

2 Answers

0 votes
 
Best answer

so data dependency = 5

answered Jun 13 by 23rishiyadavpro20 (6,590 points)
selected Jun 13 by getgatebook
Sir ,if 1 instruction writing in register file and and other is reading the data from register file .are these 2 instructions have data dependency?
Sir ,if 1 instruction writing in register file and and other is reading the data from register file .are these 2 instructions have data dependency? Ex - I1 and I4 have data dependency
Yes there should be data dependency because instruction 4 will take that R1 which is written by I1
0 votes
B) 5 data dependency
answered Jun 13 by tsnikhilsharmagate2018 (19,690 points)
R1 - in (i1,i2)
R2 - in (i2,i3)
R3 - in (i3,i5)
R4 - in (i4,i5),(i3,i4)
Answer:
...