Question: One common use of bit-level operations is to implement masking operations, where a mask (0xFF) is bit pattern that indicates a selected set of bits
One common use of bit-level operations is to implement masking operations, where a mask (0xFF) is bit pattern that indicates a selected set of bits within a word.
A. If we want to change a value x=0x87654321 to a new value like [0x00000021], which means The least significant byte of x, with all other bits set to 0. You have learned from my class that we wrote
C expression like: x & 0xFF
Could you use binary format to explain how this works (please typing with blue color)?
B. If we want to change a value x=0x87654321 to a new value like [0x876543FF], which means The least significant byte set to all ones, and all other bytes of x left unchanged.. You have learned from my class that
we wrote C expression like: x | 0xFF
Could you use binary format to explain how this works (please typing with blue color)?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
