Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assume that i, t, x, y, and z are C++ int variables. Refer to the table below for the variables being used and their
Assume that i, t, x, y, and z are C++ int variables. Refer to the table below for the variables being used and their associated registers. Variable Register 1 1 2 # i = 3 i $to Write the corresponding MIPS I instruction(s) to C++ code or write the instructions to perform the desired task. i. Mask on positions 0, 4, 8, 12 of variable i while leaving the other positions unchanged. Hint: Write the corresponding logical expressions, then translate it to a MIPS I instruction. If a constant/immediate is used in the instruction, write the 4-digit hexadecimal equivalent of the constant. Don't forget to use prefix Ox. In the comment box, write the corresponding logical expression such as x & 0x1919, x | 0x1818, x >> 0x81, or x < < 0x81. 4 t $t1 St2 = 0x182E 0000. X $s0 ii. y = z & 0x182E 4044; Be careful with the length of the immediate/constant number used in the instruction. They may be 4 digit or 2 digits. Don't forget to use prefix Ox. Follow the comments. y $s1 # $t2 = 0x182E, use a logical instruction Z $s2 #Move the content of $t2 to the upper half positions of the register such that # Let $t2 hold the complete pattern 0x182E 4044 by using a logical instruction
Step by Step Solution
★★★★★
3.37 Rating (150 Votes )
There are 3 Steps involved in it
Step: 1
i To mask on positions 0 4 8 12 of variable i while leaving the other positions unchanged we can us...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