I am given a 32-bit unsigned integer and I am trying to save the 8 most significant bits from that unsigned integer into an unsigned char. I then want to clear those bits to 0s. That last part can be done with a mask but I am unsure of how exactly to find the 8 most significant bits and then having the mask know exactly which bits to clear.
Another related problem is that I am trying to find the least significant bit and shift it to the left to make it the most significant and return that value. Like above I am unsure on how to find the least significant bit and then know how far to shift it to the left