Question

In: Computer Science

Consider the following code: lb $t0, 1($t1) sw $t0, 0($t2) Assume the followings. • The register...

Consider the following code:

lb $t0, 1($t1)

sw $t0, 0($t2)

Assume the followings.

• The register $t1 contains the content 0x1000,0000.

• The word at memory address 0x1000,0000 is 0xAABB,CCDD.

What value of the word is stored at the memory address pointed to by register $t2? Show the value of the word in hexadecimal.

Solutions

Expert Solution

Greetings!!

Code:Please note that instead of address 10000000, the address 10010000 is used.

main:
#assumptions made
li $t1,0x10010000 #t1 contains address 10010000
li $t2,0x10010004 #t2 contains address 10010004
li $t3,0xAABBCCDD   #given data
sw $t3,0($t1) #stored the data to memory address 10010000

lb $t0, 1($t1) #load one byte from the memory ie it reads one byte from 10010001
sw $t0, 0($t2) #store the sign extended one word data to address 10010004

Output screenshots:

Case 1:Please note that the data stored in the memory is in little endian form. ie lower byte DD of the data is stored at address 0x10010000 and CC at addres 0x10010001 and BB at 0x10010002 and AA at 0x10010003.

Case 2:lb $t0,1(t1)

Please note that the one byte data loaded into t0 is in sign extended form. ie MSB of the data is extended to the other higher bits and hence the register t0 has 0xFFFFFFCC

Case 3:sw $t0,0($t2)

Hope this helps


Related Solutions

The following is the original code, (add, t1, 3, 5) (assign, a, t1) (add, t2, 3,...
The following is the original code, (add, t1, 3, 5) (assign, a, t1) (add, t2, 3, 5) (sub, t3, t2, z) (assign, b, t3) Constant folding is applied to give the following, (assign, t1, 8) (assign, a, t1) (assign, t2, 8) (sub, t3, t2, z) (assign, b, t3) After the constant folding is applied, the (assign, t2, 8) becomes redundant. What optimizations should take place in order to remove this redundancy in the constant folded code? Also show the optimized...
1. Convert the following pseudo code routine into MIPS assembler language: - Set register $t0 =...
1. Convert the following pseudo code routine into MIPS assembler language: - Set register $t0 = 1 - In four separate instructions add 2, then 3, then 4, then 5 into register $t0 $t0 = $t0 + 2 + 3 + 4 + 5 - Copy the result from register $t0 into register $t1 2. Convert the following into MIPS assembler language: - Set register $t0 = 0 - Initialize the register $t1 = 10 - Use register $t2 as...
Consider the following history H: T2:R(Y), T1:R(X), T3:R(Y), T2:R(X), T2:W(Y), T2:Commit, T1:W(X), T1:Commit, T3:R(X), T3:Commit Assume...
Consider the following history H: T2:R(Y), T1:R(X), T3:R(Y), T2:R(X), T2:W(Y), T2:Commit, T1:W(X), T1:Commit, T3:R(X), T3:Commit Assume that each transaction is consistent. Does the final database state satisfy all integrity constraints? Explain.
Find the data hazards in the following code segment lw $t1,0($t1) addi $t1,$t1,100 or $t2,$t3,$t1 add...
Find the data hazards in the following code segment lw $t1,0($t1) addi $t1,$t1,100 or $t2,$t3,$t1 add $a0,$a1,$t2 ori $a0,$a0,42 add $t5,$a0,$t2 Reorder the following code segment to remove the data hazards. Assume that data forwarding takes place: lw $t0,24($a0) sub $t4,$t4,$t0 sub $t8,$t8,$t3 add $t6,$t6,$t5 mul $t7,$t7,$t1 What is the CPI for the reordered sequence of instructions in the preceding problem?
Category T0 T1 T2 T3 Investment -$3,605,000 Net working capital change -$   236,000 $   236,000 Operating...
Category T0 T1 T2 T3 Investment -$3,605,000 Net working capital change -$   236,000 $   236,000 Operating cash flow $1,483,000 $1,483,000 $1,483,000 Salvage $   287,000 Should Brawn accept or reject this project at an adjusted WACC of 7.347.34​%, 9.349.34​%, or 11.3411.34​%?
Suppose T1 and T2 are iid Exp(1). What is the probability density function of T1+T2? What...
Suppose T1 and T2 are iid Exp(1). What is the probability density function of T1+T2? What is the probability that T1+T2 ≥ 3?
Consider two compounds for which tm = 1 min, t1 = 14.3 min and t2 =...
Consider two compounds for which tm = 1 min, t1 = 14.3 min and t2 = 15.0 min. The peak widths at half heights are 13.0 sec and 14.9 sec, respectively. What are the peak widths? (This requires that you think about the mathematics of a Gaussian curve.) Calculate the resolution of this separation. How many theoretical plates does the column have for these analytes? What is the value of the selectivity factor, α?
Category T0 T1 T2 T3 Investment −​$9,910,109 Net working capital change -$667,000 ​$667,000 Operating cash flow...
Category T0 T1 T2 T3 Investment −​$9,910,109 Net working capital change -$667,000 ​$667,000 Operating cash flow ​$3,467,000 ​$4,050,000 ​$4,708,000 Salvage ​$359,000 a) What is the IRR of the​ project? b) At what adjusted WACCs will the company accept this​ project?
Consider the following code: sw $8, 4($16) addi $16, $16, 4
 Consider the following code: sw $8, 4($16) addi $16, $16, 4 Iw $9, 0($16) e. Which of the following is true? 1. After executing the above code, the contents of $8 and $9 will be same 2. After executing the above code, the contents of $16 will be incremented by 4 3. All of the above instructions are I type instructions. 4. All of the above statement are true
Answer the following questions: a) In a wall without heat generation, with temperatures T0 and T1,...
Answer the following questions: a) In a wall without heat generation, with temperatures T0 and T1, if the heat in T0 is adiabatic, what phenomena can occur at the end of the wall? b) What are the conditions for Despicable Convective Resistance and negligible Conductivity? c) In what case, can they be considered as concentrated or finned parameters?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT