0
$\begingroup$

It might be a simple question but I couldn't find it via google, so I might not use the right terms.

Say I have two measurement values $P$ and $Q$. $P$ has 7 bits of resolution and $Q$ has 6 bits. So P can have all values from 0 up to $2^7 -1$, and Q can have all values from 0 up to $2^6 -1$.

Now I calculate a derived value $R$ through $R = aP + bQ + c$, a, b and c are constants.

How many bits of resolution does $R$ have? $\min(6,7)$, $\max(6,7)$ or $6 + 7$?

I know that $R$ can have $2^{13}$ different values, but are the least significant bits really... significant? Can I actually make decisions based on those bits?

$\endgroup$

1 Answer 1

2
$\begingroup$

That depends largely on the constants and how you implement the multiplication. If you multiply two signed fixed point numbers with lengths of $B_1$ and $B_2$ the result will be a signed fixed point number with a length of $B_1+B_2=1$ bits.

If you just sum $P$ and $Q$ the resulting resolution would be

$$ B_{sum} = \log_2\left(2^{B_P-1} + 2^{B_Q-1} \right) + 1 = 7.585$$

In practice you need 8 bits to represent it without overflow or truncation.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.