Question

In: Computer Science

Consider the following unsigned decimal constants: 12345, 34567, 9876543. Perform the following operations: Note: Do not...

Consider the following unsigned decimal constants: 12345, 34567, 9876543.

Perform the following operations:

Note: Do not use any pseudo instructions to do so.

(a) Write MIPS instruction(s) to store each constant in temporary registers(i.e., any of $t0, $t1, . . . $t7)

(b) Write MIPS instruction(s) to perform an addition operation of the given numbers with the decimal number 123.

Make sure the numbers follow the size limitations of the immediate instruction type.

Solutions

Expert Solution

Please up vote ,comment if any query . Thanks for Question .Be safe .

Note : check attached for register value after addition . code tested in MARS MIPS simulator .

Program Plan :

  1. load immediate value 12345 into $t0 using li instruction
  2. load immediate value 34567 into $t1 using li instruction
  3. load immediate value 9876543 into $t2 using li instruction
  4. add 123 to $t0,$t1,$t2 register using add instruction and store in $t3,$t4,$t5
  5. add $t3=$t0+123
  6. addi $t3,$t0,123
  7. terminate program .

Program :

.data

.text #code section
   main:
       li $t0,12345    #load immediate value 12345 into $t0
       li $t1,34567    #load immediate value 34567 into $t1
       li $t2,9876543 #load immediate value 9876543 into $t2
  
       addi $t3,$t0,123 #add 123 to $t3 $t3=$t0+123
       addi $t4,$t1,123 #add 123 to $t4 $t4=$t1+123
       addi $t5,$t2,123 #add 123 to $t5 $t5=$t2+123
      
  
  
   #terminate program
   li $v0,10
   syscall
   

Output :

Please comment if you want any changes . Be safe .


Related Solutions

1) Covert the following binary values to decimal. Do this interpreting the binary as unsigned and...
1) Covert the following binary values to decimal. Do this interpreting the binary as unsigned and signed. a. 0111 1001 b. 1000 0000 c. 1111 1111 PLEASE EXPLAIN IT IN DETAIL
Let A be a three-bit unsigned number. Configure a seven-bit adder to perform the following operations....
Let A be a three-bit unsigned number. Configure a seven-bit adder to perform the following operations. You may shift A, shift the output, and set specific inputs or outputs to 1 or 0, as needed. You may also use NOT gates to invert A, if needed. Make sure you label each bit of your output, and that your output uses enough bits. For examples of how to draw and label the figures, see P6. a. W = 3A + 2...
Convert the following unsigned numbers to the requested form: 01100001 binary to: hex, and also decimal...
Convert the following unsigned numbers to the requested form: 01100001 binary to: hex, and also decimal Hex: Decimal: b) 136 decimal to: hex, and also binary Hex: Binary:
1. Calculate the approximate pH of the following aqueous solutions at 25C. (Note: consider one decimal...
1. Calculate the approximate pH of the following aqueous solutions at 25C. (Note: consider one decimal place for the pH answer.) a) H3PO4 (0.20 M), (pKa1=2.15, pKa2=7.15, pKa3=12.38) b) Na2CO3 (0.20 M), (pKa H2CO3/HCO3? = 6.35, pKa HCO3?/CO32? = 10.30) c) NaHCO3 (0.20 M) (use pKa values from part "b" above) a b c 2. Calculate the approximate pH of the following aqueous solutions at 25C. (Note: consider one decimal place for the pH answer.) a) NH4Cl (0.20 M) +...
Perform the following subtraction. Provide both the hexadecimal _____________ and decimal _______________ answer. 12F16 - 8C16...
Perform the following subtraction. Provide both the hexadecimal _____________ and decimal _______________ answer. 12F16 - 8C16 The range of positive integers possible in an 8-bit two’s complement system is (Read this question carefully): Question 8 options: 1 to 256 1 to 127 -128 to 127 1 to 128 Convert -13210 to a 16-bit 2’s complement in binary ____________ and hexadecimal ______________. Question 6 options: Blank # 1 Blank # 2 Convert 110.7510 to binary ______ and hexadecimal ______. Show the...
Answer the questions as indicated for scenarios 1-5. Note: You do not need to perform any...
Answer the questions as indicated for scenarios 1-5. Note: You do not need to perform any of the procedures indicated. Scenario 3: A guidance counselor identifies a random sample of 40 high school female students and gives each of these students a vocabulary test. For the female group, the average vocabulary score was 69 with a standard deviation of 5.3. Next, the guidance counselor takes a random sample of 48 male high school students. The male students also complete the...
1. Consider the following linear program, where a and b are real-valued constants: max: x +...
1. Consider the following linear program, where a and b are real-valued constants: max: x + y; ax + by ≤ 1; x ≥ 0; y ≥ 0; A) Suppose a < 0 and b < 0. Which one of these statements is true? Group of answer choices i) The linear program has a finite feasible region ii) The linear program has an empty feasible region iii) The feasible region is infinite, but there is an optimal solution iv) The...
1. Consider the following linear program, where a and b are real-valued constants: max: x +...
1. Consider the following linear program, where a and b are real-valued constants: max: x + y; ax + by ≤ 1; x ≥ 0; y ≥ 0; A) Suppose a > 0 and b > 0. Which one of these statements is true? a) The linear program has a finite feasible region b) The linear program has an empty feasible region c) The feasible region is infinite, but there is an optimal solution d) The feasible region is infinite,...
Perform each task, given the following sample data. (Round your answers to one decimal place.) 7...
Perform each task, given the following sample data. (Round your answers to one decimal place.) 7 11 12 12 11 18 6 (a) Use the Sample Variance Definition to find the variance and standard deviation of the data. variance     standard deviation     (b) Use the Alternative Formula for Sample Variance to find the variance and standard deviation of the data. variance     standard deviation    
Consider the two groups below that do not seem to come from a normal distribution. Perform...
Consider the two groups below that do not seem to come from a normal distribution. Perform a Wilcoxon Rank Sum test to see if group 1 has greater values than (is shifted to the right of) group 2. Use α=0.05. Group 1: 31, 37, 40, 42, 43, 43, 48 Group 2: 30, 35, 37, 38, 41, 42, 42
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT