1. Field of the Invention
The present invention relates to an arc-tangent calculation method, particularly to a low-latency and divider-free arc-tangent calculation structure and a calculation method thereof.
2. Description of the Related Art
The arc-tangent function is expressed by
The calculation method thereof normally needs a divider, and the division result is used to find a corresponding angle from a lookup table. However, the divider is bulky, needs complicated hardware, and occupies considerable area.
In 1959, Volder published in IEEE a related paper “The CORDIC Trigonometric Computing Technique” that calculates the angle of an arc-tangent function without using any divider, wherein the coordinate system is divided into two parts, and wherein the part where the angle exists is determined. Next, the determined part is further divided into sub-parts again, and the sub-part where the angle exists is determined. The abovementioned dividing process is repeated until the angle is precisely defined. However, the prior art consumes too much time and greatly reduces the system efficiency.
Accordingly, the present invention proposes a low-latency arc-tangent calculation structure and a calculation method thereof to overcome the abovementioned problems. The architecture and embodiments thereof will be described in detail below.
The primary objective of the present invention is to provide a low-latency arc-tangent calculation structure and a calculation method thereof, wherein the coordinate system is divided into a plurality of parts, and wherein the part where the angle exists is determined to exclude the other part irrespective of the angle, whereby the quantity of lookup calculations is greatly reduced.
Another objective of the present invention is to provide a low-latency arc-tangent calculation structure and a calculation method thereof, wherein the divider is exponentially converted into a subtractor, whereby is reduced calculation time and hardware complexity.
To achieve the abovementioned objectives, the present invention proposes a low-latency arc-tangent calculation structure, which is used to work out an arc-tangent value of the ratio of an X-axis value I to a Y-axis value Q, and which comprises two lookup tables; two multiplexers respectively determining the order that the X-axis value I and the Y-axis value Q enter into the lookup table, and determining the signs of the comparison results of the second lookup table; at least one comparator determining the signs and magnitudes of the X-axis value I and the Y-axis value Q; a control unit determining the sector where the point corresponding to the X-axis value I and the Y-axis value Q exists; a shift encoder determining a shift angle according to the output of the comparator; and an adder adding the shift angle output by the shift encoder to the output of the multiplexer.
The present invention also proposes a low-latency arc-tangent calculation method, which comprises steps: using a comparator to determine the signs and magnitudes of an X-axis value I and a Y-axis value Q; using two absolute generators to generate the absolute values of the X-axis value I and the Y-axis value Q; using a first lookup table to obtain the logarithms of the X-axis value I and the Y-axis value Q, and using a second lookup table to obtain the result of exponentiation with the base being the Euler's number and the exponent being the difference of the two logarithms, and obtain an angle corresponding to the arc-tangent value of the exponentiation result; using a control unit to determining the sector where the point corresponding to the X-axis value I and the Y-axis value Q exists; using a multiplexer to determine the sign of the output of the second lookup table according to the output of the control unit; using a shift encoder to determine a shift angle according to the output of the comparator; and adding the output of the shift encoder to the output of the multiplexer.
Below, the embodiments are described in detail to make easily understood the objectives, technical contents, characteristics and accomplishments of the present invention.
The present invention proposes a low-latency arc-tangent calculation structure and a calculation method thereof, wherein the present invention divides a coordinate system into a plurality of sectors, based on the characteristic of the arc-tangent function, and wherein the present invention completely replaces division operations with subtraction operations via logarithmic and exponential transformations, and wherein the present invention finds out the sector where the angle exists, whereby the calculation time is greatly reduced.
In one embodiment, the X-Y coordinate system is equally divided into eight sectors, and each sector has an angle of 45 degrees. In such a case, the arc-tangent function can be expressed by Equation (1):
Refer to
The two absolute-value generators 10 and 10′ respectively generate the absolute values of the X-axis value I and the Y-axis value Q, and send the absolute values to the first multiplexer 12 and the numerical comparator 30. The first multiplexer 12 determines the order of absolutely X-axis value I and absolutely Y-axis value Q go to the first look up table 14 according which number is smaller. The first look up table 14 works out the logarithms of the X-axis value I and the Y-axis value Q. The worked out logarithms are stored in the register 16. The subtractor 18 calculates the difference between the logarithms of the X-axis value I and the Y-axis value Q. The second lookup table 20 includes an exponentiation lookup table and an angle lookup table. From the second lookup table is obtain the exponentiation result of the abovementioned difference. Further from the second lookup table is obtained an arc-tangent value (an angle) corresponding to the exponentiation result. The complementer 22 adds a minus sign to the output of the second lookup table 20. Suppose that the output of the second lookup table 20 is a positive value. After the complementer 22 adds a minus sign to the positive value, the positive value is converted into a negative value. Thereby, the second multiplexer 24 simultaneously receives a positive input and a negative input. The second multiplexer 24 calculates to determine whether to output a positive value or a negative value. The sign comparator 28 and the numerical comparator 30 respectively determine the signs and magnitudes of the X-axis value I and the Y-axis value Q. The X-axis value I and the Y-axis value Q are directly sent to the sign comparator 28 before being processed by the absolute-value generators 10 and 10′. The X-axis value I and the Y-axis value Q are sent to the numerical comparator 30 after being processed by the absolute-value generators 10 and 10′. The two comparators 28 and 30 may be regarded as a single comparator. The control unit 32 determines the sector where a point corresponding to the X-axis value I and the Y-axis value Q exists. In one embodiment, the coordinate system is divided into eight sectors each having an angle of 45 degrees. The shift encoder 34 determines the shift angle according to the outputs of the sign comparator 28 and the numerical comparator 30. The adder 26 adds the shift angle output by the shift encoder 34 to the output of the second multiplexer 24.
Refer to
On the other hand, after the values of the X-axis value I and the Y-axis value Q are input in Step S10, use a comparator to determine the signs and magnitudes of the X-axis value I and the Y-axis value Q in Step S18. In the embodiment shown in
Refer to
From the position where the point (Ii, Qi) is located in the coordinate system, it is known that ∥Ii∥<∥Qi∥ and that Ii has a positive value and Qi has a negative value, i.e. {sign(Ii), sign(Qi)}={+, −}. Therefore, the point (Ii, Qi) is located in the sixth sector. Thus, the shift angle is 270 degrees, and the angle corresponding to
has a value of tan−1(elog|I
In conclusion, the present invention proposes a low-latency arc-tangent calculation structure and a method thereof, which replaces a divider with a subtractor to reduce calculation time and decrease the area occupied by hardware. In the present invention, the coordinate system is divided into a plurality of sectors, whereby the corresponding angle can be worked out with only two lookup tables, and whereby the invention can further reduce calculation complexity and promote system efficiency.
The embodiments described above are only to exemplify the present invention but not to limit the scope of the present invention. Any equivalent modification or variation according to the spirit of the present invention is to be also included within the scope of the present invention.
Number | Date | Country | Kind |
---|---|---|---|
099136530 | Oct 2010 | TW | national |