CO-Pipelining-Q12

0 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 6 days ago in Computer Organization by gbmentor (6,810 points)
reshown 6 days ago by gbmentor

2 Answers

0 votes
 
Best answer

so data dependency = 5

answered 5 days ago by 23rishiyadavpro20 (3,940 points)
selected 5 days ago 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 5 days ago by tsnikhilsharmagate2018 (5,940 points)
R1 - in (i1,i2)
R2 - in (i2,i3)
R3 - in (i3,i5)
R4 - in (i4,i5),(i3,i4)
Answer:
...