fixed.cordicDivide
Description
divides y
= fixed.cordicDivide(num
,den
,OutputType
)num
by den
using the output data type
specified by OutputType
.
Examples
Divide Using CORDIC
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
num
— Numerator
scalar | vector | matrix | multidimensional array
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 andOutputType
must specify a floating-point data type.If
num
is a built-in integer type,den
must also be a built-in integer type andOutputType
must specify a built-in integer data type.If
num
is a fixed-point type,den
must also be a fixed-point type andOutputType
must specify a fixed-point data type.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| fi
Complex Number Support: Yes
den
— Denominator
scalar | vector | matrix | multidimensional array
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 andOutputType
must specify a floating-point data type.If
num
is a built-in integer type,den
must also be a built-in integer type andOutputType
must specify a built-in integer data type.If
num
is a fixed-point type,den
must also be a fixed-point type andOutputType
must specify a fixed-point data type.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| fi
Complex Number Support: Yes
OutputType
— Data type of output
fi
object | numerictype
object | Simulink.NumericType
object
Data type of the output, specified as a fi
object,
numerictype
, or Simulink.NumericType
object.
If
num
is a floating-point type,den
must also be a floating-point type andOutputType
must specify a floating-point data type.If
num
is a built-in integer type,den
must also be a built-in integer type andOutputType
must specify a built-in integer data type.If
num
is a fixed-point type,den
must also be a fixed-point type andOutputType
must specify a fixed-point data type.
Example: fi([],1,16,15)
Example: numerictype(1,16,15)
Example: fixdt(1,16,15)
More About
CORDIC
CORDIC is an acronym for COordinate Rotation DIgital Computer. The Givens rotation-based CORDIC algorithm is one of the most hardware-efficient algorithms available because it requires only iterative shift-add operations (see References). The CORDIC algorithm eliminates the need for explicit multipliers. Using CORDIC, you can calculate various functions such as sine, cosine, arc sine, arc cosine, arc tangent, and vector magnitude. You can also use this algorithm for divide, square root, hyperbolic, and logarithmic functions.
Increasing the number of CORDIC iterations can produce more accurate results, but doing so increases the expense of the computation and adds latency.
Algorithms
For fixed-point inputs num
and den
,
fixed.cordicDivide
wraps on overflow for division by zero. The behavior
for fixed-point division by zero is summarized in the table below.
Wrap Overflow | Saturate Overflow |
---|---|
0/0 = 0 | 0/0 = 0 |
1/0 = 0 | 1/0 = upper bound |
-1/0 = 0 | -1/0 = lower bound |
For floating-point inputs, fixed.cordicDivide
follows IEEE® Standard 754.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Slope-bias representation is not supported for fixed-point data types.
HDL Code Generation
Generate VHDL, Verilog and SystemVerilog code for FPGA and ASIC designs using HDL Coder™.
The fixed.cordicDivide
function also supports MATLAB® to High-Level Synthesis (HLS) code generation.
Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.
Slope-bias representation is not supported for fixed-point data types.
Version History
Introduced in R2020b
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)