HDL Coder™ supports math and trigonometric functions, and several Simulink® blocks with native floating-point technology. You can customize the latency of these 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.
Function | Minimum Output Latency | Maximum Output Latency | Units in the Last Place (ULP) error |
---|---|---|---|
Addition/Subtraction | 7 | 12 | 0 |
Multiplication | 8 | 8 | 0 |
Division | 32 | 32 | 0 |
Absolute value | 0 | 0 | 0 |
Unary minus | 0 | 0 | 0 |
Minimum/maximum | 3 | 3 | 0 |
Relational operators | 3 | 3 | 0 |
Reciprocal | 19 | 19 | 1 |
Reciprocal square root | 17 | 17 | 2 |
Square root | 28 | 28 | 2 |
Exponential | 23 | 23 | 3 |
Power of two | 2 | 2 | 0 |
Natural logarithm | 20 | 20 | 3 |
Numeric to Single data type conversion | 6 | 6 | 0 |
Single to numeric data type conversion | 6 | 6 | 0 |
Trigonometric sine | 27 | 27 | 1 |
Trigonometric cosine | 27 | 27 | 2 |
Arctangent | 36 | 36 | 2 |
Arctangent 2 (ArcTangent (input1 / input2)) | 42 | 42 | 3 |
HDL Coder supports several Simulink blocks including math and trigonometric blocks. In the Math Operations library, these blocks are supported:
Math Function where Function can be:
reciprocal
log
exp
Trigonometric Function where Function can be:
sin
cos
sincos
cos + jsin
atan
atan2
The table shows the list of supported blocks in other block libraries.
Block Library | Supported 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. |
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 |
HDL Coder does not support:
Complex and vector data types.
Blocks operating at a continuous sample time.
Double data types.
The streaming optimization.