Inverse (Reciprocal)

ThexFInversefunction computes the reciprocal of a number x. The values of 1/x are stored in a look up table of 2048 size. The index for picking the 1/x value is computed using the fixed point format of x. Once this index is computed, the corresponding 1/x value is fetched from the look up table and returned along with the number of fractional bits needed to represent this value in fixed point format.

API Syntax

unsigned int xFInverse(unsigned short x,int M,char *N)

Parameter Descriptions

The following table describes the template and the function parameters.

Table 1.xFInverse Function Parameter Descriptions
Parameter Description
x 16-bit unsigned value x in fixed point format of QM.(16-M)
M Number of bits to represent integer part of x.
N Pointer to a char variable which stores the number of bits to represent fractional part of 1/x. This value is returned from the function.
Return 1/x value is returned in 32-bit format represented by a fixed point format of Q(32-N).N

Resource Utilization

The following table summarizes the resource utilization of the xFInverse function, generated usingVivado HLS 2017.1tool for the Xilinx Xczu9eg-ffvb1156-1-i-es1 FPGA.

Table 2.xFInverse Function Resource Utilization Summary

Operating Frequency

(MHz)

Utilization Estimate (ms)
BRAM_18K DSP_48Es FF LUT CLB
300 4 0 68 128 22

Performance Estimate

The following table summarizes the performance in different configurations, as generated usingVivado HLS 2017.1tool for the Xilinx Xczu9eg-ffvb1156-1-i-es1 FPGA.

Table 3.xFInverse Function Performance Estimate Summary

Operating Frequency

(MHz)

Latency Estimate
Min (cycles) Max (cycles)
300 1 8