Fixed-point (fi, cfi) - Fixed-point (fi, cfi) - 2026.1 English - UG1864

Vitis Functional Simulation User Guide (UG1864)

Document_ID
UG1864
Release_Date
2026-06-23
Version
2026.1 English
% Signature: varray.fi(value, sign=0, wordLength=32, fractionLength=0)
%   sign           : 0 (unsigned) or 1 (signed)
%   wordLength     : total bit width
%   fractionLength : number of fractional bits
data     = varray.fi([1.5, 2.25, -3.75, 0.125], 1, 16, 8);

% Defaults (unsigned, 32-bit, 0 fractional bits):
defData  = varray.fi([1, 2, 3]);

% Complex fixed-point:
cdata    = varray.cfi([1.5+2j, 2.25+3.5j], 1, 16, 8);

% Split real + imaginary arguments also work:
cdata    = varray.cfi(complex([1.5, 2.25], [2.0, 3.5]), 1, 16, 8);

Storage follows ap_fixed/ap_ufixed: itemsize is the next power-of-two number of bytes that holds wordLength bits (1 B up to 8-bit, 2 B up to 16, 4 B up to 32, 8 B up to 64, 16 B up to 128, and so on). cfi doubles this for the real and imaginary pair. Use varray.itemsize(...) to look up the byte width directly from a dtype string without constructing an array. Refer to Computing Byte Width for more information).

Additional methods on fi / cfi are as follows:

disp(hex(data))      % hexadecimal byte image
disp(bin(data))      % binary byte image