Main Content

Latency Values of Floating-Point Operators

HDL Coder™ native floating-point support can generate HDL code from your floating-point design. HDL Coder supports several Simulink® blocks and math and trigonometric functions in native floating-point mode. These tables show the default latency values of these floating-point operations.

You can customize the latency settings for most blocks and design for trade-offs between latency and Fmax by specifying custom latency values. You can also set the global custom latency of native floating-point IPs. Use the keywords listed in the tables to customize latency of the floating-point IPs. For more information, see Latency Considerations with Native Floating Point.

You can see the latency of these floating-point operators in MATLAB® by entering these commands.

nfpconfig = hdlcoder.createFloatingPointTargetConfig('NativeFloatingPoint');
nfpconfig.IPConfig

Math Operations

This table shows the list of basic math operations that are supported with native floating-point in HDL Coder and their latency information. The basic math operations include addition, subtraction, multiplication, and so on. You can use most of these blocks with both single and double data types. If you do not see an entry of double data type corresponding to a block, it means that the block does not support double types.

Basic Math Operators

Simulink BlocksKeywords Data TypeMinimum Output LatencyMaximum Output Latency
AddADDSUBDouble611
Single611
Half48
SubtractADDSUBDouble611
Single611
Half48
ProductMULDouble69
Single68
Half46
DivideDIVDouble3161
Single1732
Half1019
Math Function-Double3060
Single1631
Multiply-AddMULTADDSingle814
Rounding FunctionROUNDINGDouble35
Single35
Unary MinusUMINUSDouble
Single
Half
SignSIGNUMDouble
Single
AbsABSDouble
Single

This table shows the math functions that are supported with native floating-point in HDL Coder and their latency information. You can select the function using the Function setting of the Math Function block. You can use these blocks with single data types. Double types are unsupported for the blocks.

Math Functions

Simulink BlocksKeywordsMinimum Output LatencyMaximum Output Latency
HDL ReciprocalHDLRECIP1421
RemREM1524
ModMOD1626
SqrtSQRT1628
Reciprocal SqrtRSQRT1630
HypotHYPOT1733

Trigonometric and Exponential Operations

This table shows the trigonometric operations that are supported with native floating-point in HDL Coder and their latency information. You can select the function using the Function setting of the Trigonometric Function block. You can use these blocks with single data types. Double types are unsupported for the blocks. The Sin block has a minimum latency of 8 and a maximum latency of 14.

Trigonometric Functions

Simulink BlocksKeywordsMinimum Output LatencyMaximum Output Latency
SinSIN2727
CosCOS2727
TanTAN3333
SincosSINCOS2727
AsinASIN1723
AcosACOS1723
AtanATAN3636
Atan2ATAN24242
SinhSINH1830
CoshCOSH1727
TanhTANH2543
AsinhASINH9494
AcoshACOSH9393
AtanhATANH6767

This table shows the exponential operations that are supported with native floating-point in HDL Coder and their latency information. You can select the function using the Function setting of the Math Function block. You can use these blocks with single data types. Double types are unsupported for the blocks except Log.

Exponent/Logarithm/Power

Simulink BlocksKeywordsData TypeMinimum Output LatencyMaximum Output Latency
ExpEXPSingle1626
PowPOWSingle3354
Pow10POW10Single1626
LogLOGSingle2027
Log10LOG10Single1727

Comparisons and Conversions

This table shows operations related to comparing of numbers and data type conversions that are supported with native floating-point in HDL Coder and their latency information. You can use these blocks with both single and double data types except for the MinMax block. This block does not support double data types. For the Data Type Conversion block, you can convert between double, half, and single data types, and between floating-point and other fixed-point data types.

Comparisons and Conversions

Simulink BlocksKeywordsData TypeMinimum Output LatencyMaximum Output Latency
Data Type ConversionCONVERTDOUBLE_TO_NUMERICTYPE36
DOUBLE_TO_SINGLE36
HALF_TO_NUMERICTYPE23
HALF_TO_SINGLE12
NUMERICTYPE_TO_DOUBLE36
NUMERICTYPE_TO_HALF24
NUMERICTYPE_TO_SINGLE66
SINGLE_TO_DOUBLE35
SINGLE_TO_HALF23
SINGLE_TO_NUMERICTYPE66
Relational OperatorRELOPDouble13
Single13
Half12
MinMaxMINMAXSingle33

See Also

Modeling Guidelines

Functions

Related Examples

More About