So I have a 32 bit processor I can program to in C that needs to be used with fixed point for speed.
I understand fixed point representation and basic implementation. What Im looking for is how to combine numbers with different number of decimal bits.
Lets say I sum Q10 + Q10 I would use Q10 as the sum. What If I sum Q10 and Q20? Is the an algorithm that takes into account both numbers and chooses the appropriate Qx value to minimize precision loss and overflows? I basically need addition, subtraction, multiplication and division.
The issue is that my operations may look like:
2*3.14159*50*1e-4*10 + 5.2*10
And I would rather avoid doing scaling and tricks "by hand".