Fixed-Point Math Operations in MATLAB and Simulink
The Fixed-Point Designer™ library of blocks provide hardware-efficient implementations of common math and matrix operations using algorithms such as CORDIC. Generate HDL code for designs that incorporate these blocks using HDL Coder™. The Fixed-Point Designer library of functions include CORDIC-based and other hardware-efficient implementations of math operations such as division, exponential operations, and trigonometric functions. Use coder to generate C/C++ code for designs that incorporate these functions.
CORDIC (COordinate Rotation DIgital Computer) based algorithms are some of the most hardware efficient algorithms because they require only iterative shift-add operations. The CORDIC algorithm eliminates the need for explicit multipliers, and is suitable for calculating a variety of functions.
For CORDIC-based implementations of matrix operations, including linear system solvers and matrix decompositions in MATLAB® and Simulink®, see Fixed-Point Matrix Operations in MATLAB and Fixed-Point Matrix Operations in Simulink.
Functions
Blocks
Topics
- 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®.