in CO and Architecture
3,939 views
2 votes
2 votes
Consider the following instructions.
I​ 1​ : R​ 1​ = 100
I​ 2​ : R​ 1​ = R​ 2​ + R​ 4
I​ 3​ : R​ 2​ = R​ 4​ + 25
I​ 4​ : R​ 4​ = R​ 1​ + R​ 3
I​ 5​ : R​ 1​ = R​ 1​ + 30
Calculate sum of (WAR, RAW and WAW) dependencies the above instructions.

(a) 10
(c) 6
(b) 12
(d) 8
in CO and Architecture
3.9k views

4 Comments

I have found this concept of adjacency very bizarre. Draw a pipelined instruction flow for the given instruction. You will find out that I2-I4 is a hazard because the data will of I2 will not be present in I4....it should be at least 3 instructions away .. which is why I2-I5 is not a hazard
0
0
7

Raw 2

War 3

Waw 2
2
2
8 Should be the Correct answer

given 5 instructions no of pairing's possible is 10 and clearly when you pair up (I1,I3) or (I3,I5) there will be no dependency.
0
0

3 Answers

1 vote
1 vote

 

L1: R1 = 100

L2: R1 = R2 + R4

L3: R2 = R4 - 25

L4: R4 = R1 + R3

L5: R1 = R1 + 30

 

RAW WAR WAW
L2 – L4 L2 – L3 L1-L2
L2 – L5 L2 -  L4 L2-L5
L1 – L4 L3 -  L4 L1-L5
L1 – L5 L4 – L5  

SUM = 11

Question 16.4. Computer Organization and Architecture Designing for Performance Tenth Edition William Stallings 

0 votes
0 votes
waw -2

war-4

raw -2

this should be answer
0 votes
0 votes
WAR = 4

RAW = 2

WAW = 2

so  d option is the correct answer for this.

Related questions