Question: Translate the following loop into assembly language where a and bare Integer arrays whose base addresses are in Sao and sai, respectively. The value of

Translate the following loop into assembly language where a and bare Integer arrays whose base addresses are in Sao and sai, respectively. The value of nisin Saz, and is in 533 add $23, se Se Label: sil add add Iw $t1, $a3, 2 sti, ne, sta $t2, Sal, St1 $s2, 0 (52) $s2, esti) $a3, $a, 1 ste, $a, 100 Sto, se, Labels addi siti hne Label2: sll add add $ti, H, 2 sti, Sae, Sti St2, Sal, St1 $53,-4(51) Ss4, (301) est2) St3, 3), $34 St4, $t3, 555 Iw add add addi siti bne St4, e(s) Sa3, Sal, 1 ste, a3, $a2 Sto, se, Label 2 a) [10 points Convert the code fragment into Clanguage equivalent b) [10 points Count the total number of instructions executed by all the iterations (including those executed outside the loop) when then is equal to 1000, [10 points Assume that the code is run on a machine with a 1 GHz clock that requires the following number of cycles for each Instruction. How many cycles does it take to execute the above code. Instruction Cycles addi 1 lw, sw 8 add 2 sll, slti 4 bne 3 d) [10 points. Find that how many second required to execute the above code. e) [10 points What is the average CPI for the above code. Translate the following loop into assembly language where a and bare Integer arrays whose base addresses are in Sao and sai, respectively. The value of nisin Saz, and is in 533 add $23, se Se Label: sil add add Iw $t1, $a3, 2 sti, ne, sta $t2, Sal, St1 $s2, 0 (52) $s2, esti) $a3, $a, 1 ste, $a, 100 Sto, se, Labels addi siti hne Label2: sll add add $ti, H, 2 sti, Sae, Sti St2, Sal, St1 $53,-4(51) Ss4, (301) est2) St3, 3), $34 St4, $t3, 555 Iw add add addi siti bne St4, e(s) Sa3, Sal, 1 ste, a3, $a2 Sto, se, Label 2 a) [10 points Convert the code fragment into Clanguage equivalent b) [10 points Count the total number of instructions executed by all the iterations (including those executed outside the loop) when then is equal to 1000, [10 points Assume that the code is run on a machine with a 1 GHz clock that requires the following number of cycles for each Instruction. How many cycles does it take to execute the above code. Instruction Cycles addi 1 lw, sw 8 add 2 sll, slti 4 bne 3 d) [10 points. Find that how many second required to execute the above code. e) [10 points What is the average CPI for the above code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
