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

 (a) Fig. 1 shows a C-code snippet in a machine learning

(a) Fig. 1 shows a C-code snippet in a machine learning algorithm. k) { while (weights[j] j + 1; } Fig. 1. C Function Write the MIPS assembly with comments for Fig. 1. whereand k are stored in Ste, $ti and the base address to the array weights is stored in $se. [15%) (b) When implementing the machine learning algorithm, there are further assembly codes as shown in Fig. 2. Block 1: addiu SW move SW $sp,$sp, -8 Sfp, 4($sp) Sfp,$sp $t4,8($fp) St5, 12(5fp) St6,16($fp) SW SW Block 2: nove lw $sp, Sfp Sfp, 4($sp) $sp,$sp,8 $31 addiu 3 nop Fig. 2. Supporting Assembly Codes In a few sentences, explain what each code blocks does and why. (10%) (c) In 150 words, describe what the ALU calculates for R and I type instructions and discuss using two examples what occurs in the MIPS pipeline when instructions take multiple cycles. [25%] (d) Consider a CPU with a byte-addressable main memory of 2 bytes and a block size of 4 bytes. Assume that a direct mapped cache consisting of 64 lines is used with this CPU

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 Databases Questions!