CN108197076B - Method and device for realizing overflow-free circular rotation cordic algorithm - Google Patents
Method and device for realizing overflow-free circular rotation cordic algorithm Download PDFInfo
- Publication number
- CN108197076B CN108197076B CN201810077292.7A CN201810077292A CN108197076B CN 108197076 B CN108197076 B CN 108197076B CN 201810077292 A CN201810077292 A CN 201810077292A CN 108197076 B CN108197076 B CN 108197076B
- Authority
- CN
- China
- Prior art keywords
- level
- cordic
- angle
- value
- interval
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/15—Correlation function computation including computation of convolution operations
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Computational Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Algebra (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Computing Systems (AREA)
- Complex Calculations (AREA)
- Digital Transmission Methods That Use Modulated Carrier Waves (AREA)
Abstract
The invention discloses a method for realizing a circular rotation cordic algorithm without overflow, which comprises the following steps: the first step is as follows: folding the input angle from the [0, 2 pi) interval toAn interval; the second step is that: constructing a current angle, and tracking the theoretical value of the output phase of each stage; the third step: before each level of cordic operation, correcting the upper level output by using the current angle of the level; the fourth step: and after the N-level cordic operation is finished, directly assigning values and outputting according to the initial angle and the Nth-level operation result. The invention also discloses a device for realizing the circular rotation cordic algorithm without overflow. Compared with the prior art, the invention has the following advantages: the problem of overflow of a circular rotation cordic algorithm is solved, the output error of the algorithm is strictly controlled, and the sine and cosine values of any phase (only one noise bit at most) are accurately generated; the algorithm is simple, the occupied resource is less, and the method has great application significance in the actual DA circuit.
Description
Technical Field
The invention relates to a method and a device for realizing a circular rotation cordic algorithm without overflow.
Background
The Cordic algorithm is a classical algorithm and is applied to a DA circuit, complex operation can be simplified into shift operation, and resources are greatly saved.
In the actual implementation of cordic algorithm, overflow may occur due to the limited number of stages and the number of processing bits, for example, when applying the most widely sine and cosine function in the calculation project of cordic algorithm with circular rotation, if overflow occurs in the last stage, the calculation result is changed from 7ffff to 80000 (assuming that the number of processing bits is 20 bits), which may cause a great error in the output from 1 to-1; if the overflow occurs in the middle ith stage operation, during the distinctive operation of cordic algorithm, i-1 bits are shifted right, i-1 0 should be left complemented, now i-1 is left complemented, resulting in 1/2i-2Will be transmitted back to affect the output accuracy.
Disclosure of Invention
The invention aims to provide a method and a device for realizing a circular rotation cordic algorithm without overflow.
The invention solves the technical problems through the following technical scheme: a method for realizing a circular rotation cordic algorithm without overflow comprises the following steps:
the second step is that: constructing a current angle, and tracking the theoretical value of the output phase of each stage;
the third step: before each level of cordic operation, correcting the upper level output by using the current angle of the level;
the fourth step: and after the N-level cordic operation is finished, directly assigning values and outputting according to the initial angle and the Nth-level operation result.
The first step is specifically: folding the input angle from Z in the interval of [0, 2 pi ]Z of interval0The mapping of the four quadrants is based on:
the second step is specifically as follows:
in each iteration of cordic algorithm, the current accumulated angle theta is constructedi;
Theta in actual fixed-point operationiAnd alphajHave all been quantized intoAnd Mzand the number of processing bits of Z is the sum of all symbols and the pull line, and the quantized values are represented.
The third step is specifically as follows:
before each level of cordic operation, according to the current discrimination angleCosine of value to be output from upper stageAnd sineValue is corrected toWherein the complement is expressedAndsatisfy the requirement of
The correction method comprises the following steps:
the fourth step is specifically as follows:
the invention also discloses a device for realizing the overflow-free circular rotation cordic algorithm, which comprises the following modules:
a correction module: the method is used for constructing a current angle and tracking the theoretical value of the output phase of each stage;
a cordic operation module: before each level of cordic operation, correcting the upper level output by using the current angle of the level;
an assignment module: and directly assigning and outputting the value according to the initial angle and the Nth-level operation result after the N-level cordic operation is finished.
In the quadrant mapping module, the input angle is folded from Z in the interval of [0, 2 pi)Z of interval0The mapping of the four quadrants is based on:
in the correction module, in each iteration of cordic algorithm, the current accumulated angle theta is constructedi;
Theta in actual fixed-point operationiAnd alphajHave all been quantized intoAnd Mzall symbols are pulled to represent their quantized values for the number of processed bits for the remaining angles.
In the cordic operation module, before each grade of cordic operation, the angle is determined according to the current angleCosine of value to be output from upper stageAnd sineValue is corrected toWherein the complement is expressedAndsatisfy the requirement of
The correction method comprises the following steps:
in the assignment module, the basis is after the iteration is finished for N timesThe value is directly assigned to the value,
compared with the prior art, the invention has the following advantages: the invention solves the overflow problem of the circular rotation cordic algorithm, strictly controls the output error of the algorithm and accurately generates the sine and cosine values of any phase; the algorithm is simple, the occupied resource is less, and the method has great application significance in the actual DA circuit.
Drawings
Fig. 1 is a schematic block diagram of an implementation apparatus of a circular rotation cordic algorithm without overflow according to an embodiment of the present invention.
Detailed Description
The following examples are given for the detailed implementation and specific operation of the present invention, but the scope of the present invention is not limited to the following examples.
The source of the overflow is first analyzed.
When the cosine value is calculated by the circular rotation cordic algorithm, the initial rotation value is set
After the ith step
Yi=Ci sin(θi)
0.60725<Ci≤1
The overflow comes from two sources, one is from theoretical error, and because the iteration series is limited, according to the related error theory, | thetaN-Z0|≤αNTo do soTherefore, it is not only easy to useWhen in useAt some time possibly occurcos(θN) Case < 0. Alpha is selected when the iteration number N is large enough in practical operationNVery small, so in the roll-over caused by theoretical errors, | cos (θ)N) L is small.
Another source of computational error is that due to the actual L-bit fixed point operation, when the cordic operation shifts truncates to the right, it must be at least 1/2LFor example, when L is 20, a variation of 7ffff to 80000 may occur. Computational errors occur in each cordic iteration.
The two conditions are analyzed to find that the difference between the absolute value and the accurate value of the error value is small after overflow occurs, so that the upper-level output can be corrected according to the positive and negative values of the theoretical positive (residual) chord value of the current angle before each level of cordic iteration, if the current upper-level output and the theoretical value have different signs, the sign of the upper-level output is forcibly changed (the absolute value is not changed).
Compared with the traditional cordic algorithm, the method has the advantages that the correction module and the assignment module are added.
1 basis for correction module.
Current angle of discrimination in correction moduleIs itself made ofThe sequences are accumulated, so that no theoretical error exists, but a calculation error exists. When in useThe upper two bits equal (i.e., the XOR result is 0), this means thatTheoretical cos (. theta.)i) Is more than or equal to 0. If it is notThe most significant bit is zero, meaning XiThe result is normal and is directly valued when the result is more than or equal to 0; if it is notThe highest bit is not zero, meaning XiIs less than or equal to 0, the sign inversion occurs at the moment, and the sign needs to be forcibly changed (80000 can be reduced to 7ffff by bitwise negation).
In the same way, whenA high two-bit inequality (i.e., an exclusive or result of 1) means thatTheoretical cos (. theta.)i) Less than or equal to 0, ifHighest order is not zero, XiIf the value is less than 0, directly taking a value; if it is notHighest bit is zero, XiAnd (4) being more than or equal to 0, wherein the sign inversion occurs at the moment, and the sign needs to be forcibly changed (inverting according to the bit).
When the two conditions are combined, theHighest order andand directly taking values when the high two-bit XOR results are the same, and taking the inverse according to the bit when the high two-bit XOR results are different.
2 basis of module assignment
The assignment module follows a final stage iteration, whereinAndthere is a theoretical error and also a calculation error. As can be seen from the properties of the sine and cosine function, the folding process of the quadrant mapping module (the first step of the previous steps) only changes the sign of the sine and cosine value and does not change the absolute value, which is exactly the same as the effect after overflow occurs, so that the error correction process of the last step and the reduction process of the folding of the first step can be combined directly according to the sign of the sine and cosine valueThe sign bit of the data is corrected, the correction step is similar to the iteration of each stage whenHighest order andand when the high two-bit XOR result is the same, judging that the output is normal and directly taken, and if the output is not normal, correcting and inverting according to the bit.
Through simulation, it can be seen that overflow occurs at zero phase, the output cos value should be +1, now becomes-1; only simulation is carried out when the assignment module is corrected (the fourth step of the correction step in the invention book), and it can be seen that overflow at the zero phase position is corrected, but overflow occurs in the cordic iteration process of a certain level in the middle of the pi/2 phase position, so that the final output error is larger; after the complete correction step, the simulation effect can be seen that the overflow at both positions is eliminated.
In a word, the overflow-free circular rotation cordic algorithm implementation method provided by the invention can accurately generate the sine and cosine values of any phase, and is simple in algorithm and small in occupied resource.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.
Claims (4)
1. A circular rotation cordic algorithm implementation method without overflow is characterized by comprising the following steps:
the second step is that: constructing a current angle, and tracking the theoretical value of the output phase of each stage;
the third step: before each level of cordic operation, correcting the upper level output by using the current angle of the level;
the fourth step: after N-level cordic operation is completed, directly assigning values and outputting according to the initial angle and the Nth-level operation result; the first step is specifically: folding the input angle from Z in the interval of [0, 2 pi ]Z of interval0The mapping of the four quadrants is based on:
the second step is specifically as follows:
in each iteration of cordic algorithm, constructCurrent accumulated angle thetai;
Theta in actual fixed-point operationiAnd alphajHave all been quantized intoAnd Mzthe processing digit of Z is added with the pull line of all the symbols to represent the quantized value;
the third step is specifically as follows:
before each level of cordic operation, according to the current discrimination angleCosine of value to be output from upper stageAnd sineValue is corrected toWherein the complement is expressedAndsatisfy the requirement of
The correction method comprises the following steps:
3. an overflow-free circular rotation cordic algorithm implementation device is characterized by comprising the following modules:
a correction module: the method is used for constructing a current angle and tracking the theoretical value of the output phase of each stage;
a cordic operation module: before each level of cordic operation, correcting the upper level output by using the current angle of the level;
an assignment module: the device is used for directly assigning and outputting values according to the initial angle and the Nth-level operation result after the N-level cordic operation is completed;
in the quadrant mapping module, the input angle is folded from Z in the interval of [0, 2 pi)Z of interval0The mapping of the four quadrants is based on:
in the correction module, in each iteration of cordic algorithm, the current accumulated angle theta is constructedi;
Theta in actual fixed-point operationiAnd alphajHave all been quantized intoAnd Mzthe processing digit of Z is added with the pull line of all the symbols to represent the quantized value;
in the cordic operation module, before each grade of cordic operation, the angle is determined according to the current angleCosine of value to be output from upper stageAnd sineValue is corrected toWherein the complement is expressedAndsatisfy the requirement of
The correction method comprises the following steps:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810077292.7A CN108197076B (en) | 2018-01-26 | 2018-01-26 | Method and device for realizing overflow-free circular rotation cordic algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810077292.7A CN108197076B (en) | 2018-01-26 | 2018-01-26 | Method and device for realizing overflow-free circular rotation cordic algorithm |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108197076A CN108197076A (en) | 2018-06-22 |
CN108197076B true CN108197076B (en) | 2021-05-18 |
Family
ID=62590897
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810077292.7A Active CN108197076B (en) | 2018-01-26 | 2018-01-26 | Method and device for realizing overflow-free circular rotation cordic algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108197076B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109521992B (en) * | 2018-11-14 | 2022-11-22 | 桂林电子科技大学 | Linear frequency modulation signal generation method without multiplier based on CORDIC algorithm |
CN111666065B (en) * | 2020-06-03 | 2022-10-18 | 合肥工业大学 | Trigonometric function pipeline iteration solving method and device based on CORDIC |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB1350904A (en) * | 1970-05-12 | 1974-04-24 | Solartron Electronic Group | Implementation of fast fourier transform |
CN1437316A (en) * | 2002-02-08 | 2003-08-20 | 刘建 | Numerically controlled vibrator and its sinusoidal and cosine signal generating method |
CN101490660A (en) * | 2005-01-31 | 2009-07-22 | 马维尔国际贸易有限公司 | Improved precision CORDIC processor |
CN107608656A (en) * | 2017-09-27 | 2018-01-19 | 郑州云海信息技术有限公司 | A kind of design method of four-quadrant trigonometric function solver |
-
2018
- 2018-01-26 CN CN201810077292.7A patent/CN108197076B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB1350904A (en) * | 1970-05-12 | 1974-04-24 | Solartron Electronic Group | Implementation of fast fourier transform |
CN1437316A (en) * | 2002-02-08 | 2003-08-20 | 刘建 | Numerically controlled vibrator and its sinusoidal and cosine signal generating method |
CN101490660A (en) * | 2005-01-31 | 2009-07-22 | 马维尔国际贸易有限公司 | Improved precision CORDIC processor |
CN107608656A (en) * | 2017-09-27 | 2018-01-19 | 郑州云海信息技术有限公司 | A kind of design method of four-quadrant trigonometric function solver |
Non-Patent Citations (3)
Title |
---|
CORDIC-based VLSI architectures for digital signal processing;YU HEN HU;《IEEE Signal Processing Magazine》;19921231;第9卷(第3期);全文 * |
The CORDIC Trigonometric Computing Technique;Jack E. Volder;《IRE Transactions on Electronic Computers》;19590930;第EC-8卷(第3期);全文 * |
VLSI Architecture Design and Implementation for Application Specific CORDIC Processor;Amritakar Mandal等;《2010 International Conference on Advances in Recent Technologies in Communication and Computing》;20101231;191-193 * |
Also Published As
Publication number | Publication date |
---|---|
CN108197076A (en) | 2018-06-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2010115371A1 (en) | Implementation method and apparatus for cyclic redundancy check crc codes | |
CN108197076B (en) | Method and device for realizing overflow-free circular rotation cordic algorithm | |
CN112734023B (en) | Reconfigurable circuit applied to activation function of cyclic neural network | |
WO1999066423A1 (en) | Data calculating device | |
CN113138749A (en) | Trigonometric function calculation device and method based on CORDIC algorithm | |
CN102378960B (en) | Semiconductor integrated circuit and index calculation method | |
CN107885486B (en) | Composite finite field inversion device based on search tree | |
Peng et al. | Reduced-complexity multiplicity assignment algorithm and architecture for low-complexity Chase decoder of Reed-Solomon codes | |
CN116545621B (en) | Method and system for rapidly realizing elliptic curve multi-scalar multiplication in key exchange process | |
JP2757671B2 (en) | Priority encoder and floating point adder / subtracter | |
US6952710B2 (en) | Apparatus, methods and computer program products for performing high speed division calculations | |
US20100325183A1 (en) | Checking of the skew constancy of a bit flow | |
JP5859147B2 (en) | Bit likelihood calculation device and bit likelihood calculation method | |
CN116738132A (en) | Processing method of overrunning function, overrunning function unit and graphic processor | |
CN113672196B (en) | Double multiplication calculating device and method based on single digital signal processing unit | |
CN101055516A (en) | Hardware configuration method implementing binary system polynomial arithmetic and hardware system | |
CN112350716B (en) | Complement operation method and device and operation method of complement operation device | |
CN113988279A (en) | Output current reading method and system of storage array supporting negative value excitation | |
US20080133628A1 (en) | System and method for an efficient comparision operation of multi-bit vectors in a digital logic circuit | |
US10416960B2 (en) | Check procedure for floating point operations | |
Eivazi et al. | Fully parallel comparator for the moduli set {2n, 2n-1, 2n+ 1} | |
CN115833845B (en) | Position output device and position output method | |
TWI754970B (en) | Device, method and storage medium for accelerating operation of an activation function | |
Ghosh et al. | A generalized code for computing cyclic redundancy check | |
Tahir et al. | CAMs and high speed high precision data for trigonometric functions |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |