Not Sure where to put this post....
I am learning bitwise operations. I need to do 2 things:
1. Convert an integer in the range -64 to 63, to a byte where:
bit 7 is the sign.
bit 8 is set to 1.
2. Convert an integer in the range -32 to 31 to a byte where:
bit 6 is the sign
.... and then set bit 7 to 0 or 1 as required
.... and set bit 8 to 0 or 1 as required
I am learning bitwise operations. I need to do 2 things:
1. Convert an integer in the range -64 to 63, to a byte where:
bit 7 is the sign.
bit 8 is set to 1.
2. Convert an integer in the range -32 to 31 to a byte where:
bit 6 is the sign
.... and then set bit 7 to 0 or 1 as required
.... and set bit 8 to 0 or 1 as required