MATLAB 和 Simulink 中的定点数学运算
Fixed-Point Designer™ 模块库使用 CORDIC 等算法提供常见数学和矩阵运算的硬件高效实现。使用 HDL Coder™ 为包含这些模块的设计生成 HDL 代码。Fixed-Point Designer 函数库包括基于 CORDIC 和其他硬件高效的数学运算实现,如除法、指数运算和三角函数。使用代码生成器为包含这些函数的设计生成 C/C++ 代码。
基于 CORDIC(坐标旋转数字计算方法)的算法是硬件效率最高的算法之一,因为它们只需进行迭代移位相加运算。CORDIC 算法不需要显式乘数,它适合计算各种函数。
有关 MATLAB® 和 Simulink® 中矩阵运算(包括线性系统求解器和矩阵分解)的基于 CORDIC 的实现,请参阅MATLAB 中的定点矩阵运算和Simulink 中的定点矩阵运算。
函数
模块
主题
- How to Set CORDIC Input Word Length and Maximum Shift Value to Achieve Desired Precision
This example provides a starting point for the input data type and number of iterations or maximum shift value required for the CORDIC algorithm to achieve a desired accuracy.
- Implement Hardware-Efficient Complex Divide HDL Optimized
How to use the Complex Divide HDL Optimized block.
- Implement Hardware-Efficient Real Divide HDL Optimized
How to use the Real Divide HDL Optimized block.
- Customize Output Value of Real Divide HDL Optimized Block When Denominator Is Zero
Use the divideByZero port to customize the value of the block output when division by zero occurs.
- Implement HDL Optimized Modulo by Constant
How to use the Modulo by Constant HDL Optimized block.
- How to Use HDL Optimized Normalized Reciprocal
This example shows how and when to use the
normalizedReciprocal
function and the Normalized Reciprocal HDL Optimized block to compute the normalized reciprocal of an input. - Implement Hardware-Efficient Hyperbolic Tangent
Implement a hardware-efficient hyperbolic tangent.
- Hardware-Efficient Rotation About Arbitrary Axis Using CORDIC
This example shows how to implement rotation about an arbitrary axis using the CORDIC algorithm in Simulink®.
- Hardware-Efficient Euler Rotations Using CORDIC
This example shows how to implement Euler rotations using a CORDIC kernel.
- Hardware-Efficient Rotation About Arbitrary Axis Using CORDIC
This example shows how to implement rotation about an arbitrary axis using the CORDIC algorithm in Simulink®.