I’m reading some values from a single byte. I’m told in the user-manual that this one byte contains 3 different values. There’s a table that looks like this:

I interpret that has meaning precision takes up 3 bits, scale takes up 2 and size takes up 3 for a total of 8 (1 byte).
What I’m not clear on is:
1 – Why is it labeled 7 through 0 instead of 0 through 7 (something to do with significance maybe?)
2 – How do I extract the individual values out of that one byte?
It is customary to number bits in a byte according to their significance: bit
xrepresents2^x. According to this numbering scheme, the least significant bit gets number zero, the next bit is number one, and so on.Getting individual bits requires a shift and a masking operation:
Shift by the number of bits to the right of the rightmost portion that you need to get (shifting by zero is ignored; I added it for illustration purposes).
Mask with the highest number that fits in the number of bits that you would like to get: 1 for one bit, 3 for two bits, 7 for three bits,
2^x-1forxbits.