How do you multiply two fixed point numbers?

fouadalnoor picture fouadalnoor · Dec 23, 2012 · Viewed 14.4k times · Source

I am currently trying to figure out how to multiply two numbers in fixed point representation.

Say my number representation is as follows:

[SIGN][2^0].[2^-1][2^-2]..[2^-14]

In my case, the number 10.01000000000000 = -0.25.

How would I for example do 0.25x0.25 or -0.25x0.25 etc?

Hope you can help!

Answer

StilesCrisis picture StilesCrisis · Dec 23, 2012

Multiply into a larger sized variable, and then right shift by the number of bits of fixed point precision.