Operators and Simulink Blocks Supported for Native Floating-Point

HDL Coder™ supports math and trigonometric functions, and several Simulink® blocks with native floating-point technology. You can customize the latency of these operators.

Supported Native Floating-Point Operators

The table shows a list of floating-point operators that HDL Coder supports, the maximum and minimum latency, and the units in the last place (ulp) error.

FunctionMinimum Output LatencyMaximum Output LatencyUnits in the Last Place (ULP) error
Addition/Subtraction7120
Multiplication880
Division3232 0
Absolute value000
Unary minus000
Minimum/maximum330
Relational operators330
Reciprocal19191
Reciprocal square root17172
Square root28282
Exponential23233
Power of two220
Natural logarithm20203
Numeric to Single data type conversion660
Single to numeric data type conversion660
Trigonometric sine27271
Trigonometric cosine27272
Arctangent36362
Arctangent 2 (ArcTangent (input1 / input2))42423

Supported Math and Trigonometric Simulink Blocks

HDL Coder supports several Simulink blocks including math and trigonometric blocks. In the Math Operations library, these blocks are supported:

The table shows the list of supported blocks in other block libraries.

Block LibrarySupported blocks

Discrete

Zero Order Hold and the set of delay blocks including Integer Delay and Tapped Delay.

HDL Operations

Multiply-Add and HDL Counter

HDL Subsystems

All blocks are supported.

This library includes the State Control block and subsystems that use enable and reset ports with the State Control block.

Logic and Bit Operations

Compare To Constant and Compare To Zero

Lookup Tables

Prelookup, direct Lookup Table (n-D), and n-D Lookup Table blocks.

Model Verification

All blocks are supported.

This library includes blocks such as Assertion and Check Dynamic Range.

Model-Wide Utilities

All blocks are supported.

This library includes the DocBlock and Model Info blocks.

Ports & Subsystems

Enable, reset, input, and output ports, and model references, and subsystem blocks are supported.

Signal Attributes

All blocks are supported.

This library includes blocks such as Bus to Vector and Data Type Propagation.

Signal Routing

All blocks are supported.

This library includes blocks such as Mux and Bus Selector.

Sources

Inport, Constant, and Ground blocks.

Sinks

All blocks are supported.

This library includes blocks such as Display, To File, and Spectrum Analyzer.

Limitations of Native Floating-Point

  • Biquad Filter

  • Dead Zone and Dead Zone Dynamic

  • Delay block in RAM-based mode or with frame-based input.

  • Switch block with input to the control port as a floating-point type.

  • Dot Product in complex mode with Architecture as Tree or Linear.

  • Sum of Elements with complex input types.

  • Trigonometric Function with Function as sin or cos in CORDIC Approximation method.

  • MinMax block with mode other than value.

  • MATLAB System blocks.

  • Polar to Cartesian

  • Discrete FIR Filter with CoeffMultipliers HDL block property set to csd or factored-csd.

  • For the Data Type Conversion block:

    • Stored Integer (SI) mode for Input and output to have equal setting is not supported.

    • Saturate on integer overflow check box must be left cleared.

    Note:   For blocks that support Tree for HDL Architecture, such as the Sum of Elements and Product of Elements, use this architecture to obtain a lower latency implementation.

HDL Coder does not support:

  • Complex and vector data types.

  • Blocks operating at a continuous sample time.

  • Double data types.

  • The streaming optimization.

More About

Was this topic helpful?