Method and device for realizing CORDIC
By automatically selecting whether to skip the initial iteration according to the size of the target angle in the CORDIC algorithm, the problem of proportionality of iteration order and accuracy in the CORDIC hardware implementation is solved, and higher calculation accuracy is achieved under the same resource conditions.
Patent Information
- Application Number
- CN202311395903.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-25
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2043-10-25
AI Technical Summary
In hardware implementation, the CORDIC algorithm is proportional to the accuracy, and the reduction in the iteration order will lead to accuracy loss when resources are limited or time is tight.
By determining whether the absolute value of the target angle is within the set threshold range, it is automatically selected whether to skip the initial few CORDIC iteration operations and perform step jump or full-order CORDIC iteration operations to improve the calculation accuracy.
With the same computing resources, a small number of control circuits are added to enable CORDIC to obtain higher accuracy and reduce the impact of iteration order on accuracy.
Smart Images

Figure CN119883190A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method and device for implementing CORDIC. Background Art
[0002] Trigonometric functions are among the basic elementary functions. Traditionally, trigonometric functions and other functions that are difficult to implement in hardware have been calculated using table lookup, polynomial expansion, or approximation methods. The CORDIC (Coordinate Rotation Digital Computer) algorithm can recursively calculate the values of common functions such as sin, cos, sinh, and cosh through shifting and addition and subtraction operations. In other words, there is no need to expand or decompose complex functions; the function value can be solved by simple and crude addition and shifting iterations. Because only addition and shifting operations are required, it is very conducive to hardware implementation. Using the CORDIC algorithm in navigation systems can eliminate the need for complex operations such as looking up trigonometric tables, multiplication, square root extraction, and inverse trigonometric functions to perform vector rotation and orientation operations.
[0003] CORDIC has three coordinate systems: circular, hyperbolic, and linear, and two working modes: rotation and vector. Different systems and modes have different applications.
[0004] Figure 1 The process of solving the 30° sine and cosine values using the CORDIC circular system and rotation mode is based on the principle of using (1,0) as the initial vector and rotating it towards the 30° angle vector. The approximation method is based on the residual angle z (i) Rotate the preset angle θ (i) , so that the remaining angle continues to approach 0. In order to facilitate the implementation of CORDIC hardware, the preset angle will select the arc tangent value of 2 to the power of a negative integer.
[0005] The iteration formula is as follows:
[0006]
[0007]
[0008] Among them, d i When it is +1, it means counterclockwise rotation, and when it is -1, it means clockwise rotation. z is initialized to the target rotation angle θ, that is, z0 = θ. The iterative process of z is the process of converging z to 0. i It can be considered as the remaining angle of the i-th rotation.
[0009] From the rotation diagram or iterative formula above, we can see that iterative rotation is a pseudo-rotation. The initial vector is (1,0). The modulus of the vector will change during the rotation process, and the true sine and cosine values need to be mapped to the unit circle. Therefore, after the iteration is completed, x and y need to be multiplied by a scaling factor. In order to achieve the function of outputting sinz for y and cosz for x, an effective way to avoid the multiplication of the scaling factor is to directly set the initial vector to (K, 0).
[0010] There are two hardware implementation methods for CORDIC: single-stage iteration and multi-stage pipeline. The single-stage iteration method consumes less resources, but the iteration time is long; the pipeline method has higher latency and hardware resource consumption. In practical applications, most people choose the pipeline method to implement CORDIC hardware circuits, such as Figure 2 The division of x and y by 2 is accomplished by shifting, and the preset angle is achieved by looking up a table or setting it as a constant.
[0011] The CORDIC implementation principle shows that the hardware resources used by pipelined CORDIC implementations are proportional to the number of iterations. The processing time and accuracy of single-stage iterations are proportional to the number of iterations. Therefore, reducing the number of iterations to save hardware computing resources or computation time inevitably results in a loss of accuracy. Summary of the Invention
[0012] The embodiments of the present invention provide a method and apparatus for implementing CORDIC to improve the calculation accuracy of CORDIC.
[0013] To this end, the embodiments of the present invention provide the following technical solutions:
[0014] In one aspect, an embodiment of the present invention provides a method for implementing CORDIC, the method comprising:
[0015] Get the target angle;
[0016] Determining whether the absolute value of the target angle is within a set threshold range;
[0017] If yes, then perform the skip-order CORDIC iteration operation;
[0018] Otherwise, perform full-order CORDIC iteration operation;
[0019] The full-order CORDIC iterative operation refers to performing CORDIC iterative operations of orders 0 to n; the skipped-order CORDIC iterative operation refers to skipping CORDIC iterative operations of orders 0 to m and performing CORDIC iterative operations of orders m+1 to n+m+1, where m is 0 or a positive integer.
[0020] Optionally, there are multiple threshold ranges, and different threshold ranges correspond to different values of m.
[0021] Optionally, the threshold range includes: a first threshold range and a second threshold range; the first threshold range is [0.5, 0.9375), and the second threshold range is [0, 0.5), and the unit is radian;
[0022] The CORDIC iterative operation for performing step skipping includes:
[0023] When the absolute value of the target angle is within the first threshold range, skipping the 0th order CORDIC iterative operation and performing 1st to n+1th order CORDIC iterative operations;
[0024] When the absolute value of the target angle is within the second threshold range, the 0th and 1st order CORDIC iterative operations are skipped, and the 2nd to n+2nd order CORDIC iterative operations are performed.
[0025] Optionally, the CORDIC iterative operation includes: a CORDIC iterative operation in a set coordinate system and a rotation working mode, and the set coordinate system is any one of the following: circular, hyperbolic, and linear.
[0026] Optionally, the CORDIC iterative operation is performed in any one of the following ways: a single-stage iterative method and a multi-stage pipeline method.
[0027] On the other hand, an embodiment of the present invention further provides a device for implementing CORDIC, the device comprising: a judgment module, a control module, and an iterative operation module; the iterative operation module comprises three channels, x, y, and z, of n+1 stages, wherein the x and y channels of each stage comprise a shifter and an adder, and the z channel of each stage comprises an adder;
[0028] The judgment module is used to obtain a target angle and generate a control signal according to the target angle;
[0029] The iterative operation module is configured to determine the shift numbers of the x and y channel shifters of the first stage according to the control signal, so as to perform a skip-order CORDIC iterative operation or a full-order CORDIC iterative operation; the full-order CORDIC iterative operation refers to performing a CORDIC iterative operation of orders 0 to n; the skip-order CORDIC iterative operation refers to skipping the CORDIC iterative operation of orders 0 to m and performing a CORDIC iterative operation of orders m+1 to n+m+1, where m is 0 or a positive integer;
[0030] The control module is used to control the preset angles of the z channels of all stages according to the control signal.
[0031] Optionally, the control module includes: an n+1-stage m+1-to-one multiplexer;
[0032] The multiplexer of the i-th stage inputs the i-th, i+1, and i+2-th order preset angles respectively, selects one of the preset angles according to the control signal and outputs it to the adder of the z channel of the i-th stage, i <n。
[0033] Optionally, the judgment module is specifically configured to output the control signal according to a threshold range within which the absolute value of the target angle lies.
[0034] Optionally, the threshold range includes: a first threshold range and a second threshold range; the first threshold range is [0.5, 0.9375), and the second threshold range is [0, 0.5), and the unit is radian;
[0035] The judgment module outputs a first control signal when the absolute value of the target angle is within the first threshold range; outputs a second control signal when the absolute value of the target angle is within the second threshold range; and outputs a full-order control signal in other cases.
[0036] Optionally, the iterative operation module performs CORDIC iterative operation in a set coordinate system and rotation working mode, and the set coordinate system is any one of the following: circular, hyperbolic, and linear.
[0037] Optionally, the iterative operation module implements CORDIC iterative operation in a single-stage circuit iteration manner, or implements CORDIC iterative operation in a multi-stage circuit pipeline manner.
[0038] The CORDIC implementation method and apparatus provided by the present invention, through a concrete mathematical analysis of the angular relationships involved in CORDIC rotation iterations, concludes that the rotation iteration process is equivalent to approximating the target angle using a combination of addition and subtraction of preset angles. Based on this, the method and apparatus automatically select whether to skip the initial iterations based on the input angle. Compared to existing basic CORDIC iteration schemes, the present invention achieves higher CORDIC accuracy with the same computing resources, requiring only a small amount of additional control circuitry. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 This is the process of solving the 30° sine and cosine values using the CORDIC circular system and rotation mode in the prior art;
[0040] Figure 2 It is a schematic diagram of the structure of the CORDIC hardware circuit implemented by the pipeline method in the prior art;
[0041] Figure 3is a flowchart of a method for implementing CORDIC provided by an embodiment of the present invention;
[0042] Figure 4 This is a principle block diagram of a device for implementing CORDIC according to an embodiment of the present invention;
[0043] Figure 5 It is a schematic diagram of the structure of the hardware circuit for implementing CORDIC in the prior art;
[0044] Figure 6 1 is a schematic diagram of a specific structure of a device for implementing CORDIC according to an embodiment of the present invention;
[0045] Figure 7 It is a statistical diagram of absolute value errors when sinx is realized using a full-order CORDIC and a skip-order CORDIC according to the solution of the present invention. DETAILED DESCRIPTION
[0046] The principles and spirit of the present invention will be described below with reference to the exemplary embodiments shown in the accompanying drawings. It should be understood that these embodiments are described only to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way.
[0047] From the front Figure 1 As shown in the principle, in the circular system rotation mode, CORDIC iteratively approaches the target by rotating +45°, -26.6°, +14°, etc. In fact, this process is equivalent to adding and subtracting a combination of preset angles to obtain a θ total The process of approximating the target angle:
[0048] θ total =d0*θ0+d1*θ1+……+d n *θ n ≈z0(s i ∈{-1,1}) (1)
[0049] Among them, θ i is the preset angle for the i-th iteration, d i is the rotation direction of the i-th iteration, and its value can only be +1 or -1, which is determined by the positive or negative value of z at each order.
[0050] The range of target angle z0 that can be covered by the preset angle in the above iterative calculation is
[0051] From the above iterative formula, we can see that when the input angle z0 is small, such as z0 = 30°, 20°, 10°, etc., the 0th order 45° is not needed, and even the first two orders of 45° and 26.6° are not needed. The subsequent preset angles can also be used to achieve this. That is, the iterative formula can be simplified to:
[0052] θ total =d2*θ2+d3*θ3+……+d n *θ n ≈z0 (2)
[0053] That is to say, when the hardware resources are fixed, for example, an 8-stage pipeline executes stages 0-7, and skips stage 0 or the first two stages, the 8-stage circuit can actually execute stages 1-8 and 2-9. Take 20° as an example:
[0054] The basic CORDIC iteration process is:
[0055] 45°-26.6°+14°-7.1°-3.6°-1.8°+0.9°-0.4°≈20.4°;
[0056] The iterative process of skipping the first iteration is:
[0057] 0°+26.6°-14°+7.1°+3.6°-1.8°-0.9°-0.4°+0.2°≈20°;
[0058] It can be seen that in some cases, the target angle can be approximated by permutations and combinations of subsequent order preset angles without using the 0th order 45°, and the accuracy is higher.
[0059] To this end, an embodiment of the present invention provides a method and apparatus for implementing CORDIC. When the iteration order is determined or the hardware resources are certain, when the input angle is small, the 0th or the first two iterations of 0 to n iterations are skipped, and 1 to n+1 or 2 to n+2 iterations are executed instead, using a relatively small set of preset angles to achieve more detailed and accurate rotation, thereby improving accuracy; in other cases, the original CORDIC iteration is used.
[0060] like Figure 3 FIG. 1 is a flowchart of a method for implementing CORDIC provided by an embodiment of the present invention, comprising the following steps:
[0061] Step 301: Acquire the target angle.
[0062] Step 302 , determining whether the absolute value of the target angle is within a set threshold range; if so, executing step 303 ; otherwise, executing step 304 .
[0063] Step 303: Execute a skip-order CORDIC iterative operation.
[0064] Step 304: Perform full-order CORDIC iterative operations.
[0065] The full-order CORDIC iterative operation refers to performing CORDIC iterative operations of orders 0 to n; the skip-order CORDIC iterative operation refers to skipping CORDIC iterative operations of orders 0 to m and performing CORDIC iterative operations of orders m+1 to n+m+1, where m is 0 or a positive integer.
[0066] In a specific application, there may be multiple threshold ranges, and different threshold ranges may correspond to different values of m. That is, the skipped CORDIC iteration operation may start from the 0th order and skip one or more order iteration operations.
[0067] The following takes a maximum jump number of 2 as an example for description.
[0068] When the target angle z0 satisfies the condition 0.5≤|z0|<0.9375, it is considered to be a small number and the first order is skipped;
[0069] When the target angle z0 satisfies the condition |z0|<0.5, it is considered to be a very small number and the first two orders are skipped;
[0070] When the target angle z0 takes other values, the skip operation is not performed, that is, the original 0 to n order CORDIC iteration operation is still performed.
[0071] To this end, in a non-limiting embodiment, two threshold ranges may be set, namely, a first threshold range [0.5, 0.9375) and a second threshold range [0, 0.5]. Accordingly, the skipped CORDIC iteration operation performed in step 303 includes the following two cases:
[0072] When the absolute value of the target angle is within the first threshold range, skipping the 0th order CORDIC iterative operation and performing 1st to n+1th order CORDIC iterative operations;
[0073] When the absolute value of the target angle is within the second threshold range, the 0th and 1st order CORDIC iterative operations are skipped, and the 2nd to n+2nd order CORDIC iterative operations are performed.
[0074] The unit of the above angle values is radian (rad). The units of the angles involved below are the same and will not be explained one by one.
[0075] It should be noted that the CORDIC implementation method provided by the present invention can implement CORDIC iterative operations in a predetermined coordinate system and rotational operating mode. The predetermined coordinate system can be any of the following: circular, hyperbolic, or linear. Furthermore, the hardware implementation can be implemented using a single-stage iteration approach or a multi-stage pipeline approach, which is not limited in this embodiment of the present invention.
[0076] Accordingly, an embodiment of the present invention further provides a device for implementing CORDIC, such as Figure 4 As shown in FIG. , it is a functional block diagram of the device for implementing CORDIC.
[0077] The device for implementing CORDIC includes a determination module 401, a control module 402, and an iterative operation module 403. The iterative operation module 403 includes three channels, x, y, and z, at n+1 levels. Each x and y channel at each level includes a shifter and an adder (not shown), and each z channel at each level includes an adder (not shown).
[0078] In this embodiment, the judgment module 401 is used to obtain the target angle z0 and generate a control signal according to the target angle z0; at the same time, the target angle z0 needs to be output to the first-level z channel of the iterative operation module 403 to participate in the iterative operation of the z channel.
[0079] The iterative operation module 403 is configured to determine the shift amounts of the first-stage x and y channel shifters according to the control signal, so as to perform a skipped-order CORDIC iterative operation or a full-order CORDIC iterative operation. The full-order CORDIC iterative operation refers to performing a CORDIC iterative operation from orders 0 to n; the skipped-order CORDIC iterative operation refers to skipping the CORDIC iterative operation from orders 0 to m and performing a CORDIC iterative operation from orders m+1 to n+m+1, where m is 0 or a positive integer.
[0080] In this embodiment, the control module 402 is configured to control the preset angles of the z channels of all stages according to the control signal.
[0081] In a specific implementation, the judgment module 401 can be implemented by a comparator, and the control module 402 can be implemented by an n+1-stage m+1-to-one multiplexer, that is, the multiplexer has m+1 inputs and one output. For the i-th stage multiplexer, the i-th, i+1-th, and i+2-th order preset angles are input respectively, and one of the preset angles is selected according to the control signal and output to the adder of the z channel of the i-th stage, i <n。
[0082] According to the description of the method of the present invention, one or more different threshold ranges can be set to determine whether to perform skip-order CORDIC iterative operation or full-order CORDIC iterative operation based on whether the target angle is within the set threshold range.
[0083] Accordingly, the judgment module 401 may output the control signal according to the threshold range within which the absolute value of the target angle falls.
[0084] For example, the maximum number of jump steps is set to 2. Accordingly, a first threshold range and a second threshold range can be set, where the first threshold range is [0.5, 0.9375) and the second threshold range is [0, 0.5). Accordingly, the judgment module 401 outputs a first control signal when the absolute value of the target angle is within the first threshold range; outputs a second control signal when the absolute value of the target angle is within the second threshold range; and outputs a full-step control signal in other cases.
[0085] The first control signal controls the iterative operation module 403 to skip the 0th order CORDIC iterative operation and perform the 1st to n+1th order CORDIC iterative operations.
[0086] The second control signal controls the iterative operation module 403 to skip the 0th and 1st order CORDIC iterative operations and perform the 2nd to n+2nd order CORDIC iterative operations.
[0087] It should be noted that the iterative operation module 403 can perform CORDIC iterative operation in a set coordinate system and rotation working mode, and the set coordinate system is any one of the following: circular, hyperbolic, and linear.
[0088] The following further describes the differences between the apparatus for implementing CORDIC of the present invention and the existing hardware circuits for implementing CORDIC in conjunction with specific hardware circuits.
[0089] like Figure 5 As shown, Figure 5 It is a structural diagram of a hardware circuit for implementing CORDIC in the prior art.
[0090] It should be noted that in order to make the diagram clearer and more concise, Figure 5 Only the first two levels of hardware structure for implementing CORDIC are shown in FIG. Figure 5 The direction of rotation d is ignored i production and control.
[0091] Reference Figure 5 For the x and y paths, each hardware level consists of a shifter and an adder ADD. At the 0th level of the hardware, which is the 0th order of the CORDIC iteration, no shifting is required, so the 0th level hardware shifter is shifted to 0. The shift operations of the shifters of all subsequent levels are as follows:
[0092] If no skipping occurs, the circuit at level i is shifted right by i bits;
[0093] In the case of skipping the 0th stage, the i-th stage circuit is shifted right by i+1 bits;
[0094] In the case of skipping the 0th and 1st stages, the i-th stage circuit is shifted right by i+2 positions;
[0095] And so on….
[0096] For the z channel, each stage has only one adder ADD, one addend is the output of the adder of the previous stage, and the other addend is the binary number of the preset angle.
[0097] like Figure 6 FIG. 1 is a schematic diagram of a specific structure of a device for implementing CORDIC according to an embodiment of the present invention.
[0098] and Figure 5 Compared with the prior art, the device for implementing CORDIC in the present invention adds a judgment module 401 , and controls the preset angles output to each level of z channel through a control module 402 .
[0099] Figure 6 In the illustrated embodiment, determination module 401 generates a corresponding control signal based on the input target angle z0. Each stage of the multiplexer in control module 402 is a three-to-one multiplexer. Inputs 0, 1, and 2 of stage 0 represent the preset angles of levels 0, 1, and 2, respectively. Similarly, inputs 0, 1, and 2 of stage 1 represent the preset angles of levels 1, 2, and 3, respectively, and so on.
[0100] Assuming the maximum number of jumps is 2, then:
[0101] When 0.5≤|z0|<0.9375, the judgment module 401 generates a first control signal, which is denoted as s=1;
[0102] When |z0|<0.5, the judgment module 401 generates a second control signal, denoted as s=2;
[0103] In the case of 0.9375≤|z0|, the judgment module 401 generates a full-order control signal, which is denoted as s=0.
[0104] Accordingly, under the control of the first control signal, each multiplexer in the control module 402 selects the first output, that is, skips the 0th order iterative operation; under the control of the second control signal, selects the second output, that is, skips the first two orders of iterative operations; under the control of the full-order control signal, selects the 0th output and performs a full-order iterative operation.
[0105] In addition, the above control signal will also control the shift number of the first-level hardware of the iterative operation module 403. The shift number is related to the value of the above control signal, that is, when s=0, there is no shift, that is, the shift number is 0; when s=1, the shift number is 1; when s=2, the shift number is 2.
[0106] It should be noted that, in specific applications, the iterative operation module 403 may implement CORDIC iterative operation in a single-stage circuit iteration manner, or in a multi-stage circuit pipeline manner, which is not limited in this embodiment of the present invention.
[0107] Although the above embodiment illustrates the present invention by taking skipping 2 steps as an example, the present invention does not limit the maximum number of skipped steps. For example, when the target angle is within a certain threshold range smaller than 0.5, more initial steps are skipped. The number of threshold ranges is not limited, as long as the preset angles of the remaining steps after skipping the initial steps can be combined into the target angle. For example, data such as 0.25, 0.125, etc. divided by 2 can be selected as the range boundaries. In terms of hardware implementation, it is only necessary to add more judgment conditions to the judgment module and use a multiplexer with more inputs for the preset angle selection of the z channel.
[0108] In addition, it should be noted that CORDIC performs a pseudo rotation with the initial vector being (1,0), and the final result needs to be multiplied by the scaling factor For example, the initial vector can be set to (K, 0) to achieve equivalent calculation, thereby avoiding multiplication operations. In the CORDIC that uses the solution of the present invention to implement adaptive step skipping, the selection of the initial values x0 and y0 can also be controlled by the above control signal s, K0 = K, K0 represents the original scaling factor, K1 represents the scaling factor for skipping the 0th iteration, and K2 represents the scaling factor for skipping the first two iterations.
[0109] The CORDIC implementation method and apparatus provided by the present invention, through a concrete mathematical analysis of the angular relationships involved in CORDIC rotation iterations, concludes that the rotation iteration process is equivalent to approximating the target angle using a combination of addition and subtraction of preset angles. Based on this, the method and apparatus automatically select whether to skip the initial iterations based on the input angle. Compared to existing basic CORDIC iteration schemes, the present invention achieves higher CORDIC accuracy with the same computing resources, requiring only a small amount of additional control circuitry.
[0110] Compared with the basic CORDIC in the prior art, the solution of the present invention can achieve higher accuracy of CORDIC by adding only a small amount of control circuits under the condition of the same computing resources.
[0111] Figure 7This is a statistical graph of the absolute value errors when implementing sinx using normal CORDIC (i.e., full-order CORDIC) and the step-skipped CORDIC solution of the present invention. The absolute value error of the basic CORDIC is above the x-axis, and the absolute value error (negative) of the CORDIC after adaptive step-skipping using the solution of the present invention is below the x-axis. The iteration order is set to 8. To fully simulate the hardware behavior, 16-bit fixed-point numbers are used for numerical initialization and calculation. The data is composed of a 2-bit integer plus a 14-bit decimal. The simulation software is Python.
[0112] Depend on Figure 7 It can be seen that when the absolute value of the angle is greater than 0.9375, the absolute value errors of the two methods are exactly the same. However, within two sub-intervals of the input range, the absolute value error of the sine obtained by using the adaptive step skipping method CORDIC is several times different from that of the normal CORDIC.
[0113] In specific implementations, the modules / units included in the various devices and products described in the above embodiments may be software modules / units, hardware modules / units, or partly software modules / units and partly hardware modules / units.
[0114] For example, for each device or product applied to or integrated into a chip, each module / unit contained therein may be implemented in the form of hardware such as circuits, or at least some of the modules / units may be implemented in the form of software programs, which run on a processor integrated inside the chip, and the remaining (if any) modules / units may be implemented in the form of hardware such as circuits; for each device or product applied to or integrated into a chip module, each module / unit contained therein may be implemented in the form of hardware such as circuits, and different modules / units may be located in the same component (such as a chip, circuit module, etc.) or different components of the chip module, or at least some of the modules / units may be implemented in the form of software programs. The element can be implemented in the form of a software program, which runs on the processor integrated inside the chip module, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated in the terminal, the various modules / units contained therein can be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component (for example, chip, circuit module, etc.) or different components in the terminal, or, at least some modules / units can be implemented in the form of a software program, which runs on the processor integrated inside the terminal, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits.
[0115] Although the present invention is disclosed as above, the present invention is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention should be based on the scope defined by the claims.
Claims
1. A method for implementing CORDIC, characterized in that: The method comprises: Get the target angle; Determining whether the absolute value of the target angle is within a set threshold range; If yes, then perform the CORDIC iteration operation with skip order; Otherwise, perform full-order CORDIC iteration operations; The full-order CORDIC iterative operation refers to performing CORDIC iterative operations of orders 0 to n; the skip-order CORDIC iterative operation refers to skipping CORDIC iterative operations of orders 0 to m and performing CORDIC iterative operations of orders m+1 to n+m+1, where m is 0 or a positive integer.
2. The method for implementing CORDIC according to claim 1, characterized in that: There are multiple threshold ranges, and different threshold ranges correspond to different values of m.
3. The method for implementing CORDIC according to claim 2, characterized in that: The threshold range includes: a first threshold range and a second threshold range; the first threshold range is [0.5, 0.9375), the second threshold range is [0, 0.5), unit: radian; The CORDIC iterative operation for performing the step skipping includes: When the absolute value of the target angle is within the first threshold range, skip the 0th order CORDIC iterative operation and perform the 1st to n+1th order CORDIC iterative operations; When the absolute value of the target angle is within the second threshold range, the 0th and 1st order CORDIC iterative operations are skipped, and the 2nd to n+2nd order CORDIC iterative operations are performed.
4. The method for implementing CORDIC according to any one of claims 1 to 3, characterized in that: The CORDIC iterative operation includes: CORDIC iterative operation in a set coordinate system and rotation working mode, wherein the set coordinate system is any one of the following: circular, hyperbolic, linear.
5. The method for implementing CORDIC according to claim 4, characterized in that: The CORDIC iterative operation may be performed in any of the following ways: a single-stage iterative method or a multi-stage pipeline method.
6. A device for implementing CORDIC, characterized in that: The device comprises: a judgment module, a control module, and an iterative operation module; the iterative operation module comprises three channels of x, y, and z of n+1 levels, each of the x and y channels of each level comprises a shifter and an adder, and each of the z channels of each level comprises an adder; The judgment module is used to obtain a target angle and generate a control signal according to the target angle; The iterative operation module is used to determine the shift numbers of the x and y two-channel shifters of the first stage according to the control signal to perform a skip-order CORDIC iterative operation or a full-order CORDIC iterative operation; the full-order CORDIC iterative operation refers to performing a 0- to n-order CORDIC iterative operation; the skip-order CORDIC iterative operation refers to skipping the 0- to m-order CORDIC iterative operation and performing an m+1- to n+m+1-order CORDIC iterative operation, where m is 0 or a positive integer; The control module is used to control the preset angles of the z channels of all stages according to the control signal.
7. The device for implementing CORDIC according to claim 6, characterized in that: The control module comprises: an n+1-level m+1-to-one multiplexer; The multiplexer of the i-th stage inputs the i-th, i+1-th, and i+2-th order preset angles respectively, and selects one of the preset angles according to the control signal and outputs it to the adder of the z channel of the i-th stage. <n。 8. The device for implementing CORDIC according to claim 7, characterized in that: The judgment module is specifically configured to output the control signal according to a threshold range within which the absolute value of the target angle lies.
9. The device for implementing CORDIC according to claim 8, characterized in that: The threshold range includes: a first threshold range and a second threshold range; the first threshold range is [0.5, 0.9375), the second threshold range is [0, 0.5), unit: radian; The judgment module outputs a first control signal when the absolute value of the target angle is within the first threshold range; outputs a second control signal when the absolute value of the target angle is within the second threshold range; and outputs a full-order control signal in other cases.
10. The device for implementing CORDIC according to any one of claims 6 to 9, characterized in that: The iterative operation module performs CORDIC iterative operation in a set coordinate system and a rotation working mode, and the set coordinate system is any one of the following: circular, hyperbolic, and linear.
11. The device for implementing CORDIC according to claim 10, characterized in that: The iterative operation module implements CORDIC iterative operation in a single-stage circuit iteration mode, or implements CORDIC iterative operation in a multi-stage circuit pipeline mode.
Citation Information
Patent Citations
Method for generating weight value of intelligent antenna and base station
CN101834648A
High-precision sine / cosine function computing method based on Euler's formula
CN103065039A
Computing method of high-precision sine / cosine function
CN103365827A
Detection of end effector emersion in liquid
CN111526816A
Mechanisms for controlling different electromechanical systems of electrosurgical instrument
CN111526820A