Main Content

Basic HDL Algorithms

Create simple HDL designs using basic Simulink® blocks

The HDL Coder block library contains many basic blocks that you can add to your Simulink modeling environment and develop your HDL algorithm. These blocks include input sources, output sinks, and blocks that perform basic to complex math and trigonometric operations.

To filter the Simulink Library Browser to show only HDL-supported blocks, enter hdllib. The blocks listed in this section include those blocks that are only available in the HDL Coder library. Blocks such as Add and Product are available in the Simulink library in the Library Browser.

For a filtered list of Simulink blocks supported for HDL code generation, see Simulink Block List (HDL Code Generation).

Functions

hdllibDisplay blocks that are compatible with HDL code generation

Blocks

expand all

Bit ConcatConcatenates up to 128 input words into single output
Bit ReduceAND, OR, or XOR bit reduction on all input signal bits to single bit
Bit RotateRotate input signal by bit positions
Bit ShiftLogical or arithmetic shift of input signal
Bit SliceReturn field of consecutive bits from input signal
Bits to WordConvert vector of bits to integer (Since R2023a)
Word to BitsConverts real numbers to vector of bits (Since R2023a)
Sine HDL Optimized and Cosine HDL OptimizedImplement fixed-point sine and cosine wave by using lookup table approach optimized for HDL code generation
HDL CounterFree-running or count-limited hardware counter
Atan2Compute Atan2 operation using CORDIC approximation method and simulate with latency (Since R2020b)
SinCompute sine operation using CORDIC approximation method and simulate with latency (Since R2020b)
CosCompute cosine operation using CORDIC approximation method and simulate with latency (Since R2020b)
Cos+jSinCompute Cos+jSin operation using CORDIC approximation method and simulate with latency (Since R2020b)
SinCosCompute SinCos operation using CORDIC approximation method and simulate with latency (Since R2020b)
rSqrtCompute reciprocal square-root operation and simulate with latency (Since R2020b)
SqrtCompute Sqrt operation and simulate with latency (Since R2020b)
DivideCompute division operation and simulate with latency (Since R2020b)
ReciprocalCompute reciprocal operation and simulate with latency (Since R2020b)

Topics

Basic Modeling

Data Type Support

Featured Examples