Forum Discussion
Altera_Forum
Honored Contributor
14 years agoMultiplication Rounding
Hey guys, I am multiplying two 32 bit numbers using LPM_MULT. Each number is in Q16.16 fixed point format. The product is a 64 bit Q32.32 number. I then shift the product to the ri...
Altera_Forum
Honored Contributor
14 years agoMy question probably did involve some confusing use of terminology. I'm just a novice, so I should be more careful from now on.
Anyways, lets say you have two Q2.2 numbers. One is 11.11( and the other 11.11. These are the largest values that can be represented in Q2.2. Now, if we multiply them, we get: 11100001 = 14.0625. Now, this is Q4.4. I need Q2.2. You can't represent 14 with two bits. So there will be some wrap around. That is why I need rounding. Essentially, the desired product would be some smaller wrap around number, and a fractional portion of two bits.