Method and apparatus for implementing cordic
By selectively skipping the initial iteration order in the CORDIC algorithm based on the absolute value range of the target angle, and employing skip-order iterative operations, the problems of high resource consumption and insufficient accuracy in the hardware implementation of the CORDIC algorithm are solved, achieving higher computational accuracy and shorter iteration time.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-25
- Publication Date
- 2026-03-27
AI Technical Summary
Existing CORDIC algorithms suffer from high computational resource consumption, long iteration time, and insufficient accuracy in hardware implementations, especially when calculating small angles.
By determining the absolute value range of the target angle, the initial iteration order is selectively skipped, and a skip-order CORDIC iterative operation is adopted. Combined with the addition and subtraction of preset angles, higher calculation accuracy is achieved.
With the same computing resources, the accuracy of CORDIC calculations is improved, while hardware resource consumption and iteration time are reduced.
Smart Images

Figure CN119883190B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, in particular to a method and device for realizing CORDIC. BACKGROUND
[0002] Trigonometric functions are one of the basic elementary functions. Traditionally, the trigonometric functions and other functions which are not easy to be realized by hardware are calculated by using table lookup, polynomial expansion or approximation method. The CORDIC (Coordinate Rotation Digital Computer) algorithm can recursively calculate the values of common functions such as sin, cos, sinh, cosh and other functions through shift and addition-subtraction operations. That is, the function values can be solved by using simple and rough addition and shift iteration without expanding or decomposing the complex functions. Since only addition and shift operations are needed, it is very beneficial to hardware implementation. When the CORDIC algorithm is used in a navigation system, the rotation and orientation operations of vectors do not need to do complex operations such as looking up trigonometric function table, multiplication, square root and inverse trigonometric function.
[0003] The CORDIC has three coordinate systems of circle, hyperbola and line and two working modes of rotation and vector, and has different applications in different systems and modes.
[0004] Figure 1 For solving the 30° sine and cosine values in the CORDIC circle system and rotation mode, the principle is to rotate the initial vector (1, 0) to the 30° angle vector, and the approximation method is based on the remaining angle z (i) Rotating a preset angle θ (i) The remaining angle is constantly approximated to 0. In order to facilitate the hardware implementation of CORDIC, the inverse tangent value of the negative integer power of 2 is selected as the preset angle.
[0005] The iteration formula is as follows:
[0006]
[0007]
[0008] Wherein, d i is +1, indicating counterclockwise rotation, and -1, indicating clockwise rotation. z is initialized as the target rotation angle θ, that is, z0= θ. The iteration process of z is to converge z to 0. z i can be considered as the remaining angle of the i-th rotation.
[0009] From the above rotation diagram or iteration formula, it can be seen that the iterative rotation is a pseudo-rotation, the initial vector is (1, 0), and the length of the vector will change in the rotation process, and the true sine value and cosine value need to be mapped on the unit circle, so after the iteration is completed, x and y need to be multiplied by a scaling factor to realize the function of y output sinz and x output cosz. An effective method to avoid scaling factor multiplication is to directly set the initial vector as (K, 0).
[0010] The hardware implementation methods of CORDIC include 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 high delay and high hardware resource consumption. In actual applications, most of the pipeline method is selected to realize the CORDIC hardware circuit, as shown in the formula (1). Figure 2 The division by 2 operation of x and y is completed by shifting, and the preset angle is realized by table lookup or setting as a constant.
[0011] From the implementation principle of CORDIC, the hardware resources used to realize CORDIC by the pipeline method are proportional to the iteration number, the processing time of the CORDIC operation realized by the single-stage iteration method is proportional to the iteration number, and the precision is also proportional to the iteration number. Therefore, in order to save hardware calculation resources or calculation time and reduce the iteration order, the precision will be inevitably lost. SUMMARY
[0012] Embodiments of the present application provide a method and device for realizing CORDIC to improve the calculation precision of CORDIC.
[0013] To this end, embodiments of the present application provide the following technical solutions:
[0014] In one aspect, the embodiments of the present application provide a method for realizing CORDIC, which comprises:
[0015] obtaining a target angle;
[0016] judging whether the absolute value of the target angle is within a set threshold range;
[0017] if yes, performing a jump-order CORDIC iteration operation;
[0018] otherwise, performing a full-order CORDIC iteration operation;
[0019] The full-order CORDIC iteration operation refers to performing a 0 to n order CORDIC iteration operation; the jump-order CORDIC iteration operation refers to skipping the 0 to m order CORDIC iteration operation and performing a m+1 to n+m+1 order CORDIC iteration operation, and m is 0 or a positive integer.
[0020] Optionally, the threshold range has 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), unit: radian.
[0022] The CORDIC iteration operation of the execution of the jump stage includes:
[0023] When the absolute value of the target angle is in the first threshold range, the CORDIC iteration operation of the 0th stage is skipped, and the CORDIC iteration operation of the 1st to n+1th stages is executed.
[0024] When the absolute value of the target angle is in the second threshold range, the CORDIC iteration operation of the 0th and 1st stages is skipped, and the CORDIC iteration operation of the 2nd to n+2th stages is executed.
[0025] Optionally, the CORDIC iteration operation includes a CORDIC iteration 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 execution mode of the CORDIC iteration operation includes any one of the following: a single-stage iteration mode and a multi-stage pipeline mode.
[0027] In another aspect, the embodiment of the present application also provides a device for implementing CORDIC, which includes a judgment module, a control module, and an iteration operation module; the iteration operation module includes n+1 stages of x, y, and z channels, each stage of the x and y channels includes a shifter and an adder, and each stage of the z channel includes 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 iteration operation module is used to determine the number of shifts of the shifters of the first stage of the x and y channels according to the control signal, so as to execute the jump-stage CORDIC iteration operation or the full-stage CORDIC iteration operation; the full-stage CORDIC iteration operation refers to the execution of the 0th to n th CORDIC iteration operation; the jump-stage CORDIC iteration operation refers to the skipping of the 0th to m th CORDIC iteration operation and the execution of the m+1th to n+m+1th CORDIC iteration operation, and m is 0 or a positive integer.
[0030] The control module is used to control the preset angle of the z channel of all stages according to the control signal.
[0031] Optionally, the control module comprises: an m+1 one-of-many multiplexer of n+1 stages.
[0032] The multiplexer of the i-th stage respectively inputs preset angles of i-th, i+1-th and i+2-th stages, and outputs one of the preset angles to an adder of the z channel of the i-th stage according to the control signal, where i < n.
[0033] Optionally, the judging module is specifically configured to output the control signal according to a threshold range in which an absolute value of the target angle is located.
[0034] Optionally, the threshold range comprises: 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), unit: radian.
[0035] The judging module outputs a first control signal when the absolute value of the target angle is in the first threshold range, outputs a second control signal when the absolute value of the target angle is in the second threshold range, and outputs a full-stage control signal in other cases.
[0036] Optionally, the iteration operation module performs CORDIC iteration 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.
[0037] Optionally, the iteration operation module implements CORDIC iteration operation in a single-stage circuit iteration mode or a multi-stage circuit pipeline mode.
[0038] The method and device for implementing CORDIC provided in the embodiments of the present application, by means of mathematical embodiment analysis on the angle relationship of CORDIC rotation iteration, conclude that the rotation iteration process is equivalent to the conclusion that the target angle is approximated by the addition and subtraction combination of preset angles, and then automatically select whether to skip the iteration process of the initial stage according to the size of the input angle. Compared with the existing basic CORDIC iteration scheme, the present scheme only needs to increase a small amount of control circuit under the condition of the same calculation resource, so as to make CORDIC have higher precision. BRIEF DESCRIPTION OF DRAWINGS
[0039] Figure 1 is a process for solving 30° sine and cosine values in the CORDIC circular system and rotation mode in the prior art;
[0040] Figure 2 is a structural schematic diagram of a CORDIC hardware circuit implemented by a pipeline method in the prior art;
[0041] Figure 3This is a flowchart of a method for implementing CORDIC provided in an embodiment of the present invention;
[0042] Figure 4 This is a schematic block diagram of the device for implementing CORDIC according to an embodiment of the present invention;
[0043] Figure 5 This is a schematic diagram of the hardware circuit structure for implementing CORDIC in the prior art;
[0044] Figure 6 This 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 This is a statistical graph of the absolute value error when implementing sinx using full-order CORDIC and the skip-order CORDIC scheme of this invention. Detailed Implementation
[0046] The principles and spirit of the invention will now be described with reference to exemplary embodiments shown in the accompanying drawings. It should be understood that these embodiments are described merely to enable those skilled in the art to better understand and implement the invention, and are not intended to limit the scope of the 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 successively by +45°, -26.6°, +14°, and so on. In fact, this process is equivalent to adding and subtracting preset angle combinations 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] Where, θ i Let d be the preset angle for the i-th iteration. i The rotation direction for the i-th iteration can only be +1 or -1, determined by the sign of the z-value 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] As can be seen from the above iterative formula, when the input angle z0 is small, such as z0 = 30°, 20°, 10°, etc., the 0th order 45° is not needed, or even the first two orders 45° and 26.6° are not needed. Subsequent preset angles can be used instead. That is, the iterative formula can be simplified to:
[0052] θ total = d2*θ2+ d3*θ3+…+ dn*θn n *θ n ≈ z0 (2)
[0053] That is, when the hardware resources are fixed, such as 8-stage pipeline executing 0-7 orders, skipping the 0th order or the first 2 orders, the 8-stage circuit can actually execute 1-8 orders, 2-9 orders. Taking 20° as an example:
[0054] The basic CORDIC iteration process is as follows:
[0055] 45°-26.6°+14°-7.1°-3.6°-1.8°+0.9°-0.4°≈20.4°;
[0056] The iteration process of skipping the first iteration is as follows:
[0057] 0°+26.6°-14°+7.1°+3.6°-1.8°-0.9°-0.4°+0.2°≈20°;
[0058] As can be seen, in some cases, 45° of the 0th order is not used, and the subsequent orders can be used to approximate the target angle through the arrangement and combination of the preset angles, and the accuracy is higher.
[0059] Therefore, the embodiment of the present application provides a method and device for implementing CORDIC. In the case of a certain iteration order or hardware resources, when the input angle is small, the 0th or the first 2 iterations in 0-n iterations are skipped, and 1-n+1 or 2-n+2 iterations are executed, a relatively small set of preset angles is used to achieve more detailed and accurate rotation, and the accuracy is improved. In other cases, the original iteration of CORDIC is used.
[0060] As shown in FIG. 1, it is a flowchart of the method for implementing CORDIC provided by the embodiment of the present application, which comprises the following steps: Figure 3 Step 301, a target angle is obtained.
[0061] Step 302, it is judged whether the absolute value of the target angle is within a set threshold range; if yes, step 303 is executed; otherwise, step 304 is executed.
[0062] Step 303, a CORDIC iteration operation of skipping orders is executed.
[0063] Step 304, a CORDIC iteration operation of full orders is executed.
[0064]
[0065] The full-stage CORDIC iteration operation refers to performing 0 to n-stage CORDIC iteration operation; and the skip-stage CORDIC iteration operation refers to skipping 0 to m-stage CORDIC iteration operation, and performing m+1 to n+m+1-stage CORDIC iteration operation, where m is 0 or a positive integer.
[0066] In a specific application, there can be multiple threshold ranges, and the values of m corresponding to different threshold ranges are different. That is, the skip-stage CORDIC iteration operation can start from the 0th stage, and skip one or more stages of iteration operation.
[0067] The maximum skip-stage number is taken as 2 for example.
[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 stage 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 stages are skipped;
[0070] When the target angle z0 takes other numbers, no skip operation is performed, that is, the original 0 to n-stage CORDIC iteration operation is still performed.
[0071] Therefore, in a non-limiting embodiment, two threshold ranges can be set, that is, a first threshold range [0.5, 0.9375) and a second threshold range [0, 0.5). Correspondingly, the skip-stage CORDIC iteration operation performed in the step 303 includes the following two cases:
[0072] When the absolute value of the target angle is in the first threshold range, the 0th stage of CORDIC iteration operation is skipped, and the 1st to n+1th stages of CORDIC iteration operation are performed;
[0073] When the absolute value of the target angle is in the second threshold range, the 0th and 1st stages of CORDIC iteration operation are skipped, and the 2nd to n+2th stages of CORDIC iteration operation are performed.
[0074] The unit of the above-mentioned angle value is radian (rad), and the units of the angles involved later are the same, which will not be repeated.
[0075] It should be noted that the method for implementing CORDIC provided by the present application can implement CORDIC iteration operation in a set coordinate system and rotation mode, and the set coordinate system is any one of the following: circular, hyperbolic, and linear. Moreover, the single-stage iteration mode or the multi-stage pipeline mode can be adopted on hardware to implement the CORDIC, and the embodiments of the present application are not limited in this regard.
[0076] Correspondingly, the embodiment of the present application also provides a device for implementing CORDIC, as shown in Figure 4 Fig. 1 is a principle block diagram of the device for implementing CORDIC.
[0077] The device for implementing CORDIC includes a judging module 401, a control module 402 and an iterative operation module 403. The iterative operation module 403 includes three channels of x, y and z of n+1 levels, and each level of the x and y channels includes a shifter and an adder (not shown in the figure), and each level of the z channel includes an adder (not shown in the figure).
[0078] In this embodiment, the judging module 401 is configured to obtain a target angle z0 and generate a control signal according to the target angle z0, and output the target angle z0 to the z channel of the first level 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 number of the shifters of the x and y channels of the first level according to the control signal to perform the jump-step CORDIC iterative operation or the full-step CORDIC iterative operation. The full-step CORDIC iterative operation refers to the CORDIC iterative operation of 0 to n steps, and the jump-step CORDIC iterative operation refers to skipping the CORDIC iterative operation of 0 to m steps and performing the CORDIC iterative operation of m+1 to n+m+1 steps, and 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 levels according to the control signal.
[0081] In the specific implementation, the judging module 401 can be implemented by a comparator, and the control module 402 can be implemented by an m+1 to 1 multiplexer of n+1 levels, that is, the input of the multiplexer is m+1 and the output is one. For the multiplexer of the i-th level, the preset angles of the i-th, i+1-th and i+2-th levels 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 level, and i<n.
[0082] According to the description of the method of the present application, one or more different threshold ranges can be set, and it is determined whether to perform the jump-step CORDIC iterative operation or the full-step CORDIC iterative operation according to whether the target angle is in the set threshold range.
[0083] Correspondingly, the judging module 401 can output the control signal according to the threshold range in which the absolute value of the target angle is located.
[0084] For example, the maximum number of steps is set to 2, and the first threshold range and the second threshold range are set accordingly, wherein 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 in the first threshold range, outputs a second control signal when the absolute value of the target angle is in the second threshold range, and outputs a full-step control signal in other cases.
[0085] The first control signal controls the iteration operation module 403 to skip the 0th-order CORDIC iteration operation and perform the 1st to n+1th-order CORDIC iteration operation.
[0086] The second control signal controls the iteration operation module 403 to skip the 0th and 1st-order CORDIC iteration operation and perform the 2nd to n+2th-order CORDIC iteration operation.
[0087] It should be noted that the iteration operation module 403 can perform CORDIC iteration operation in a set coordinate system and rotation mode, and the set coordinate system is any one of the following: circular, hyperbolic, and linear.
[0088] The device for implementing CORDIC of the present application and the existing hardware circuit for implementing CORDIC will be further described below in combination with a specific hardware circuit.
[0089] As shown in Figure 5 , Figure 5 is a structure diagram of the 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 diagrams for implementing CORDIC are shown; and Figure 5 the generation and control of the rotation direction d i are ignored in
[0091] Referring to Figure 5 , for the x and y paths, each level of hardware is composed of a shifter and an adder ADD. In the 0th level of hardware, that is, the 0th order of CORDIC iteration, no shifting is needed, so the shifter in the 0th level of hardware is shifted by 0, and the shifting operation of the shifter in all subsequent levels is as follows:
[0092] In the case of not skipping, the i-th level circuit is right shifted by i bits;
[0093] In the case of skipping the 0th order, the i-th level circuit is right shifted by i+1 bits;
[0094] In the case of skipping the 0th and 1st orders, the i-th level circuit is right shifted by i+2 bits;
[0095] And so on…
[0096] For the z channel, each stage has only one adder ADD, one addend is the output of the previous stage adder, and the other addend is the preset angle binary number.
[0097] As Figure 6 shown, is a specific structure diagram of the device for implementing CORDIC according to an embodiment of the application.
[0098] Compared with Figure 5 the prior art, the device for implementing CORDIC of the application adds a judging module 401, and a control module 402 is used to control the preset angles output to each z channel.
[0099] Figure 6 In the embodiment shown, the judging module 401 generates corresponding control signals according to the input target angle z0. Each multiplexer of the control module 402 is a three-to-one multiplexer, the three inputs of the 0th multiplexer of the 0th stage are the preset angles of the 0th, 1st and 2nd stages, and similarly, the three inputs of the 0th multiplexer of the 1st stage are the preset angles of the 1st, 2nd and 3rd stages, and so on.
[0100] Suppose the maximum number of jumps is 2, then:
[0101] In the case of 0.5≤|z0|<0.9375, the judging module 401 generates a first control signal, denoted as s=1;
[0102] In the case of |z0|<0.5, the judging module 401 generates a second control signal, denoted as s=2;
[0103] In the case of 0.9375≤|z0|, the judging module 401 generates a full-stage control signal, denoted as s=0.
[0104] Correspondingly, each multiplexer in the control module 402 selects the 1st output under the control of the first control signal, i.e. skips the 0th order iteration operation; selects the 2nd output under the control of the second control signal, i.e. skips the first two orders of iteration operation; and selects the 0th output under the control of the full-stage control signal, i.e. performs full-stage iteration operation.
[0105] In addition, the control signals will also control the number of shifts of the first stage hardware of the iteration operation module 403, and the number of shifts is related to the value of the control signal, i.e. when s=0, there is no shift, i.e. the number of shifts is 0; when s=1, the number of shifts is 1; and when s=2, the number of shifts is 2.
[0106] It should be noted that in a specific application, the iteration operation module 403 can implement the CORDIC iteration operation in a single-stage circuit iteration manner or in a multi-stage circuit pipeline manner, and the embodiments of the present application do not limit this.
[0107] Although the above embodiment takes the skip 2 order as an example to describe the scheme of the present application, the present application does not limit the highest order to be skipped, for example, when the target angle is in a certain threshold range smaller than 0.5, more initial orders are skipped, and the number of threshold ranges is not limited, as long as the preset angles of the remaining orders after skipping the initial orders can be combined to form the target angle, for example, 0.25, 0.125, etc. can be selected as the range boundary by dividing 2; in terms of hardware implementation, only more judgment conditions are added to the judgment module, and more input multiplexers are used in the preset angle selection of the z channel.
[0108] In addition, it should be noted that the CORDIC performs pseudo-rotation of the initial vector (1, 0), and the final result needs to be multiplied by the scaling factor For example, the initial vector can be set as (K, 0) to implement equivalent calculation, thereby avoiding multiplication operation. In the CORDIC implementing adaptive skip order according to the scheme of the present application, the selection of the initial values x0 and y0 can also be controlled by the control signal s, K0=K, K0 represents the original scaling factor, K1 represents the scaling factor of skipping the 0th order iteration, and K2 represents the scaling factor of skipping the first two orders of iteration.
[0109] The method and device for implementing CORDIC provided by the embodiments of the present application can be used to automatically select whether to skip the initial order of iteration according to the size of the input angle by mathematically analyzing the angle relationship of the CORDIC rotation iteration and concluding that the rotation iteration process is equivalent to the combination of the preset angles to achieve the approximation of the target angle. Compared with the existing basic CORDIC iteration scheme, the scheme of the present application can achieve higher precision of CORDIC only by adding a small amount of control circuit under the same calculation resource.
[0110] Compared with the basic CORDIC in the prior art, the scheme of the present application can achieve higher precision of CORDIC only by adding a small amount of control circuit under the same calculation resource.
[0111] Figure 7The absolute value error statistical chart of the normal CORDIC (i.e. full order CORDIC) and the absolute value error statistical chart of the CORDIC of the present application when implementing sinx are shown in the figure, the absolute value error of the basic CORDIC is above the x-axis, the absolute value error of the CORDIC using the adaptive skipping method of the present application (taking negative) is below the x-axis, the iteration order is set to 8 orders, in order to completely simulate the hardware behavior, the numerical initialization and calculation process all use 16-bit fixed-point numbers, the data is composed of 2-bit integer plus 14-bit decimal, and the simulation software is python.
[0112] From the above table, 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 completely consistent, and in the two sub-intervals of the input range, the absolute value error of the sine obtained by using the adaptive skipping method CORDIC is several times different from that of the normal CORDIC. Figure 7 In specific implementation, each module / unit contained in each device / product described in the above embodiments can be a software module / unit, or a hardware module / unit, or part of a software module / unit and part of a hardware module / unit.
[0113] For example, for each device / product applied to or integrated in a chip, each module / unit contained therein can be implemented in the form of hardware such as a circuit, or at least part of the modules / units can be implemented in the form of a software program running on a processor integrated in the chip, and the remaining (if any) modules / units can be implemented in the form of hardware such as a circuit; for each device / product applied to or integrated in a chip module, each module / unit contained therein can be implemented in the form of hardware such as a circuit, and different modules / units can be located in the same component (e.g. a chip, a circuit module, etc.) or different components of the chip module, or at least part of the modules / units can be implemented in the form of a software program running on a processor integrated in the chip module, and the remaining (if any) modules / units can be implemented in the form of hardware such as a circuit; for each device / product applied to or integrated in a terminal, each module / unit contained therein can be implemented in the form of hardware such as a circuit, and different modules / units can be located in the same component (e.g. a chip, a circuit module, etc.) or different components of the terminal, or at least part of the modules / units can be implemented in the form of a software program running on a processor integrated in the terminal, and the remaining (if any) modules / units can be implemented in the form of hardware such as a circuit.
[0114] For example, for each device / product applied to or integrated in a chip, each module / unit contained therein can be implemented in the form of hardware such as a circuit, or at least part of the modules / units can be implemented in the form of a software program running on a processor integrated in the chip, and the remaining (if any) modules / units can be implemented in the form of hardware such as a circuit; for each device / product applied to or integrated in a chip module, each module / unit contained therein can be implemented in the form of hardware such as a circuit, and different modules / units can be located in the same component (e.g. a chip, a circuit module, etc.) or different components of the chip module, or at least part of the modules / units can be implemented in the form of a software program running on a processor integrated in the chip module, and the remaining (if any) modules / units can be implemented in the form of hardware such as a circuit; for each device / product applied to or integrated in a terminal, each module / unit contained therein can be implemented in the form of hardware such as a circuit, and different modules / units can be located in the same component (e.g. a chip, a circuit module, etc.) or different components of the terminal, or at least part of the modules / units can be implemented in the form of a software program running on a processor integrated in the terminal, and the remaining (if any) modules / units can be implemented in the form of hardware such as a circuit.
[0115] Although the present application has been disclosed with reference to the above embodiments, the application is not limited to the above embodiments. It will be apparent to those skilled in the art that various modifications and changes can be made thereto without departing from the spirit and scope of the application. The scope of the application should be limited only by the appended claims.
Claims
1. An apparatus for implementing CORDIC, characterized in that, The device includes: a judgment module, a control module, and an iterative calculation module; the iterative calculation module includes three channels of x, y, and z at n+1 levels, each level of x and y channels includes a shifter and an adder, and each level of z channel includes an adder; The judgment module is used to obtain the target angle and output a control signal according to the threshold range in which the absolute value of the target angle falls; The iterative operation module is used to determine the shift number of the first-stage x and y channel shifters according to the control signal, so as to perform skip-order CORDIC iterative operation or full-order CORDIC iterative operation; the full-order CORDIC iterative operation refers to performing CORDIC iterative operation from order 0 to n; the skip-order CORDIC iterative operation refers to skipping the CORDIC iterative operation from order 0 to m and performing CORDIC iterative operation from order m+1 to n+m+1, where m is 0 or a positive integer; The control module is used to control the preset angle of the z-channel of all levels according to the control signal.
2. The apparatus for realizing CORDIC according to claim 1, characterized in that, The control module includes: an n+1 level m+1 selector multiplexer; The i-th stage multiplexer receives preset angles of order i, i+1, and i+2 respectively, and selects one of these preset angles according to the control signal to output to the z-channel adder of the i-th stage. <n。 3. The apparatus for realizing 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), and the second threshold range is [0, 0.5), in radians; 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.
4. The apparatus for implementing CORDIC according to any one of claims 1 to 3, characterized in that, The iterative calculation module performs CORDIC iterative calculations in a set coordinate system and rotation working mode. The set coordinate system can be any of the following: circular, hyperbolic, or linear.
5. The apparatus for realizing CORDIC according to claim 4, characterized in that, The iterative operation module implements CORDIC iterative operation using a single-stage circuit iterative method or a multi-stage circuit pipeline method.