Question
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)
Consider the following C-code fragment: for (i-0; i
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started