Question: Provide the binary mask and bit-wise operations to complete the following tasks:
- Turn on bits 7,3,1 of an 8-bit binary number (1 is on, 0 is off).
- Toggle bits 6,5,4 of an 8 bit binary number
So far I know it is an OR
operation because 1 is on, but I don't know how to provide a mask. Do I have to turn 7,3,1
to binary then provide mask?