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 these latency values. You can also customize the latency settings for most blocks and design for trade-offs between latency and Fmax by specifying custom latency values. To learn more, 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 BlocksData TypeMinimum Output LatencyMaximum Output Latency
AddDouble611
Single611
Half48
SubtractDouble611
Single611
Half48
ProductDouble69
Single68
Half46
DivideDouble3161
Single1732
Half1019
Math FunctionDouble3060
Single1631
Multiply-AddSingle814
Rounding FunctionDouble35
Single35
Unary MinusDouble
Single
Half
SignDouble
Single
AbsDouble
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 BlocksMinimum Output LatencyMaximum Output Latency
HDL Reciprocal1421
Rem1524
Mod1626
Sqrt1628
Reciprocal Sqrt1630
Hypot1733

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 BlocksMinimum Output LatencyMaximum Output Latency
Sin2727
Cos2727
Tan3333
Sincos2727
Asin1723
Acos1723
Atan3636
Atan24242
Sinh1830
Cosh1727
Tanh2543
Asinh9494
Acosh9393
Atanh6767

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 BlocksData TypeMinimum Output LatencyMaximum Output Latency
ExpSingle1626
Half916
PowSingle3354
Pow10Single1626
LogDouble3444
Single2027
Half917
Log10Single1727
Half1018

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 BlocksData TypeMinimum Output LatencyMaximum Output Latency
Data Type ConversionDouble36
Single66
Half32
Relational OperatorDouble13
Single13
Half12
MinMaxSingle33

See Also

Modeling Guidelines

Functions

Related Examples

More About