Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

questions from computer architecture, please give short reasoning to how you got

ID: 3889208 • Letter: Q

Question

questions from computer architecture, please give short reasoning to how you got the answer

a C whot is the Fon dhe allouuinq stathment, correspondina MiPS assem by odeAsume tnad the variahes i ondi Jare base address othe arrays A and 8 are in register Assume that the dement o, dhe abays A ond B ane 4-byte words. Show how the value 099abcdek would be amonged on modire n memory o a litke-endion ond bir erdi Assume yhe data is stored at address o. MIRS instruction uh4B this sw-$t-32(4t2) pe inshruchon ! (Shert exploiny 4. undh R-tpe instuchon? whythusR

Explanation / Answer

Q2.

sub $s2,$s3,$s4 /* Perform i-j and store the result in register s2*/

lw $s5, 2($s6) /* This will load the element at address s6+2 i.e. A[2] into register s5*/

add $s2,$s2,$s5 /*This will perform add operation on register value of s2 and s5 and store in s2, i.e. i-j+A[2]*/

sw $s2, 8($s7) /*Once the computation result is obtaintained, this will store the result at address s7+8 i.e. B[8]*/

Q3.

In big endian machine, the most significant byte is stored in smallest location. Assuming 0 is the starting location then it Ox99abcdef will be stored as

Address(Byte) Value

00 99

01 ab

02 cd

03 ef

In little endian machine, the least significant byte is stored in smallest location. Assuming 0 is the starting location then it Ox99abcdef will be stored as

Address(Byte) Value

00   ef

01 cd

02 ab

03 99

Q4. Given instruction: sw $t1, 32($t2) .It will store the value of register t1 at address $t2+32 i.e. address stored in t2 plus 32. This is I-type instruction also called indexed addressing because base address is stored at location stored in t2, and we can index the element stored after t2 by mentioning the index(also called as offset). For example here 32($t2) means 32nd element starting from t2.

Q5. All the given instructions are R-type instruction because these instructions only use registers. Other than shift instructions, all instructions under R-type only use register in the operands.