Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

EUIFSPRING-2018/Homework The following problems deal with translating from C to MIPS. Assume that the variables g, h, i, and j are assigned to registers Ss0,

image text in transcribed

EUIFSPRING-2018/Homework The following problems deal with translating from C to MIPS. Assume that the variables g, h, i, and j are assigned to registers Ss0, Ssl, S$2. $s3, and SsA, respectively. Assume that the base address of the arrays A and B are in registers Ss6 and $s7 respectively a. f=-g+ h+ B[4]; 1. Provide the MIPS assembly code for the above C statements. Use a minimal number of MIPS assembly instructions 2 For the C statements above, how many MIPS assembly instructions are needed to perform the 3. Using WeMips online emulator, execute your MIPS code and provide screen shots of your outputs. (10 pts) The following problems deal with translating from MIPS to C. Assume that the variables g, h.i and j are assigned to registers Ss0, Ss1, Ss2, Ss3, and Ss4, respectively. Assume that the base address of the arrays A and B are in registers Ss6 and Ss7 respectively a) add Ss0, Ss0, Ss2 add Ss0, Ss0 Ss3 add Ss0, $s0, Ss4 a For the MIPS assembly instructions above. what is the corresponding C statement? b. For the MIPS assembly instructions above, rewrite the assembly code to minimize the number of MIPS instructions tif possible) needed to carry out the same function How many registers are needed to carry out the MIPSs assembly as wrtten above? If you could rewrite the code above, what is the minimal number of registers needed

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

Spatial Database Systems Design Implementation And Project Management

Authors: Albert K.W. Yeung, G. Brent Hall

1st Edition

1402053932, 978-1402053931

More Books

Students also viewed these Databases questions