171k views
2 votes
Given the following MIPS Code Fragment:

L_1: add $s1, $s1, $s2
L_2: sub $s2, $s1, $s1

List all the hazards (type, Line Number [e.g., L_1], and why it is a hazard ... for example you could write "Data Hazard: L_1 RAW from $s4 to $v0", if that applied...

User Alon Eitan
by
7.0k points

1 Answer

3 votes

Answer:

There are 3 Data Hazard

Step-by-step explanation:

Find attached the solution

Given the following MIPS Code Fragment: L_1: add $s1, $s1, $s2 L_2: sub $s2, $s1, $s-example-1
Given the following MIPS Code Fragment: L_1: add $s1, $s1, $s2 L_2: sub $s2, $s1, $s-example-2
User Dtsn
by
7.3k points