Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Questions You are advised to load the MIPS assembly program problem1.asm into your simulator to answer the following questions. # The program .text 1w

Questions You are advised to load the MIPS assembly program problem1.asm into your simulator to answer the

Instruction 1w $50, value move $t1, $s0 sll $50, $50, 2 add $50, $50, $t1 SW $50, result Table 1 Ans:  $50

c. If we want to change the arithmetic operation to $s0= ($s0 x 8) - ($s0 + 2), write your new assembly

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?

b. This program implements a mathematical function, f(N), that creates a number series. Write the


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)

Step by Step Solution

3.45 Rating (161 Votes )

There are 3 Steps involved in it

Step: 1

Question1 a Instruction pc s0 t1 lw s0 value 4194304 5 0 move t1 s0 4194312 5 5 sl... 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

Computer Organization and Design The Hardware Software Interface

Authors: David A. Patterson, John L. Hennessy

5th edition

124077269, 978-0124077263

More Books

Students also viewed these Programming questions