P
Patrick Hoonhout
Hello,
Trying to get the bit offset value from a byte. For example:
0x1 = 0
0x2 = 1
0x4 = 2
0x8 = 3
0x10 = 4
...
...
0x80 = 7
etc.
I need this value so I can use the shift operator '<<' or '>>'. I can think
of a number of ways to do this but they all seem to be long in code.
I can only think there is some quick bitwise operation to get the bit offset
value.
(please provide code in 'C')
TIA
Patrick.
Trying to get the bit offset value from a byte. For example:
0x1 = 0
0x2 = 1
0x4 = 2
0x8 = 3
0x10 = 4
...
...
0x80 = 7
etc.
I need this value so I can use the shift operator '<<' or '>>'. I can think
of a number of ways to do this but they all seem to be long in code.
I can only think there is some quick bitwise operation to get the bit offset
value.
(please provide code in 'C')
TIA
Patrick.