Intel: I want to perform a calculation that takes two 17-bit integers as input and calculates division up to 17 bits below the decimal point (assuming that the divisor is larger), but without converting it to a floating-point number, I want to divide it into a fixed-point number Is there a way to output

IP Quartus Prime

Category: IP
Tools: Quartus® Prime
device:-

By applying the LPM_DIVIDE of the division IP for integers, the following method can be used.

The input dividend (numerator) is left-shifted by 17 bits (34 bits by adding 0 to the right by 17 bits).
Calculate 34bit number ÷ 17bit number with LPM_DIVIDE while keeping the divisor (denominator) as it is.
The result (quotient) is a 34-bit number whose decimal point position is shifted 17 bits to the left from the right of the least significant bit.

<Description example in decimal>
Calculate 11/15 by integer division up to 3 decimal places
(1) 11 x 1000 = 11,000 divided by 15 in integer division, quotient 733 remainder 5
(2) 733 / 1000 = 0.733 is the answer. The truncated error is 5/15/1000 = 0.000333...

Experienced FAE
Free consultation is available.

From specific product specifications to parts selection, the Company FAE will answer your technical concerns free of charge. Please feel free to contact us.