The Inverse
function 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 Inverse(unsigned short x,int M,char *N)
Parameter Descriptions
The following table describes the template and the function parameters.
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 Inverse function, generated using Vivado HLS 2019.1 tool for the Xilinx Xczu9eg-ffvb1156-1-i-es1 FPGA.
Operating Frequency (MHz) |
Utilization Estimate | ||||
---|---|---|---|---|---|
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 using Vivado HLS 2019.1 tool for the Xilinx Xczu9eg-ffvb1156-1-i-es1 FPGA.
Operating Frequency (MHz) |
Latency Estimate | |
---|---|---|
Min (cycles) | Max (cycles) | |
300 | 1 | 15 |