Q2) You are tasked to calculate a specific algebraic expansion, i.e. compute the value of f...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Q2) You are tasked to calculate a specific algebraic expansion, i.e. compute the value of f for the expression. This is similar to Project 1 Part A, but this time with floating point numbers. f = (0.1xAXB) + (0.3xC) - (0.4×D) Write MIPS assembly code that accepts four positive integers A, B, C, and D as input parameters. The code shall execute in MARS to prompt the user to enter four positive integers represented in decimal, each separated by the Enter key. The program shall calculate and output f as a floating-point number, using syscall for output. HINT: For multiplying the integers A and B. you may use your own self-written multiplication loops. Then convert AxB, C, and D from the integer data format to Floating Point Data Format using appropriate instructions, and afterwards use mul.s & add.s/sub.s instructions to calculate per the algebraic expression given. Sample output for Part B is: Enter 4 integers for A, B, C, D respectively: 15 9 21 3 f = 18.6 The submitted program shall provide outputs in exactly the sequence and format shown above. To receive full credit, no additional superfluous outputs shall occur. Q2) You are tasked to calculate a specific algebraic expansion, i.e. compute the value of f for the expression. This is similar to Project 1 Part A, but this time with floating point numbers. f = (0.1xAXB) + (0.3xC) - (0.4×D) Write MIPS assembly code that accepts four positive integers A, B, C, and D as input parameters. The code shall execute in MARS to prompt the user to enter four positive integers represented in decimal, each separated by the Enter key. The program shall calculate and output f as a floating-point number, using syscall for output. HINT: For multiplying the integers A and B. you may use your own self-written multiplication loops. Then convert AxB, C, and D from the integer data format to Floating Point Data Format using appropriate instructions, and afterwards use mul.s & add.s/sub.s instructions to calculate per the algebraic expression given. Sample output for Part B is: Enter 4 integers for A, B, C, D respectively: 15 9 21 3 f = 18.6 The submitted program shall provide outputs in exactly the sequence and format shown above. To receive full credit, no additional superfluous outputs shall occur.
Expert Answer:
Answer rating: 100% (QA)
The question appears to be a programming assignment that requires writing MIPS assembly code to compute a specific algebraic expression using floating... View the full answer
Related Book For
Financial Reporting Financial Statement Analysis and Valuation a strategic perspective
ISBN: 978-1337614689
9th edition
Authors: James M. Wahlen, Stephen P. Baginski, Mark Bradshaw
Posted Date:
Students also viewed these programming questions
-
How do anthropogenic perturbations, such as habitat fragmentation and climate change, disrupt trophic interactions and cascading effects within intricate biodiversity networks ? Explain
-
12. Bill thinks that welfare is needed in some cases. However, his friends in the Young Republicans taunt him every time he makes his views known. As a result, he accepts their views in order to...
-
Is it scattering or reflection that accounts for the whiteness of a cloud?
-
The velocity field for a line source in the r-plane (Fig. P444) is given by where m is the line source strength. For the case with m/(2) = 1.5 m 2 /s, plot a contour plot of velocity magnitude...
-
Define a compound machine.
-
Presto Corp. had total variable costs of $180,000, total fixed costs of $110,000, and total revenues of $300,000. Compute the required sales in dollars to break even.
-
Henrich is a single taxpayer. In 2023, his taxable income is $535,500. What are his income tax and net investment income tax liability in each of the following alternative scenarios? Use Tax Rate...
-
write a closed-research legal memo using the case cases given, addressing whether Mr. Adler can assert an adverse possession claim to Scrub Lot 40. Please write up your memo using the issue , brief...
-
Write a paper on Ethical dilemmas in the business environment
-
The South African growing energy demand and load shedding has triggered the issue of energy security. The recent approval by the cabinet of 100 MW electricity production for independent suppliers has...
-
For the reaction 2HI(g) H(g) +12(g), it was found that the rate of HI to be R = 5.0 10 mmolHI -1 HI *I**s* what is (a) the average rate of formation of H in the same reaction and (b) the unique...
-
Consider the Norman window shown below. (Assume a 4 ft, b = 7 ft.) I b a (a) Find the area. (Round the answer to one decimal place.) A = ft (b) Find the perimeter. (Round the answer to one decimal...
-
An image was exposed using 60 kVp @ 5 mAs. If a repeat is taken using 20mAs with the same kVp and using a 2m SID. What original distance was used if the repeat image maintained the same exposure at...
-
In a city water-filtration plant, it was desired to filter 5000 gal of water per hour through a sand filter bed to remove all the suspended matter and solids from the water. A vertical...
-
The following transactions are related to Gold Corp equity in 2020: Jan 5 Sold for cash 1,000 convertible bonds, 3 years, par $1,000 per share at $ 1,000,000. Present value bonds (without conversion...
-
2. Assume a person bends forward to lift a load "with his back" as shown in Figure P12.42a. The person's spine piv- ots mainly at the fifth lumbar vertebra, with the principal supporting force...
-
Financial accounting rules require firms to assess whether they will recover carrying amounts of long-lived assets and, if not, to write down the assets to their fair value and recognize an...
-
Explain reverse-engineering of share prices in conceptual terms. How does reverse-engineering of share prices enable an analyst to infer (or deduce) the assumptions that the capital markets appear to...
-
Floral Delivery, Inc. (FD) acquired a fleet of vans on January 1, 2013, by issuing a $500,000, 4-year, 4% fixed rate note, with interest payable annually on December 3. FD has the option to repay the...
-
Wallace and Hussain type estimators for the variance components of a one-way unbalanced panel data model. (a) Verify the \(E\left(\widehat{q}_{1} ight)\) and \(E\left(\widehat{q}_{2} ight)\)...
-
Consider the following unbalanced one-way analysis of variance model \[y_{i t}=\mu_{i}+u_{i t} \quad i=1, \ldots, N \quad t=1,2, \ldots, T_{i}\] where for simplicity's sake no explanatory variables...
-
Consider the three-way error component model described in problem 3.15. The panel data can be unbalanced and the matrices of dummy variables are \(\Delta=\left[\Delta_{1}, \Delta_{2}, \Delta_{3}...
Study smarter with the SolutionInn App