Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following C-code fragment: for (i=0; i z[i] = a[i] - b[i]; Assume that - a, b, and z are arrays of 32-bit words.

Consider the following C-code fragment:

for (i=0; i

z[i] = a[i] - b[i];

Assume that - a, b, and z are arrays of 32-bit words. The machine code for this fragment is stored in memory starting from location 00000100 Hex.

a- Convert this code to MIPS. You must provide the numeric offset for each branch or jump instruction that you use. (50 points)

b- Assume that the CPIs for MIPS instructions on a multi-cycle system M1 are as listed below:

lw : 5 cycles

R-type, addi, sw, and other immediate Arithmetic instruction : 4 Cycles

beq, bne, and j: 3 cycles

other instructions: 4 cycles

How many clock cycles does it take to execute the C-code fragment on system M1? Justify your answer (20 points)

c- Assume that the clock rate for M1 is 2.5 GHz. What is the CPU execution time for the code on M1? (10 points)

d- Compute CPU execution time of the code for a single-cycle system with clock rate 1.6 Ghz (20 points)

image text in transcribed

Consider the following C-code fragment: for (i-0; i

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

Step: 3

blur-text-image

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

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions

Question

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

Answered: 1 week ago