Question: ) (a) Fig. 1 shows a C-code snippet in a machine learning algorithm. while (weights[j] == k) { j += 1; } Fig. 1. C

) (a) Fig. 1 shows a C-code snippet in a machine learning algorithm. while (weights[j] == k) { j += 1; } Fig. 1. C Function Write the MIPS assembly with comments for Fig. 1. where j and k are stored in $to, $t1 and the base address to the array weights is stored in $50. (b) When implementing the machine learning algorithm, there are further assembly codes as shown in Fig. 2. Block 1: addiu SW move $sp,$sp, -8 $fp, 4($sp) $fp,$sp $t4,8($fp) $t5, 12($fp) $t6,16($fp) SW SW SW Block 2: move lw addiu j nop $sp,$fp $fp, 4($sp) $sp,$sp, 8 $31 Fig. 2. Supporting Assembly Codes In a few sentences, explain what each code blocks does and why
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
