Question: ` ` ` 1 . LW $t 0 , 0 ( $s 0 ) ; load a [ 0 ] 2 . ADDI $s 1

```
1. LW $t0,0($s0) ; load a[0]
2. ADDI $s1, zero, 5 ; $s1=5
3. ADDI $s0, $s0,4 ; increment memory address
4. LOOP: ADDI $t1, $t0,0 ; a[i]= a[i-1]
5. BEQ $t2, $s3, JMARK ; Branch b1
; if $t2==2 goto JMARK
6. ADDI $t1, $t1,1 ; a[i]=a[i]+1
7. JMARK: SW $t1,0($s0) ; store a[i]
8. ADDI $t2, $t2,1 ; increment loop counter
9. ADDI $s0, $s0,4 ; increment memory address
10. ADDI $t0, $t1,0 ; a[i-1]= a[i]
11. BNEQ $t1, $s1, Loop ; Branch b2
; if $t1!= $s1 goto Loop
```
Question 1
Find all true data dependencies, output dependencies, and anti-dependencies in the code segment that the register t1 is involved in. Note: please execute the loop only once (i.e. you do not have to track loop dependencies across the different iterations).
answer format
True Data Dependencies (Read after Write)
Instr. i on Instr. j on Register x
Anti Dependencies (Write after Read)
Output Dependencies (Write after write):
` ` ` 1 . LW $t 0 , 0 ( $s 0 ) ; load a [ 0 ] 2 .

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!