Questions You are advised to load the MIPS assembly program problem1.asm into your simulator to answer...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Questions You are advised to load the MIPS assembly program problem1.asm into your simulator to answer the following questions. # The program .text 1w move sll add SW $50, value $t1, $50 $50, $80, 2 $50, $80, $t1 $50, result a. Using the Single Step operation, execute each instruction one by one, and record the state of the processor with respect to each instruction. O o Prior to executing each instruction, write down the value of the pc (program counter) for the instruction about to be executed in Table 1. each instruction, write down After executing the value of registers $30 and $t1 for the instruction just executed in Table 1. Instruction 1w $50, value move $t1, $s0 sll $50, $50, 2 add $50, $50, $t1 SW $50, result Table 1 Ans: рс $50 $t1 (3 points) b. Write the mathematical equation of the arithmetic operation for this program performs upon the initial value $50 (For example, $s0 = $s0 + 2). c. If we want to change the arithmetic operation to $s0= ($s0 x 8) - ($s0 + 2), write your new assembly programme in the table below by modifying the code in problem1.asm. Ans: Question 2 The following is a snippet of the assembly program problem2.asm. li $t0, 10 $t4, 0 $s3, N Loop: Σ H. H. li 1w beq addi addi j $s3, $t4, Exit Sto, Sto, 4 $s3, $s3, -1 Loop (3 points) # 'N' is a variable stored in memory Exit: $t0, f_N a. How many times will the loop iterate if i. SW ii. Ans: # 'f_N' is the result i. ii. N is 3? (i.e. how many times will the body of the loop two addi instructions and the j instruction -- be executed if N is 3?)? N is 6? -- the b. This program implements a mathematical function, f(N), that creates a number series. Write the mathematical function f(N) in terms of any value of N. Ans: Question 3 The assembly program problem3.asm execute an arithmetic operation of unknown equation. There are two user input values, M and N, whereby M and N are positive integer fall within a certain range. (2 points) a. State the valid range of M and N. Then, explain in detail how the program tests the validity of the input. Ans: b. Determine the equation of the assembly program. Ans: (4 points) Questions You are advised to load the MIPS assembly program problem1.asm into your simulator to answer the following questions. # The program .text 1w move sll add SW $50, value $t1, $50 $50, $80, 2 $50, $80, $t1 $50, result a. Using the Single Step operation, execute each instruction one by one, and record the state of the processor with respect to each instruction. O o Prior to executing each instruction, write down the value of the pc (program counter) for the instruction about to be executed in Table 1. each instruction, write down After executing the value of registers $30 and $t1 for the instruction just executed in Table 1. Instruction 1w $50, value move $t1, $s0 sll $50, $50, 2 add $50, $50, $t1 SW $50, result Table 1 Ans: рс $50 $t1 (3 points) b. Write the mathematical equation of the arithmetic operation for this program performs upon the initial value $50 (For example, $s0 = $s0 + 2). c. If we want to change the arithmetic operation to $s0= ($s0 x 8) - ($s0 + 2), write your new assembly programme in the table below by modifying the code in problem1.asm. Ans: Question 2 The following is a snippet of the assembly program problem2.asm. li $t0, 10 $t4, 0 $s3, N Loop: Σ H. H. li 1w beq addi addi j $s3, $t4, Exit Sto, Sto, 4 $s3, $s3, -1 Loop (3 points) # 'N' is a variable stored in memory Exit: $t0, f_N a. How many times will the loop iterate if i. SW ii. Ans: # 'f_N' is the result i. ii. N is 3? (i.e. how many times will the body of the loop two addi instructions and the j instruction -- be executed if N is 3?)? N is 6? -- the b. This program implements a mathematical function, f(N), that creates a number series. Write the mathematical function f(N) in terms of any value of N. Ans: Question 3 The assembly program problem3.asm execute an arithmetic operation of unknown equation. There are two user input values, M and N, whereby M and N are positive integer fall within a certain range. (2 points) a. State the valid range of M and N. Then, explain in detail how the program tests the validity of the input. Ans: b. Determine the equation of the assembly program. Ans: (4 points)
Expert Answer:
Answer rating: 100% (QA)
Question1 a Instruction pc s0 t1 lw s0 value 4194304 5 0 move t1 s0 4194312 5 5 sl... View the full answer
Related Book For
Computer Organization and Design The Hardware Software Interface
ISBN: 978-0124077263
5th edition
Authors: David A. Patterson, John L. Hennessy
Posted Date:
Students also viewed these programming questions
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
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...
-
The Crazy Eddie fraud may appear smaller and gentler than the massive billion-dollar frauds exposed in recent times, such as Bernie Madoffs Ponzi scheme, frauds in the subprime mortgage market, the...
-
Refer to the situation described in P 192. Assume Pastner measures the fair value of all options on January 1, 2021, to be $4.50 per option using a single weighted-average expected life of the...
-
In the Department of Education at UR University, student records suggest that the population of students spends an average of 5.5 hours per week playing organized sports. The populations standard...
-
An Alka-Seltzer tablet contains 324 mg of aspirin (C 9 H 8 O 4 ), 1904 mg of NaHCO 3 , and 1000. mg of citric acid (H 3 C 6 H 5 O 7 ). (The last two compounds react with each other to provide the...
-
Does Early Language Reduce Tantrums? A recent headline reads "Early Language Skills Reduce Preschool Tantrums, Study Finds," and the article offers a potential explanation for this: "Verbalizing...
-
The rigid metal strip of negligible weight is used as part of an electromagnetic switch. If the stiffness of the springs at A and B is k, and the strip is originally horizontal when the springs are...
-
1. Explain, qualitatively, why the effective distance between the spheres, R', is always greater than the distance, R, between their centers. A diagram, showing the distribution of charges on each...
-
Following is partial information for the income statement of Timber Company under three different inventory costing methods, assuming the use of a periodic inventory system: Required: 1. Compute cost...
-
Should GM contract the Chevrolet portfolio (consider market share, market growth, etc.) or add new additions? r Cars Sonic Cruze Malibu Corvette Camaro Impala SS Sedan Spark SUVS/Crossovers Equinox...
-
What types of budgets are prepared annually?
-
Have you ever in the course of your work reviewed a financial report that applied inflation factors? If so, were you able to see the assumptions used to apply the factors? If not, why not? Please...
-
Do you believe that grouping expenses by diagnoses and procedures (based on type of services provided) is better to use for control and planning than grouping expenses by care setting (based on...
-
What is a long-term plan?
-
How do you think you would use break-even analysis?
-
A school age child is hospitalized for seizure control early in hospitalization the child appears angry with her parents and adores them when visiting. Then, the child becomes very clingy and...
-
An annual report of The Campbell Soup Company reported on its income statement $2.4 million as equity in earnings of affiliates. Journalize the entry that Campbell would have made to record this...
-
What is 5ED4 - 07A4 when these values represent unsigned 16-bit hexadecimal numbers? The result should be written in hexadecimal. Show your work.
-
Assume that registers $s0 and $s1 hold the values 0x80000000 and 0xD0000000, respectively. 1. What is the value of $t0 for the following assembly code? add $t0, $s0, $s1 2. Is the result in $t0 the...
-
Chip multiprocessors (CMPs) have multiple cores and their caches on a single chip. CMP on-chip L2 cache design has interesting trade-off s. Th e following table shows the miss rates and hit latencies...
-
A construction engineer has to inspect 5 construction sites in a 2-day inspection schedule. He may or may not be able to visit these sites in two days. He will not visit any site more than once. (a)...
-
An explosion in an LNG storage tank in the process of being repaired could have occurred as the result of static electricity, malfunctioning electrical equipment, an open flame in contact with the...
-
What conditions for the binomial distribution, if any, fail to hold in the following situations? (a) For each of a company's eight production facilities, record whether or not there was an accident...
Study smarter with the SolutionInn App