主要内容

本页面提供的是上一版软件的文档。当前版本中已删除对应的英文页面。

基本 HDL 算法

R2026a
使用基本 Simulink® 模块创建简单 HDL 设计

HDL Coder 模块库包含许多基本模块,您可将其添加到 Simulink 建模环境并开发 HDL 算法。这些模块包括输入源、输出信宿及执行基础到复杂数学和三角运算的模块。

要过滤 Simulink 库浏览器以仅显示 HDL 支持的模块,请输入 hdllib。本节列出的模块包括仅在 HDL Coder 库中可用的模块。Add 和 Product 等模块在库浏览器的 Simulink 库中提供。

有关过滤后的支持 HDL 代码生成的 Simulink 模块的列表,请参阅 Simulink 模块列表(HDL 代码生成)。

函数

hdllib显示与 HDL 代码生成兼容的模块

模块

全部展开

Bit Concat blockBit ConcatConcatenates up to 128 input words into single output
Bit Reduce blockBit Reduce对所有输入信号位进行 AND、OR 或 XOR 位归约,结果为单个位
Bit Rotate blockBit Rotate按位的位置旋转输入信号
Bit Shift blockBit Shift输入信号的逻辑或算术移位
Bit Slice blockBit Slice从输入信号返回连续位字段
Bits to Word BlockBits to WordConvert vector of bits to integer (自 R2023a 起)
Word to Bits BlockWord to BitsConverts real numbers to vector of bits (自 R2023a 起)
Sine HDL Optimized blockSine HDL Optimized and Cosine HDL OptimizedImplement fixed-point sine and cosine wave by using lookup table approach optimized for HDL code generation
HDL Counter blockHDL CounterFree-running, count-limited, or modulo hardware counter
HDL Math Atan2 BlockAtan2使用 CORDIC 逼近方法计算 Atan2 运算,并进行带延迟的仿真
HDL Math Sine BlockSin使用 CORDIC 逼近方法计算正弦运算并带延迟进行仿真
HDL Math Cosine BlockCos使用 CORDIC 逼近方法计算余弦运算并带延迟进行仿真
HDL Math Cos+jSin BlockCos+jSinCompute Cos+jSin operation using CORDIC approximation method and simulate with latency
HDL Math SinCos BlockSinCosCompute SinCos operation using CORDIC approximation method and simulate with latency
HDL Math rSqrt BlockrSqrtCompute reciprocal square-root operation and simulate with latency
HDL Math Sqrt BlockSqrtCompute Sqrt operation and simulate with latency
LUT based Sqrt block that has two input ports named, dataIn and validIn, and two output ports named, dataOut and validOut.SqrtLUTCompute square-root operation using lookup table (自 R2026a 起)
HDL Math Divide BlockDivideCompute division operation and simulate with latency
HDL Math Reciprocal BlockReciprocalCompute reciprocal operation and simulate with latency

主题

基础建模

数据类型支持

精选示例