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 PDF

Info

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
Application number
CN201810077292.7A
Other languages
Chinese (zh)
Other versions
CN108197076A (en
Inventor
刘立业
陈勇
伍小保
范欢欢
姚瑶
孙维佳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CETC 38 Research Institute
Original Assignee
CETC 38 Research Institute
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by CETC 38 Research Institute filed Critical CETC 38 Research Institute
Priority to CN201810077292.7A priority Critical patent/CN108197076B/en
Publication of CN108197076A publication Critical patent/CN108197076A/en
Application granted granted Critical
Publication of CN108197076B publication Critical patent/CN108197076B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/15Correlation 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 to
Figure DDA0002989482000000011
An 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

Method and device for realizing overflow-free circular rotation cordic algorithm
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.
At the initial phase
Figure GDA0003003982410000011
In the vicinity, the positive (cosine) value may approach or reach ± 1, and overflow is extremely likely to occur, and thus a large output error occurs.
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 first step is as follows: folding the input angle from the [0, 2 pi) interval to
Figure GDA0003003982410000012
An 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 first step is specifically: folding the input angle from Z in the interval of [0, 2 pi ]
Figure GDA0003003982410000021
Z of interval0The mapping of the four quadrants is based on:
Figure GDA0003003982410000022
the second step is specifically as follows:
in each iteration of cordic algorithm, the current accumulated angle theta is constructedi
Figure GDA0003003982410000023
N is the number of iterations, kj=±1,αjtan -1 1/2j-1
Theta in actual fixed-point operationiAnd alphajHave all been quantized into
Figure GDA0003003982410000024
And
Figure GDA0003003982410000025
Figure GDA0003003982410000026
Figure GDA0003003982410000027
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 angle
Figure GDA0003003982410000028
Cosine of value to be output from upper stage
Figure GDA0003003982410000029
And sine
Figure GDA00030039824100000210
Value is corrected to
Figure GDA00030039824100000211
Wherein the complement is expressed
Figure GDA00030039824100000212
And
Figure GDA00030039824100000213
satisfy the requirement of
Figure GDA00030039824100000214
The correction method comprises the following steps:
Figure GDA00030039824100000215
Figure GDA00030039824100000216
the fourth step is specifically as follows:
after iteration for N times
Figure GDA0003003982410000031
The value is directly assigned to the value,
Figure GDA0003003982410000032
Figure GDA0003003982410000033
the invention also discloses a device for realizing the overflow-free circular rotation cordic algorithm, which comprises the following modules:
a quadrant mapping module: for folding input angles from the [0, 2 π) interval to
Figure GDA0003003982410000034
An interval;
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)
Figure GDA0003003982410000035
Z of interval0The mapping of the four quadrants is based on:
Figure GDA0003003982410000036
in the correction module, in each iteration of cordic algorithm, the current accumulated angle theta is constructedi
Figure GDA0003003982410000037
N is the number of iterations, kj=±1,αjtan -1 1/2j-1
Theta in actual fixed-point operationiAnd alphajHave all been quantized into
Figure GDA0003003982410000038
And
Figure GDA0003003982410000039
Figure GDA00030039824100000310
Figure GDA00030039824100000311
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 angle
Figure GDA00030039824100000312
Cosine of value to be output from upper stage
Figure GDA0003003982410000041
And sine
Figure GDA0003003982410000042
Value is corrected to
Figure GDA0003003982410000043
Wherein the complement is expressed
Figure GDA0003003982410000044
And
Figure GDA0003003982410000045
satisfy the requirement of
Figure GDA0003003982410000046
The correction method comprises the following steps:
Figure GDA0003003982410000047
Figure GDA0003003982410000048
in the assignment module, the basis is after the iteration is finished for N times
Figure GDA0003003982410000049
The value is directly assigned to the value,
Figure GDA00030039824100000410
Figure GDA00030039824100000411
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
Figure GDA0003003982410000051
After the ith step
Figure GDA0003003982410000052
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 so
Figure GDA0003003982410000053
Therefore, it is not only easy to use
Figure GDA0003003982410000054
When in use
Figure GDA0003003982410000055
At some time possibly occur
Figure GDA0003003982410000056
cos(θ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 module
Figure GDA0003003982410000057
Is itself made of
Figure GDA0003003982410000058
The sequences are accumulated, so that no theoretical error exists, but a calculation error exists. When in use
Figure GDA0003003982410000059
The upper two bits equal (i.e., the XOR result is 0), this means that
Figure GDA00030039824100000510
Theoretical cos (. theta.)i) Is more than or equal to 0. If it is not
Figure GDA00030039824100000511
The 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 not
Figure GDA00030039824100000512
The 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, when
Figure GDA0003003982410000061
A high two-bit inequality (i.e., an exclusive or result of 1) means that
Figure GDA0003003982410000062
Theoretical cos (. theta.)i) Less than or equal to 0, if
Figure GDA0003003982410000063
Highest order is not zero, XiIf the value is less than 0, directly taking a value; if it is not
Figure GDA0003003982410000064
Highest 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, the
Figure GDA0003003982410000065
Highest order and
Figure GDA0003003982410000066
and 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.
For the
Figure GDA0003003982410000067
The processing method is similar.
2 basis of module assignment
The assignment module follows a final stage iteration, wherein
Figure GDA0003003982410000068
And
Figure GDA0003003982410000069
there 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 value
Figure GDA00030039824100000610
The sign bit of the data is corrected, the correction step is similar to the iteration of each stage when
Figure GDA00030039824100000611
Highest order and
Figure GDA00030039824100000612
and 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.
For the
Figure GDA00030039824100000613
The processing method is similar.
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 first step is as follows: folding the input angle from the [0, 2 pi) interval to
Figure FDA0003003982400000011
An 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: 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 ]
Figure FDA0003003982400000012
Z of interval0The mapping of the four quadrants is based on:
Figure FDA0003003982400000013
the second step is specifically as follows:
in each iteration of cordic algorithm, constructCurrent accumulated angle thetai
Figure FDA0003003982400000014
N is the number of iterations, kj=±1,αj=tan-11/2j-1
Theta in actual fixed-point operationiAnd alphajHave all been quantized into
Figure FDA0003003982400000015
And
Figure FDA0003003982400000016
Figure FDA0003003982400000017
Figure FDA0003003982400000018
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 angle
Figure FDA0003003982400000019
Cosine of value to be output from upper stage
Figure FDA00030039824000000110
And sine
Figure FDA00030039824000000111
Value is corrected to
Figure FDA00030039824000000112
Wherein the complement is expressed
Figure FDA00030039824000000113
And
Figure FDA00030039824000000114
satisfy the requirement of
Figure FDA00030039824000000115
The correction method comprises the following steps:
Figure FDA0003003982400000021
Figure FDA0003003982400000022
2. the method for implementing the spill-free circular rotation cordic algorithm according to claim 1, wherein the fourth step is specifically:
after iteration for N times
Figure FDA0003003982400000023
The value is directly assigned to the value,
Figure FDA0003003982400000024
Figure FDA0003003982400000025
3. an overflow-free circular rotation cordic algorithm implementation device is characterized by comprising the following modules:
a quadrant mapping module: for folding input angles from the [0, 2 π) interval to
Figure FDA0003003982400000026
An interval;
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)
Figure FDA0003003982400000027
Z of interval0The mapping of the four quadrants is based on:
Figure FDA0003003982400000028
in the correction module, in each iteration of cordic algorithm, the current accumulated angle theta is constructedi
Figure FDA0003003982400000031
N is the number of iterations, kj=±1,αj=tan-11/2j-1
Theta in actual fixed-point operationiAnd alphajHave all been quantized into
Figure FDA0003003982400000032
And
Figure FDA0003003982400000033
Figure FDA0003003982400000034
Figure FDA0003003982400000035
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 angle
Figure FDA0003003982400000036
Cosine of value to be output from upper stage
Figure FDA0003003982400000037
And sine
Figure FDA0003003982400000038
Value is corrected to
Figure FDA0003003982400000039
Wherein the complement is expressed
Figure FDA00030039824000000310
And
Figure FDA00030039824000000311
satisfy the requirement of
Figure FDA00030039824000000312
Figure FDA00030039824000000313
The correction method comprises the following steps:
Figure FDA00030039824000000314
Figure FDA00030039824000000315
4. the method of claim 3The device for realizing the circular rotation cordic algorithm without overflow is characterized in that in the assignment module, the basis is obtained after the iteration is finished for N times
Figure FDA00030039824000000316
The value is directly assigned to the value,
Figure FDA00030039824000000317
Figure FDA00030039824000000318
CN201810077292.7A 2018-01-26 2018-01-26 Method and device for realizing overflow-free circular rotation cordic algorithm Active CN108197076B (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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