Forum Discussion
Altera_Forum
Honored Contributor
14 years agoLPM_DIVIDE Megafunction
Hey guys, I posted something earlier here about NLMS on an FPGA. So far, I have the LMS working, but I need to perform a fixed point division to perform normalization. My question ...
Altera_Forum
Honored Contributor
14 years agoAs usual with fixed point, LPM_DIV doesn't know about it and treats everything as integers.
If both your numerator and denominator are in q4 form (4 fractional bits), then your quotient will be in q0 form (no fractional bits) and your remainder will be in q4 form (4 fractional bits). More in general, if your numerator is in qX form and your denominator is in qY form, then - The remainder will be in qX form - The quotient will be in q(X-Y) form. Sometimes you can replace division with a multiplication by the inverse, where the inverse is obtained through a look up table.