CENG 3531 Computer Architecture Spring 2011 7. (10 pts) Answer the following que
ID: 3891488 • Letter: C
Question
CENG 3531 Computer Architecture Spring 2011 7. (10 pts) Answer the following questions for the MIS assembly code given below. addi $tl, $0, 100add immediate LOOP: 1w $s1, 0 (Ss0) : load word add $s2, $s2, $s1 add addi $so, $s0,4 subi $tl, $tl, 1 bne $tl, $0, LOOPbranch when not equal ; add immediate subtract immediate a. What is the size of the memory needed to store this program? bytes asl b. What is the total number of instructions executed? 10Z instructions c. What is the decimal value in immediate field of (bne $t1, $0, 100P) ¡nstruction? (bne is a I-format instruction) d. If the value in register s0 is 0x2233AABB during the first execution of (1w $s1, 0 ($s0)) instruction, what is the memory address (in hexadecimal) from which the data is transferred?Explanation / Answer
1) What is the size of memory needed to store this program 32 bytes
Explanation:-
addi $t1,$0,100--->00000004
loop:
lw $s1,0($s0) -->00000008,00000012(For LUI and ORI instruction)
add $s2,$s2,$s1 --->00000016
addi $s0,$s0,4 --->00000020
subi $t1,$t1,1 ----->00000024
bne $t1,$0,loop ---->000000028
PC-->00000032
--------------------------------------
2)What is the total number of instructions executed
Ans)102
Explanation:-
loop instructions 101 times + first add instruction=102.
---------------------------------------------------------------------
3)What is the decimal value of immediate field of bne instruction
Ans) -6
Explanation:-
Here bne jump into loop label where backward counting instructions.
--------------------------------------
4) Memory address of the data transfered
Ans)Same as s0 data
Explanation:-
s0 hold the base address , so first excution offset is 0 , so the address always in s0 register content.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.