in CO and Architecture edited by
2,252 views
2 votes
2 votes
Consider the below instructions executed on a 5 stage(IF,ID,EX,MA,WB) RISC pipeline with operand forwarding.

I1: ADD R0,R1,R2 (R0=R1+R2)
I2: SUB R3,R0,R2
I3:MUL R4,R3,R0
I4:DIV R5,R4,R0

How many RAW dependencies?
in CO and Architecture edited by
2.3k views

4 Comments

Does all dependency cause hazard ?

As i came to know that it may be that dependency causes hazard .

"Any condition that causes the pipeline to stall is called a hazard. We have just described
an example of a data hazard," Hamacher

Since here  we are using data forwarding then  total Hazard in this case will be ?
0
0

Smishra95

Total Hazards will be 5

RAW(True)-> 5

WAR(Anti)->0

WAW(output)->0

RAR-> is not an Hazard 

2
2
5 is answer
0
0

1 Answer

5 votes
5 votes
Answer should be 5.

Ro  from   1->2,3,4

R3 from    2->3

R4 from    3 -> 4

4 Comments

is it necessarry that reading of the data is immidiately after write in RAW ?
0
0
not necessarily.... dependency means value is dependent so when it comes later. It can be 1 instruction later or 4 instructions later.
0
0
1. Ro  from   1->2,3,4

2. R3 from    2->3

3. R4 from    3 -> 4
Those are total 3 , how you got 5?

And there is operand forwarding.. so result obtained will be passed to next instruction. will it led to RAW hazard?
0
0
man, there are 3 in first case. How can count them to be 1
0
0