In: Electrical Engineering
Find the data hazards in the following code segment
lw $t1,0($t1)
addi $t1,$t1,100
or $t2,$t3,$t1
add $a0,$a1,$t2
ori $a0,$a0,42
add $t5,$a0,$t2
Reorder the following code segment to remove the data hazards. Assume that data forwarding takes place:
lw $t0,24($a0)
sub $t4,$t4,$t0
sub $t8,$t8,$t3
add $t6,$t6,$t5
mul $t7,$t7,$t1
What is the CPI for the reordered sequence of instructions in the preceding problem?