LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

scale by power of 2 clarification

Solved!
Go to solution

I have some hardware that returns data in the format shown in the picture. What I, for some reason, can't wrap my head around is why scaling by a power of 2^-4 returns the correct value. Why does taking an entire number and doing x*2^-4 produce the same value as doing it on a bit-by-bit conversion (for example if I had done bit0 * 2^-4 + bit1 * 2^-3...)

 

0 Kudos
Message 1 of 3
(2,896 Views)
Solution
Accepted by topic author GregFreeman

What picture? [edit} Oh Like that.

 

You are adding a larger value with each bit by 1 order of magnatude (Base2) so, you get the same "Place Value" for each digit either way


"Should be" isn't "Is" -Jay
Message 2 of 3
(2,888 Views)

@JÞB wrote:

What picture? [edit} Oh Like that.

 

You are adding a larger value with each bit by 1 order of magnatude (Base2) so, you get the same "Place Value" for each digit either way


Doh, it's like writing something in scientific notation in base 10. You are shifting the decimal around, then multiplying by some power of 10 to represent the same number by compensating for the shift. Same concept applies here using power of 2 because you are in base 2. They are shifting the decimal 4 to the right, so that the right-most place value represents not 2^0 but 2^-4. So, you have to multiply by 2^-4 to shift it back.

0 Kudos
Message 3 of 3
(2,878 Views)