Suppose the following MIPS instruction set is being assembled and converted to m
ID: 3706759 • Letter: S
Question
Suppose the following MIPS instruction set is being assembled and converted to machine language. The instruction set is loaded into me at address FO00000C. All memory address is shown below (for Question 15, 16 and 17) F000000C loop: addi $1. $1,-1 F0000010 beq $1, $0, done F0000014 loop FO000018done: For each instruction, write down the values (in decimal) of each field in the machine language version of that instruction using the follow notation and identify their representation type: type [ value 1 value .] Eg: add $2.s0.s0 can be represented as R-type (01OJ01210132Explanation / Answer
Answer is as follows :
a) addi $1 , $1 , -1
The binary equivalent of given addi instruction is :
00100 00001 00001 1000000000000001
Bold bit is signed bit i.e. set to 1
So it's decimal equivalent is "
[8 | 1 | 1 | -1 ]
b) beq $1, $0, done
where done is at location F0000018 the location is only of 16 bit so we occupy only 16 bit LSB's i.e. 0018 in hexadecimal
So it's binary equivalent is :
000100 00001 10001 0000000000011000
So it's decimal equivalent is :
[4 | 1 | 17 | 24 ]
c) j loop
where location for loop is F000000C
But we occupy location of 16 bit LSB's i.e. 000C in hexadecimal
So binary equivalent is
000010 00000000000000000000001100
so it's decimal equivalent is :
[ 2 | 12 ]
if there is any query please ask in comments....
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.