Cordic implementation method capable of saving area

By introducing error compensation to extend Cordic iterations and using combinational logic circuits, the method addresses the issue of increased chip area and power consumption in SOC, achieving efficient area-saving and power reduction.

CN119180260AActive Publication Date: 2024-12-24HEFEI BRITE TECH CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411650566.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2024-12-24
Estimated Expiration
2044-11-19

AI Technical Summary

Technical Problem

The use of the Cordic algorithm in System on Chip (SOC) requires a multiplier for modulus compensation, leading to increased chip area and power consumption due to the need for a large number of iterations, especially for special points where the number of iterations is less than the preset value.

Method used

Introduce error compensation to extend the number of iterations and make the compensation coefficient constant, allowing a combinational logic circuit to replace the multiplier, thereby reducing chip area and power consumption.

Benefits of technology

The method effectively reduces chip area and power consumption while maintaining accuracy by extending iterations with minimal error, using combinational logic circuits instead of multipliers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119180260A_ABST
    Figure CN119180260A_ABST
Patent Text Reader

Abstract

The invention discloses an area-saving cordic implementation method, and belongs to the technical field of system-on-chip design. According to the cordic implementation method, the number of preset Cordic iterations is represented by N, and when the number of iterations i does not reach N and the judgment value # imgabs0 # of the iteration direction returns to 0, it is indicated that calculation is ended in advance; at the moment, by introducing an error value, Cordic is forced to return to zero and enter forward rotation, then after the number of iterations reaches N, calculation is stopped, the coefficient # imgabs 1 # becomes a constant, and finally, the N iteration values are multiplied by # imgabs 2 # to obtain a final calculation result. According to the invention, the minimum error of one LSB is introduced according to the selected system function and working mode, the number of iterations is prolonged, the coefficient compensation value is changed into a constant, the use of a multiplier is avoided, and the area and power consumption of a chip are greatly saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of system on chip design, and in particular relates to a method for realizing area saving of cordic (coordinate rotation digital computer) in SOC (System on Chip). Background Art

[0002] When using the Cordic algorithm to implement sine and cosine, modulus, hyperbolic sine and cosine, square root and other functions, the Cordic algorithm needs to work in a circular system or a hyperbolic system, and its calculation results need to consider the compensation of the modulus value, usually by multiplying the result of the iterative calculation by a coefficient, as shown below:

[0003]

[0004] Where i represents the number of iterations, represents the modulus gain of the circular system, Represents the modulus gain of the hyperbolic system. To reduce the Cordic calculation error, the number of iterations i is generally greater than 15. At this time, it can be considered that and are stable constants, and the quantization bit width is taken as 31. and The corresponding values ​​of the number of iterations are shown in Table 1. However, when Cordic calculates some special points, the operation will end early, that is, the actual number of iterations is less than 16 times, and the corresponding and , will vary depending on the number of iterations. Taking the calculation of the cosine function as an example, assuming that the preset number of Cordic iterations is 20, the angle value table used for Cordic iteration is shown in Table 2 below. When the value to be calculated is , Cordic actually only needs 1 iteration to complete the calculation. According to Table 1, The value should be 1518500249; when the calculated value is, Cordic actually only needs 2 iterations to complete the calculation. According to Table 1, The value should be 1358187913, so and The value of should be variable. Even if the preset number of iterations is 20, the stable value 1304065748 cannot be used directly.

[0005] Table 1 and The corresponding value table of the number of iterations. represents the modulus gain of the circular system, represents the modulus gain of the hyperbolic system;

[0006] Table 1: and Table of values ​​corresponding to the number of iterations

[0007]

[0008] Table 2 is the angle value table used by Cordic for iteration;

[0009] Table 2: Cordic iteration angle value table

[0010]

[0011] In summary, when the Cordic algorithm implements functions that require modulus compensation, such as sine and cosine, modulus, hyperbolic sine and cosine, and square root, a multiplier is required to implement The multiplication operation of the iteration result is as shown in the appendix of the manual. Figure 1 Therefore, when implementing the Cordic algorithm in a SOC (System on Chip), a multiplier must be used at the same time, but the multiplier will occupy a large chip area, increasing costs and power consumption. Summary of the invention

[0012] The purpose of the present invention is to provide an area-saving Cordic implementation method. The method extends the number of iterations by introducing errors according to the judgment conditions for ending Cordic iterations, so that the compensation coefficient becomes a constant, thereby making the multiplication of the Cordic iteration result and the compensation coefficient become the multiplication of a variable and a constant. When this is implemented in a SOC, a combinational logic circuit can be used to replace the multiplier, which greatly saves the chip area and power consumption, and can well solve the problems raised in the above-mentioned background technology.

[0013] To achieve the above object, the present invention provides the following technical solution: a method for realizing area-saving Cordic, wherein N represents the preset number of Cordic iterations, and when the number of iterations i does not reach N, and the judgment value d of the iteration direction is i When it returns to 0, it means that the calculation has ended prematurely. At this time, the error value is introduced to force Cordic to return to 0 and enter forward rotation. After the number of iterations reaches N, the calculation is stopped and the coefficient will become a constant, and finally the Nth iteration value will be combined with Multiply them to get the final calculation result;

[0014] in, represents the modulus gain of the circular system, Represents the modulus gain of the hyperbolic system, and the initial value of i is 0.

[0015] Preferably, when performing the Cordic algorithm operation, the cordic implementation method selects a system function and a working mode according to the type of function to be implemented, specifically including:

[0016] When calculating cosine / sine / park / ipark functions, select circular system as system type and rotation mode as working mode;

[0017] When calculating atan2 / modulus / atan functions, select circular system as system type and vector mode as working mode;

[0018] When calculating the mult function, select the linear system as the system type and the rotation mode as the working mode;

[0019] When calculating the div function, select the linear system as the system type and the vector mode as the working mode;

[0020] When calculating cosh / sinh functions, select hyperbolic system as system type and rotation mode as working mode;

[0021] When calculating atanh / std_dev / ln functions, select hyperbolic system as system type and vector mode as working mode;

[0022] When the working mode is selected as vector mode, the judgment condition of the iteration direction is ;

[0023] When the working mode is selected as rotation mode, the judgment condition of the iteration direction is ;

[0024] Among them, the judgment value of the iteration direction There are three situations: i >0,d i <0 or d i =0.

[0025] Preferably, when d i =0, if Cordic calculates the cosine / sine / park / ipark / modulus / cosh / sinh / std_dev function; at this time, according to the working mode, in d i Add an LSB error value to continue the Cordic iteration process;

[0026] When working in rotation mode, the iteration termination judgment condition is , so the error compensation needs to be added to the angle value Z, that is:

[0027]

[0028] When working in vector mode, since the iteration termination judgment condition is, the error compensation value needs to be added to the coordinate value, that is:

[0029]

[0030] Among them, is the gain value of the angle value Z in the previous iteration, is the gain value of the coordinate value Y in the previous iteration. Cordic sampling is quantized with a 31-bit width, and the error value The corresponding floating-point value is ;

[0031] Judge whether the current iteration number i is equal to N. If i < N, it means that the specified iteration number has not been reached. Let i = i + 1 and enter the first step; if i = N, the iteration is completed, and then coefficient compensation is performed.

[0032] Preferably, when d i > 0, perform forward iteration; when d i < 0, perform negative iteration;

[0033] At this time, the angle value Z and the coordinate value Y are iterated normally, as follows:

[0034]

[0035] ;

[0036] Judge whether the current iteration number i is equal to N. If i < N, it means that the specified iteration number has not been reached. Let i = i + 1 and enter the first step; if i = N, the iteration is completed, and then coefficient compensation is performed.

[0037] Preferably, the specific process of the coefficient compensation includes:

[0038] If the current Cordic calculates the cosine / sine / park / ipark / modulus function, the X-axis and Y-axis iteration values need to be multiplied by the constant respectively to obtain the final Cordic calculation value;

[0039] If the current Cordic calculates the cosh / sinh / std_dev function, the X-axis and Y-axis iteration values need to be multiplied by the constant respectively to obtain the final Cordic calculation value.

[0040] Compared with the prior art, the beneficial effects of the present invention are:

[0041] The present invention implements an area-saving Cordic implementation method. For special points where iteration ends early, a minimum error of 1 LSB is introduced according to the selected system function and working mode, the number of iterations is extended, the coefficient compensation value becomes a constant, and the use of a multiplier is avoided. The effect of the implementation scheme of the present invention is shown in Table 4. Five special points are selected and cosine is selected as the calculation function. This method only brings a small error gain to the final output result, but reduces the chip area and power consumption. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 For multiplier implementation Schematic diagram of the multiplication operation with the iteration result.

[0043] Figure 2 The figure is a schematic diagram of the working process of an area-saving cordic implementation method of the present invention. DETAILED DESCRIPTION

[0044] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] like Figure 2 As shown, this area-saving cordic implementation method includes the following working process:

[0046] N represents the preset number of Cordic iterations, i represents the current i-th iteration, and the initial value of i is 0.

[0047] The first step is to select the system function and working mode according to the type of function to be implemented. As shown in Appendix 1, when calculating the cosine / sine / park / ipark function, the system type is selected as the circular system and the working mode is selected as the rotation mode. At this time, the judgment condition for the iteration direction is ; When calculating atan2 / modulus / atan functions, select circular system as system type, vector mode as working mode, and the judgment condition of iteration direction is ; When calculating the mult function, select the linear system as the system type, the rotation mode as the working mode, and the judgment condition for the iteration direction is ; When calculating the div function, select the linear system as the system type, the vector mode as the working mode, and the judgment condition for the iteration direction is ; When calculating the cosh / sinh function, select the hyperbolic system as the system type, the rotation mode as the working mode, and the judgment condition for the iteration direction is ;When calculating atanh / std_dev / ln functions, select hyperbolic system as system type, vector mode as working mode, and the judgment condition of iteration direction is .

[0048] The second step is to determine d i The value of d i >0, perform forward iteration and go directly to step 4; d i <0, perform negative iteration and go directly to step 4; when d i =0, if Cordic calculates functions such as cosine / sine / park / ipark / modulus / cosh / sinh / std_dev, go to step 3, otherwise go to step 4.

[0049] The third step is to select the working mode according to the i An LSB (Least Significant Bit) error value is added to the value to allow the Cordic iteration process to continue. When working in the rotation mode, the iteration termination judgment condition is , so the error compensation needs to be added to the angle value Z:

[0050]

[0051]

[0052] When working in vector mode, the iteration termination judgment condition is , the error compensation value needs to be added to the coordinate value Y:

[0053]

[0054]

[0055] in, is the gain value of the angle value Z in the last iteration, The gain value of the coordinate value Y in the previous iteration, the Cordic sampling 31-bit width is quantized, and the error value The corresponding floating point value is 1 / 2 31 , after completing the third step, go directly to the fifth step.

[0056] The fourth step is to iterate the angle value Z and the coordinate value Y normally, as follows:

[0057] , corresponding to the rotation mode; , corresponding to the vector mode;

[0058] Proceed to step 5.

[0059] In the fifth step, it is judged whether the current iteration number i is equal to N. If i < N, it means that the specified iteration number has not been reached. Let i = i + 1 and enter the first step. If i = N, the iteration is completed and enter the sixth step for coefficient compensation.

[0060] In the sixth step, if the current Cordic calculates the cosine / sine / park / ipark / modulus function, the X-axis and Y-axis iteration values need to be multiplied by the constant (when quantized to 31 bits, the corresponding value is 1304065748) respectively to obtain the final Cordic calculation value. If the current Cordic calculates the cosh / sinh / std_dev function, the X-axis and Y-axis iteration values need to be multiplied by the constant (when quantized to 31 bits, the corresponding value is 1296540104) respectively to obtain the final Cordic calculation value. If the current Cordic calculates the remaining functions in Table 3, no coefficient compensation is required and the final Cordic calculation value can be obtained directly.

[0061] Table 3 is the system function and working mode table;

[0062] Table 3: System Function and Working Mode Table

[0063]

[0064] The present invention realizes a Cordic implementation method that saves area. For special points where iteration ends prematurely, according to the selected system function and working mode, a minimum error of 1 LSB is introduced, the iteration number is extended, and the coefficient compensation value becomes a constant, avoiding the use of a multiplier. The effect of the implementation solution of the present invention is shown in Table 4. Five special points are selected and the function is cosine. This method only brings a small error gain to the final output result, but reduces the chip area and power consumption overhead.

[0065] Table 4 is the effect table of the implementation solution of the five special points selected by the present invention and calculating with the cosine function;

[0066] Table 4: Table of Special Input Point Values and Error Gain Effects

[0067]

[0068] Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications once they know the basic creative concept. Therefore, the appended claims are intended to be construed to include the preferred embodiments and all changes and modifications falling within the scope of the present invention.

[0069] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. An area-saving cordic implementation method, characterized in that: In this cordic implementation method, N represents the preset number of Cordic iterations. When the number of iterations i does not reach N, and the judgment value of the iteration direction When it returns to 0, it means that the calculation has ended prematurely. At this time, the error value is introduced to force Cordic to return to 0 and enter forward rotation. After the number of iterations reaches N, the calculation is stopped and the coefficient will become a constant, and finally the Nth iteration value will be combined with Multiply them to get the final calculation result; in, represents the modulus gain of the circular system, Represents the modulus gain of the hyperbolic system, and the initial value of i is 0.

2. The area-saving cordic implementation method according to claim 1, characterized in that: When performing Cordic algorithm operations, this Cordic implementation method selects system functions and working modes according to the type of function to be implemented, specifically including: When calculating cosine / sine / park / ipark functions, the system type is selected as the circular system and the working mode is selected as the rotation mode; When calculating atan2 / modulus / atan functions, the system type is selected as the circular system and the working mode is selected as the vector mode; When calculating mult functions, the system type is selected as the linear system and the working mode is selected as the rotation mode; When calculating div functions, the system type is selected as the linear system and the working mode is selected as the vector mode; When calculating cosh / sinh functions, the system type is selected as the hyperbolic system and the working mode is selected as the rotation mode; When calculating atanh / std_dev / ln functions, the system type is selected as the hyperbolic system and the working mode is selected as the vector mode; When the working mode is selected as vector mode, the judgment condition of the iteration direction is ; When the working mode is selected as rotation mode, the judgment condition of the iteration direction is ; Among them, the judgment value of the iteration direction There are three situations: >0, <0 or =0.

3. The area-saving cordic implementation method according to claim 2, characterized in that: when =0, if Cordic calculates the cosine / sine / park / ipark / modulus / cosh / sinh / std_dev function; at this time, according to the working mode, Add an LSB error value to continue the Cordic iteration process; When working in rotation mode, the iteration termination judgment condition is , so the error compensation needs to be added to the angle value Z, that is: ; When working in vector mode, the iteration termination judgment condition is , so the error compensation value needs to be added to the coordinate value Y, that is: ; in, is the gain value of the angle value Z in the last iteration, The gain value of the coordinate value Y in the previous iteration, the Cordic sampling 31-bit width is quantized, and the error value The corresponding floating point value is ; Judge whether the current iteration number i is equal to N. If i < N, it means that the specified iteration number has not been reached. Let i = i + 1 and enter the first step; If i = N, the iteration is completed, and then coefficient compensation is performed.

4. The area-saving cordic implementation method according to claim 2, characterized in that: when >0, perform forward iteration; when <0, perform negative iteration; At this point, the angle value Z and the coordinate value Y are iterated normally, as follows: ; Judge whether the current iteration number i is equal to N. If i < N, it means that the specified iteration number has not been reached. Let i = i + 1 and enter the first step; If i = N, the iteration is completed, and then coefficient compensation is performed.

5. The area-saving cordic implementation method according to claim 3 or 4, characterized in that: The specific process of the coefficient compensation includes: If the current Cordic calculation is cosine / sine / park / ipark / modulus function, the X-axis and Y-axis iteration values ​​are required, which are respectively Multiply them to get the final Cordic calculation value; If the current Cordic calculation is cosh / sinh / std_dev function, the X-axis and Y-axis iteration values ​​are required, which are respectively Multiply them to get the final Cordic calculation value.

Citation Information

Patent Citations

  • Full-pipeline floating-point trigonometric function device based on combination of CORDIC and Taylor

    CN106202890A

  • Method and device for realizing 32-bit integer division with high precision and low time delay

    CN111813372A

  • Complex logarithm implementation method, device and equipment based on CORDIC algorithm, and computer storage medium

    CN113127802A

  • Operational multiplexing method and device for trigonometric function and hyperbolic function, chip, equipment and medium

    CN117633422A

  • Multi-mode trigonometric function operation circuit

    CN118132035A