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

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?
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 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, α?
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?
Consider the three transactions T1, T2, and T3, and the schedules S5 and S6 given below....
Consider the three transactions T1, T2, and T3, and the schedules S5 and S6 given below. Show all conflicts and draw the serializability (precedence) graphs for S5 and S6, and state whether each schedule is serializable or not. If a schedule is serializable, write down the equivalent serial schedule(s). T1: r1(x); r1(z); w1(x); T2: r2(z); r2(y); w2(z); w2(y); T3: r3(x); r3(y); w3(y); S5: r1(X); r2(Z); r1(Z); r3(X); r3(Y); w1(X); c1; w3(Y); c3; r2(Y); w2(Z); w2(Y); c2; S6: r1(X); r2(Z); r1(Z);...
Consider the parametric equations x = (t2 − 5) /(t2 + 1) , y = (t3 − 7t + 1) / (t2 + 1)
IN MATLABConsider the parametric equations x = (t2 − 5) /(t2 + 1) , y = (t3 − 7t + 1) / (t2 + 1)(a) Plot the curve for −8 ≤ t ≤ 8.(b) Determine the points on the graph where the slope of the tangent line is 2.(c) Determine the points on the graph where the graph has a horizontal tangent.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT