Main Content

fixed.cordicDivide

CORDIC-based fixed-point divide

Description

y = fixed.cordicDivide(num,den,OutputType) divides num by den with the output data type specified by OutputType using a CORDIC-based algorithm.

Note

The embblk.divide.cordicDivide function also performs CORDIC-based fixed-point division and outputs a solution which is bit-exact with the Real Divide HDL Optimized and Complex Divide HDL Optimized blocks. The fixed.cordicDivide function uses larger data types than the embblk.Divide.cordicDivice function, which provides more accurate results but requires additional hardware resources and computation time.

example

Examples

collapse all

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

Input Arguments

collapse all

Numerator, specified as a real-valued scalar, vector, matrix, or multidimensional array.

  • If num is a floating-point type, den must also be a floating-point type and OutputType must specify a floating-point data type.

  • If num is a fixed-point type, den must also be a fixed-point type and OutputType must specify a fixed-point data type.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fi
Complex Number Support: Yes

Numerator, specified as a real-valued scalar, vector, matrix, or multidimensional array.

  • If num is a floating-point type, den must also be a floating-point type and OutputType must specify a floating-point data type.

  • If num is a fixed-point type, den must also be a fixed-point type and OutputType must specify a fixed-point data type.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fi
Complex Number Support: Yes

Data type of the output, specified as a fi object, numerictype object, or Simulink.NumericType object.

  • If num is a floating-point type, den must also be a floating-point type and OutputType must specify a floating-point data type.

  • If num is a fixed-point type, den must also be a fixed-point type and OutputType must specify a fixed-point data type.

Example: fi([],1,16,15)

Example: numerictype(1,16,15)

Example: fixdt(1,16,15)

Algorithms

collapse all

References

[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.

Extended Capabilities

expand all

Version History

Introduced in R2020b

expand all