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 is how to use the LPM_DIVIDE megafunction to do this? Let's say you have two fixed point binary numbers with 4 bit precision, like 1110.0010. If you use the megafunction, you will get a quotient and remainder. The problem is how do you convert these two outputs back into a decimal number in binary? One idea I had was to use the floating point megafunction, and then convert between fixed and floating point through the conversion function. But, it uses a min of 6 clock cycles. I'm ddoing acoustic echo cancellation, so this really is undesirable. I already have some extraneous clock cycles to accomodate buffer latency. I really don't want to add any more. If I use the LPM_Divide function, I won't introduce any latency at all. This is a senior project, so I am kind of learning this stuff on the fly for the first time. Any help would be greatly appreciated.