Question: Please show all the steps to solving these problems. For problems 6 - 10, Assume x and y are declared as 32 bit ints. Bits

Please show all the steps to solving these problems.

For problems 6 - 10, Assume x and y are declared as 32 bit ints. Bits are numbered 31 to 0 from left to right. Do

not make any assumptions about what x and y currently are, unless stated in the problem. Do not change the values

of any bits in x and y except the specied bits. You cannot use addition, subtraction, division, multiplication, or

modulus, relative comparisons (<, >, <=, >=), loops, switches, function calls, macros, or conditionals (if or ?:). You

are allowed to use all bit level and logic operations, left and right shifts, and binary constants. Write bit operations

to do the following:

1. Set y to the value in bits 14-7 of x. (So if x is 0000 0000 0000 0000 0111 1111 1000 0000, y would be 0000 0000

0000 0000 0000 0000 1111 1111.) You may use multiple operations.

2. Set bits 14-7 of x to 0. Use a single operation.

3. Set bits 14-7 of x to 1. Use a single operation.

4. Invert bits 14-7 of x. Use a single operation.

5. Store the value '0110' in bits 14-11 of x. You may use multiple operations.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!