Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the following C-code fragment: for (i=0; i<100; i++) a[i] = b[i] - d[i]

ID: 3886193 • Letter: C

Question

Consider the following C-code fragment: for (i=0; i<100; i++) a[i] = b[i] - d[i]; Assume that - a, b, and d 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. (20 points) b- Assume that the CPIs for MIPS instructions are as listed below: a. lw : 5 cycles b. R-type, addi, sw, and other immediate Arithmetic instruction : 4 Cycles c. beq, bne, and j: 3 cycles How many clock cycles does it take to execute the C-code fragment? (15 points) c- Assume that this code is executed by a 1.6 GHz system. What is the cpu execution time for the code? (10 points)

Explanation / Answer

add $50. $50. $51 add $50, $53, $52 add $50, $50. $53 b. addi $56, $56, -20 add $56, $56, $51 lw $50, 8($56)

1010 1101 0001 0000 0000 0000 0000 0010 t l'lo b. 1111 1111 1111 1111 1011 0011 0101 0011 tl'iO

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote