Electronic – Fixed Point Division in verilog for Spartan 6

fpgaspartanverilogxilinx

I am developing a core on Spartan 6 which needs to do divisions like
1/6,2/4 etc… so the values are always between 0 and 1. As I dont need the precision of floating point I am want to use a fixed point divider as division is costly.
I found some dividers on opencores.org but all of them can computer normal division problems like 4/2,8/4 etc… well but cannot do 1/6 kind of operations. Can anyone point to a suitable divider for my application

Thank You

Best Answer

You say that you have found dividers that do "normal" division. Fixed-point division is normal division, except that the dividend must be scaled up (shifted left). Shift the dividend to the left 8 places (multiply by 256), then do a normal division. The fixed-point fractional result is equal to the integer result from the division, divided by 256. So, if you want to calculate 1/6 you will actually divide (1*256)/6, which is 42. The real result is therefore 42/256 = 0.1640625, which is reasonably close to the true value of 0.1666... We would normally say that this result is a fixed-point number with 8 bits to the right of the decimal point. If you want greater precision, use a larger scale factor.

Related Topic