Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
10 years ago

lpm divider output binary format

Is there an easy way to determine or predict the output fixed-point binary format of the lpm_divide function based on the formats of the inputs? I know if multiplying a Qm.n number (e.g. Q16.8 which has 16 integer bits & 8 fractional bits) by a Qp.q number, the output will be Q(m+p).(n+q), e.g. multiplying Q16.8 by Q4.8 will yield a Q20.16 output. For the divider, I used a numerator of Q24.8 and denomiator Q8.8 and it yielded a quotient in Q32.0 and remainder in Q8.8, but I had to determine that by trial & error. Someone know an easier way to know the formats in advance?

Thanks, GMM
No RepliesBe the first to reply