Forum Discussion
Altera_Forum
Honored Contributor
9 years agoYou can set the number of pipeline stages using the pipeline parameter - this is the latency of the block. The higher the latency, the better the fmax (up to a point). Resource usage will be roughly the same, just increased register usage for higher pipeline length.
As for fixed point division - just remember that fixed point is just integer arithmatic. For your lpm divide, you just need to offset your inputs to get the correct result. Lets look at the example - 4/0.125 = 32. 4 = 0100 0.125 = 001 >> 3. So instead of shifting 0.125 to the right by 3, shift 4 to the left by 3. So now you have 0100000 / 0000001 = 0100000 = 32. This will always work. 10 / 1.625 = 6 remainder 0.25 Shift 10 by 3: 1010000 /0001101 = 6 remainder 2 (which in this case is 0.25) What you are actually doing is appending a fractional position to the integer number. You are making both operands have the same number of bits where the bits align by 2^n.