主要内容

fixed.cordicDivide

基于 CORDIC 的定点除法

说明

y = fixed.cordicDivide(num,den,OutputType) 使用由 OutputType 指定的输出数据类型将 num 除以 den

示例

示例

全部折叠

num = fi(1);
den = fi(10);
OutputType = fi([],1,16,15);
y = fixed.cordicDivide(num,den,OutputType)
y = 
    0.1000

          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Signed
            WordLength: 16
        FractionLength: 15

输入参数

全部折叠

分子,指定为实数值标量、向量、矩阵或多维数组。

  • 如果 num 为浮点类型,den 也必须为浮点类型,且 OutputType 必须指定浮点数据类型。

  • 如果 num 为内置整数类型,den 也必须为内置整数类型,且 OutputType 必须指定内置整数数据类型。

  • 如果 num 为定点类型,den 也必须为定点类型,且 OutputType 必须指定定点数据类型。

数据类型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fi
复数支持:

分子,指定为实数值标量、向量、矩阵或多维数组。

  • 如果 num 为浮点类型,den 也必须为浮点类型,且 OutputType 必须指定浮点数据类型。

  • 如果 num 为内置整数类型,den 也必须为内置整数类型,且 OutputType 必须指定内置整数数据类型。

  • 如果 num 为定点类型,den 也必须为定点类型,且 OutputType 必须指定定点数据类型。

数据类型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fi
复数支持:

输出的数据类型,指定为 fi 对象、numerictypeSimulink.NumericType 对象。

  • 如果 num 为浮点类型,den 也必须为浮点类型,且 OutputType 必须指定浮点数据类型。

  • 如果 num 为内置整数类型,den 也必须为内置整数类型,且 OutputType 必须指定内置整数数据类型。

  • 如果 num 为定点类型,den 也必须为定点类型,且 OutputType 必须指定定点数据类型。

示例: fi([],1,16,15)

示例: numerictype(1,16,15)

示例: fixdt(1,16,15)

算法

全部折叠

参考

[1] Volder, Jack E. “The CORDIC Trigonometric Computing Technique.” IRE Transactions on Electronic Computers. EC-8, no. 3 (Sept. 1959): 330–334.

[2] Andraka, Ray. “A Survey of CORDIC Algorithm for FPGA Based Computers.” In Proceedings of the 1998 ACM/SIGDA Sixth International Symposium on Field Programmable Gate Arrays, 191–200. https://dl.acm.org/doi/10.1145/275107.275139.

[3] Walther, J.S. “A Unified Algorithm for Elementary Functions.” In Proceedings of the May 18-20, 1971 Spring Joint Computer Conference, 379–386. https://dl.acm.org/doi/10.1145/1478786.1478840.

[4] Schelin, Charles W. “Calculator Function Approximation.” The American Mathematical Monthly, no. 5 (May 1983): 317–325. https://doi.org/10.2307/2975781.

扩展功能

全部展开

版本历史记录

在 R2020b 中推出