Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
(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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago