4. Assume the following two MIPS codes are given to you. Answer the following questions based...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
4. Assume the following two MIPS codes are given to you. Answer the following questions based on the assumptions that values of 10, 20, 30, and 40 are assigned to registers $30, $s1, $s2, $s3, and $s4 respectively. Assume that the base address of the array B is in registers $s6 and has the value of 256. Code 1: add $30, $s0, $sl add $s0, $s3, $s2 add $50, $s1, $s3 You're also given the following memory allocation with saved values: 0 ... Code 2: addi $36, $s6, -20 add $s6, $s6, $sl lw $50, 8 ($s6) 10 35 12 43 18 256 .. a. For the given MIPS instructions above, what are the corresponding C codes? c. b. For each code given above, find the value saved in register $80 at the end of execution. Comment on the performance of the compiler based on the corresponding MIPS code output. Should you continue to use the same compiler for your other programs? Or should you look for another one? Why? Explain your answer in detail. 4. Assume the following two MIPS codes are given to you. Answer the following questions based on the assumptions that values of 10, 20, 30, and 40 are assigned to registers $30, $s1, $s2, $s3, and $s4 respectively. Assume that the base address of the array B is in registers $s6 and has the value of 256. Code 1: add $30, $s0, $sl add $s0, $s3, $s2 add $50, $s1, $s3 You're also given the following memory allocation with saved values: 0 ... Code 2: addi $36, $s6, -20 add $s6, $s6, $sl lw $50, 8 ($s6) 10 35 12 43 18 256 .. a. For the given MIPS instructions above, what are the corresponding C codes? c. b. For each code given above, find the value saved in register $80 at the end of execution. Comment on the performance of the compiler based on the corresponding MIPS code output. Should you continue to use the same compiler for your other programs? Or should you look for another one? Why? Explain your answer in detail.
Expert Answer:
Answer rating: 100% (QA)
The provided image contains MIPS assembly instructions and related questions Lets tackle each of the questions one by one a Corresponding C codes for the given MIPS instructions For Code 1 s0 s1 C equ... View the full answer
Related Book For
Fundamentals Of Financial Management
ISBN: 9780273713630
13th Revised Edition
Authors: James Van Horne, John Wachowicz
Posted Date:
Students also viewed these programming questions
-
answer the question clearly You are building a flight-control system for which a convincing safety case must be made. Would you assign the tasks of safety requirements engineering, test case...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
Write Python program which implements the following two classical cryptosystem a) Affine Cipher b) Vigenere Cipher Your program should consist of at least five functions: a) Two functions named...
-
The U.S. Supreme Court allows "reverse discrimination."
-
The D. Dorner Farms Corporation is considering purchasing one of two fertilizer- herbicides for the upcoming year. The more expensive of the two is better and will produce a higher yield. Assume...
-
Which of the following forms is used to complete and file an individual tax return? a. Form 1120 b. Form 1040 c. Form 1065 d. Form 709
-
So Sweet! has budgeted sales of 600,000 cans of diet iced tea mix during June 2010 and 750,000 cans during July. Production of the mix requires 14.5 ounces of tea and 1.5 ounces of sugar substitute....
-
ALGORITHM Brute ForceClosest Pair(P) //Finds distance between two closest points in the plane by brute force //Input: A list P of n (n 2) points p(x1, y),..., Pn(xn, yn) //Output: The distance...
-
Cherry Cotta makes custom ordered clay pots for residential gardens. Below is cost information regarding its latest job. a. Materials were purchased on account. $18,996 purchased b. A materials...
-
eCampus: Home Bb Content McGraw-Hill Connect Wk 4 - Practice: Wk 4 E) X A https://newconnect.mheducation.com/flow/connect.html ... Wk 4 - Practice: Wk 4 Exercises [due Sat] i Submit Saved Help Save &...
-
A pure discount bond costs $990,000 today and pays $1,000,000 in 3 months. a) What is the annualized continuously compounded interest rate? b) What is the effective annual rate?
-
Please create an Array Stack method that implements the Stack method given Create the generic ArrayStack that implements the provided Stack interface using an array. 2. Create a driver class called...
-
Fair Weather Airlines has a peculiar rule about luggage. It will accept only bags for which the sum of the length and width w is at most 30 inches, while the sum of length /, height h, and twice the...
-
continue working on the program about a loop and a sum calculation. Only now your loop should be in a separate method, this method should take a parameter, a number that you enter from the keyboard....
-
How did the stock market assess Philip Morris's $90 per share bid for Kraft? Your analysis needs to be very thorough: stock prices tell many stories. Find what they are.
-
The active element of a certain laser is made of a glass rod 30.0 cm long and 1.50 cm in diameter. Assume the average coefficient of linear expansion of the glass is equal to 9.00 x 10 (C)'. If the...
-
Kims Konstructions has assembled the following data for a proposed straw-reinforced brick maker (SRBM): SRBM Cost: $26,000 Life: 5 years Revenue (p.a.) $11,000 Operating Expenses (p.a.) $3,000...
-
How does a financial lease differ from an operating lease? How does a full-service (or maintenance) lease differ from a net lease7.
-
What is the purpose of establishing a line of credit for an account? What are the benefits of this arrangement?
-
Suppose that a firm elected to tighten its trade credit policy from "2/10, net 90" to "2/10, net 30." What effect could the firm expect this change to have on its liquidity?
-
A beam problem under the pure bending moment is solved using five rectangular finite elements, as shown in the figure. Assume \(E=200 \mathrm{GPa}\) and \(v=0.3\) are used. The thickness of the beam...
-
A study of 16,405 adult daughters of women who immigrated to California from other countries measured the economic status of the daughters by the median household income Y for the ZIP code they lived...
-
Explain why you either agree or disagree with this interpretation of the results from estimating a regression model: This study concludes that the data are statistically substantial because there are...
Study smarter with the SolutionInn App