Question
1- Suppose we needed to jump to the memory address 0xAE87698C. (a) If the current PC value is 0xAF70018B show the j instruction to perform
1- Suppose we needed to jump to the memory address 0xAE87698C.
(a) If the current PC value is 0xAF70018B show the j instruction to perform the jump (display it as both a 32-bit binary number and as an equivalent hex value).
(b) If the current PC value is 0x8F70018B explain why we cannot use a j instruction to perform the jump. Explain how to to solve this problem by using a different unconditional jump instruction.
2- Consider the following pseudo instruction
rotl $t1, $t2, shamt
This command will rotate the bits of $t2 by shamt bits to the left, replacing the low order bits with the high order bits that are shifted off, and storing the results in $t1. For example if $t2=0xFEDCBA98 and shamt=8, then the value of $t1 will become 0xDCBA98FE.
(a) Determine the value of $t1 (in hex) using the value of $t2 above, but with a shamt value of 1.
(b) Translate the above pseudo instruction into 1 or more MIPS instructions, using as few instructions as possible.
3- Suppose MIPS did not have the sub instruction. Find a minimal set of instructions to implement sub $t0, $t1, $t2. Do not use any pseudo instructions.
4- Translate the following HLL code into MIPS
if (x > 1009904) // 1009904 = estimated population of Island, 2016
x = 1009904
Do not use any pseudo instructions.
5- Consider the following two instructions which are not part of the MIPS assembly language.
a) not $t1, $t2 # bit-wise invert
b) orn $t1, $t2, $t3 # bit-wise OR of $t2 and !$t3
(a) Determine the contents of $t1 after the execution of each of these instructions if $t2 = 0x01234567 and $t3=0x12345678.
(b) Translate these instructions into a minimumal set of MIPS instructions. Do not use any pseudo instructions.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started