Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Confused as to what I got wrong Question 2 Assume that i , t , x , y , and z are C + +

Confused as to what I got wrong
Question 2
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.
Write the corresponding MIPS I instruction(s) to C++ code or write the instructions to perform the desired task.
i.y= the sign of x?? let y hold a pattern that numerically equals to the sign bit of x
If a constant/immediate is used, write type it in 2-digit hexadecimal representation. Don't forget to use prefix 0x.
Hint: Extract the far-left bit of variable x and put it in the far-right position of variable y. Refer to question 4 of 04?- Logical Operations.
In the comment box, write the corresponding logical expression such as x&01919,x,|,01818,x>>081,or x081.
1,#y=
ii. Preserve the bits of x at odd positions that are lower than 16(1,3,5,dots13,15) while masking off all other positions. Use variable t to hold the result.
If a constant/immediate is used, write type it in 4-digit hexadecimal representation. Don't forget to use prefix 0x.
In the comment box, write the corresponding logical expression such as x&01919,x,|,01818,x>>081,or x081.
1,#t=
iii. Follow the two-step negation in here to perform y=-z.
If a constant/immediate is used, write type it in 4-digit hexadecimal representation. Don't forget to use prefix 0x.
1
??# $2=z
2
iv. Review the following binary equivalents of multiples of 4.
Write the corresponding MIPS I instruction(s) to the following C++ code: y=z,8,4;
If a constant/immediate is used, write type it in 4-digit hexadecimal representation. Don't forget to use prefix 0x.
Hint: Mask off the higher 30 bits of variable z. Refer to question 4 of 04- Logical Operations
In the comment box, write the corresponding logical expression such as x&0x1919,x,|,01818,x>>081,or x081.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Development For Dummies

Authors: Allen G. Taylor

1st Edition

978-0764507526

More Books

Students also viewed these Databases questions