主要内容

MATLAB 和 Simulink 中的定点数学运算

R2026b
基于 CORDIC 和其他嵌入式优化的数学运算,用于高效的 C/C++ 和 HDL 代码

Fixed-Point Designer™ 模块库使用 CORDIC 等算法提供常见数学和矩阵运算的硬件高效实现。使用 HDL Coder™ 为包含这些模块的设计生成 HDL 代码。Fixed-Point Designer 函数库包括基于 CORDIC 和其他硬件高效的数学运算实现,如除法、指数运算和三角函数。使用代码生成器为包含这些函数的设计生成 C/C++ 代码。

基于 CORDIC(坐标旋转数字计算方法)的算法是硬件效率最高的算法之一,因为它们只需进行迭代移位相加运算。CORDIC 算法不需要显式乘数,它适合计算各种函数。

有关 MATLAB® 和 Simulink® 中矩阵运算(包括线性系统求解器和矩阵分解)的基于 CORDIC 的实现,请参阅MATLAB 中的定点矩阵运算和Simulink 中的定点矩阵运算。

函数

全部展开

cordicsigmoidCORDIC-based approximation of sigmoid activation (自 R2023b 起)
ceilDiv将除法结果向正无穷方向舍入
fixDiv将除法的结果向零方向舍入
floorDiv将除法结果向负无穷方向舍入
nearestDiv将除法的结果向最接近的整数舍入
modByConstant除以常量分母后的模数
embblk.divide.cordicDivideCORDIC-based fixed-point divide with bit-exact results to Real Divide HDL Optimized and Complex Divide HDL Optimized blocks (自 R2026a 起)
fixed.cordicDivide基于 CORDIC 的定点除法
fixed.cordicReciprocalCORDIC-based fixed-point reciprocal
embblk.lookupTableReciprocalLookup table-based fixed-point reciprocal (自 R2026b 起)
embblk.realReciprocalSqrtCompute reciprocal of square root of real input (自 R2026b 起)
cordicsqrt基于 CORDIC 的平方根逼近
cordicabs基于 CORDIC 的绝对值
cordicangle基于 CORDIC 的相位角
cordiccexp基于 CORDIC 的复指数逼近
cordicacosCORDIC-based approximation of inverse cosine
cordicasin基于 CORDIC 的反正弦逼近
cordicatan2基于 CORDIC 的四象限反正切
cordiccos基于 CORDIC 的余弦逼近
cordicsin基于 CORDIC 的正弦逼近
cordicsincos基于 CORDIC 的正弦和余弦逼近
cordicsinhcoshCORDIC-based approximation of hyperbolic sine and cosine (自 R2023b 起)
cordictanh基于 CORDIC 的双曲正切
cordiccart2polCORDIC-based transformation of Cartesian coordinates to polar
cordicpol2cartCORDIC-based approximation of polar-to-Cartesian conversion
cordicrotateCORDIC-based approximation of rotation of input

模块

全部展开

CORDIC Sigmoid HDL Optimized blockCORDIC Sigmoid HDL Optimized计算基于 CORDIC 的 sigmoid 激活并生成优化的 HDL 代码 (自 R2024a 起)
Complex Divide HDL Optimized blockComplex Divide HDL OptimizedDivide one input by another using CORDIC algorithm and generate optimized HDL code
Real Divide HDL Optimized blockReal Divide HDL OptimizedDivide one real input by another using CORDIC algorithm and generate optimized HDL code
Divide by Constant HDL Optimized blockDivide by Constant HDL Optimized将输入除以常量并舍入到整数并生成优化的 HDL 代码
Divide by Constant and Round blockDivide by Constant and Round将输入除以常量并舍入到整数
Modulo by Constant HDL Optimized blockModulo by Constant HDL OptimizedPerform mod operation with a constant denominator and generate optimized HDL code
Modulo by Constant blockModulo by Constant用常量分母执行取模运算
Normalized Reciprocal HDL Optimized blockNormalized Reciprocal HDL OptimizedComputes normalized reciprocal using CORDIC algorithm and generates optimized HDL code
Real Reciprocal HDL Optimized blockReal Reciprocal HDL OptimizedCompute reciprocal and generate optimized HDL code
Real Reciprocal Square Root HDL Optimized blockReal Reciprocal Square Root HDL OptimizedCompute reciprocal of square root of real input and generate optimized HDL code (自 R2026b 起)
CORDIC Square Root HDL Optimized blockCORDIC Square Root HDL OptimizedCORDIC-based approximation of square root (自 R2024a 起)
Complex to Magnitude-Angle blockComplex to Magnitude-AngleCompute magnitude and phase angle of complex signal using CORDIC algorithm
Magnitude-Angle to Complex blockMagnitude-Angle to Complex将幅值和/或相位角信号转换为复信号
Exp HDL Optimized blockExp HDL OptimizedCompute base-e exponential of input (自 R2026b 起)
Log10 HDL Optimized blockLog10 HDL OptimizedCompute base-10 logarithm of input (自 R2026b 起)
Log2 HDL Optimized blockLog2 HDL OptimizedCompute base-2 logarithm of input (自 R2026b 起)
Logarithm HDL Optimized blockLogarithm HDL OptimizedCompute arbitrary-base logarithm of input (自 R2026b 起)
Natural Logarithm HDL Optimized blockNatural Logarithm HDL OptimizedCompute natural (base-e) logarithm of input (自 R2026b 起)
Pow10 HDL Optimized blockPow10 HDL OptimizedCompute base-10 exponential of input (自 R2026b 起)
Pow2 HDL Optimized blockPow2 HDL OptimizedCompute base-2 exponential of input (自 R2026b 起)
Power HDL Optimized blockPower HDL OptimizedCompute arbitrary-base exponential of input (自 R2026b 起)
Hyperbolic Tangent HDL Optimized blockHyperbolic Tangent HDL Optimized计算基于 CORDIC 的双曲正切并生成优化的 HDL 代码
Trigonometric Function blockTrigonometric Function指定应用于输入信号的三角函数
Screenshot of Euler to NED Transformation HDL Optimized blockEuler to NED Transformation HDL OptimizedComputes Euler to North-East-Down transformation using pipelined or burst architecture and generates optimized HDL code (自 R2022b 起)
Extract MSB block with one input and one output port.Extract MSBExtract most significant bit (MSB) of input (自 R2026b 起)

主题

精选示例