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)
a The corresponding C code for Code 1 would look like int temp ... 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
-
A compound containing only carbon, hydrogen, and oxygen is analyzed using combustion analysis. When 0.501 g of the compound is burned, 1.001 g of carbon dioxide and 0.410 g of water are collected....
-
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...
-
Draw a diagram showing the phases and turning points of a business cycle. Using the diagram, illustrate the concepts of recurrence and persistence.
-
To better understand the need for the three-handshake connection establishment, let us go through a scenario. Alice and Bob have no access to telephones or the Internet (think about the old days) to...
-
Go to a retail business, such as a bookstore, clothing shop, gift shop, grocery, hardware store, or car dealership in your local shopping area or a shopping mall. Ask to speak to someone who is...
-
Fox, Dodge, and Gilbey agreed to become limited partners in Palatine Ventures, a limited partnership. In a signed writing each agreed to contribute $20,000. Foxs contribution consisted entirely of...
-
3 ) A business owner leases a space to open a restaurant and installs ovens, booths, counters, and other equipment. When would these items become real property?
-
For this last project, you must implement two Java classes. One will be a "Player'' class, which will "simulate" a game player profile, and the other will be a -driver program which allows two...
-
Balcom Enterprises is planning to introduce a new product that will sell for $140 a unit. Manufacturing cost estimates for 30,000 units for the first year of production are: Direct materials...
-
Price a 90 day 100 strike Bermudian option with 15 day early exercise periods. Assume r = 1 % and = 20 %. Use the binomial tree solution method. Plot the price of the option versus originating stock...
-
Lally, Inc., produces universal remote controls. Lally uses a JIT costing system. One of the companys products has a standard direct materials cost of \($7\) per unit and a standard conversion cost...
-
Do a search for a sample pleading format and see if you can find one for California.
-
Determining the limitations of the constitutional doctrine of due process has been a difficult issue to resolve. Use the Internet to research specific California cases in which a court considered...
-
Visit the California State Bar Fee Arbitration Department website at www.calbar.ca.gov/Attorneys/MemberServices/FeeArbitration.aspx and familiarize yourself with the California fee arbitration...
-
EXERCISE 2: Straight-Line Depreciation: Complete the following problem. Lucianno's Pizza used cash to purchase a car on January 1" to be used in delivering pizzas. The car cost $14,000. It will be...
-
Discrete sample spaces: suppose there are N cable cars in San Francisco, numbered sequentially from 1 to N. You see a cable car at random; it is numbered 203. You wish to estimate N. (See Goodman,...
-
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?
-
Estimation error and sample size A random sample of 36 cartons of detergent has a mean of 32.40 oz. and a standard deviation of 2.3 oz. The contents of the cartons are normally distrib- uted....
-
Systematic sampling Refer to the data on the production of calculators in Ex. 22-5. Ex. 22-5 Selecting a random sample Dipple Company produces scientific printing calculators using an assembly line...
-
Use of mean and standard deviation The Oyster Pearl Restaurant is popular with sea- food fanciers who like its large variety of oyster dishes. The oysters are a high-profit item but sales fluctuate...
Study smarter with the SolutionInn App