11-07-2006 04:36 AM
11-07-2006 04:46 AM
03-20-2009 05:02 AM
How did you implement the division on LV FPGA? Apparently one has to manually set the multiplier and bit shift. Kindly let me know.
Thank you.
03-23-2009 09:02 AM
You almost never want to divide by a constant on the FPGA, if you're worried about efficiency, as it can be posed as a multiplication by the reciprocal of the constant. The fixed-point data type (FXPDT) makes this easy, but you can also do it with integer types and constant Scale by Power of 2 operations. For example, one integer solution might be to multiply by 2147484 (ie, 2^32/2000), then shift the result by 2^(-32).
FXPDT gives you more control over precision with configurable word lengths and rounding options. A reasonable solution would be to multiply by .000499994 using an unsigned type with word length 16 and integer word length -10 (<+,16,-10>).