data array word 5101520253035 text add 4 0 0 add 3 0 0 addi
data array: word 5,10,15,20,25,30,35 text add 4, $0, $0 add 3, $0, $0 addi $20, $0, 4 addi $23, 50, 50 L1 lv $21 array $3 add $4, $4, $21 add $3, $3, $20 slt, $22, 4, $23 beq $22, $0, done 1st branch be $0, $0, L1 2nd branch done beq $4, $4, done 3rd branch 
Solution
a) As there are four iterations in L1 label , hence DMEM is called 4 times.
b) Data after each iteration is:
1st iteration:
$3 = 4
$4= 5
$20 = 4
$21 = 5
$22 = 1
$23 = 50
2nd iteration:
$3 = 8
$4= 15
$20 = 4
$21 = 10
$22 = 1
$23 = 50
3rd iteration:
$3 = 12
$4= 30
$20 = 4
$21 = 15
$22 = 1
$23 = 50
4th and final iteration:
$3 = 16
$4= 50
$20 = 4
$21 = 20
$22 = 0
$23 = 50

