Flexible and Cost-Effective Spherical To Cartesian Coordinate Conversion Using 3-D CORDIC Algorithm On FPGA
Flexible and Cost-Effective Spherical To Cartesian Coordinate Conversion Using 3-D CORDIC Algorithm On FPGA
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2024, 12(4), 815–823 | 815
when it was first introduced by Jack Volder. It was initially cosh, tanh, arctanh, exp and square-root. The author also
developed as a method to perform trigonometric describes a hardware floating point processor built using the
calculations using digital hardware. Over the years, the algorithm at Hewlett-Packard Laboratories, complete with a
algorithm has been refined and expanded, finding block diagram, microprogram control details, and actual
widespread application in various fields such as navigation, performance metrics.
signal processing, and graphics due to its efficiency and
Lakshmi et al. [13] A Survey implied that CORDIC
versatility [2].
algorithm has two main advantages reduced latency and
Jack Volder [1] presented the Coordinate Rotation Digital improved throughput.
Computer (CORDIC) which is designed for real-time
Sergiyenko et al. [16] proposed a new algorithm for
airborne computation. It utilizes a distinct computing
calculating sine and cosine functions using three stages of
technique that is particularly suited for resolving the
rotations based on a modified hybrid approach. These stages
trigonometric relationships required for plane coordinate
involve using a ROM table, a network of CORDIC micro
rotation and rectangular to polar coordinate conversion.
rotations. The error in calculations for small angles is within
Volder compares the limitations of existing methods,
acceptable limits.
explains how CORDIC overcomes these, and covers various
forms of the algorithm. Volder highlighted the algorithm's H. Nair and A. Chalil [17] implemented a 32-bit floating-
accuracy and efficiency and its applications in signal point serial and parallel CORDIC architecture on an FPGA
processing, control systems, and computer graphics. using different adders to create a more area and speed
Compared the limitations of existing methods, explained efficient CORDIC architecture. The proposed architecture
how CORDIC overcomes these, and covers various forms with Ladner Fischer adder has better area utilization and less
of the algorithm. delay compared to other adders in both serial and parallel
CORDIC architectures
Jack Volder [2] traced the history and development of the
CORDIC algorithm, a technique used for computing basic Paz and Garrido [18] proposed that new CORDIC-based
functions such as sine, cosine, and logarithms. The article algorithm does not require complex iterations or actual
provides a detailed explanation of the algorithm's derivation multiplication to compute functions accurately, unlike
and the motivation behind its creation which was the need previous approaches. The proposed algorithm has been
of B-58 aircraft's analogy navigation computer to be implemented in hardware and shown to have a better
replaced with a high-accuracy and high-performance digital balance between space usage and accuracy compared to
computer. The author also discussed the advantages and other CORDIC-based approaches. The authors make a
disadvantages of the CORDIC algorithm compared to other comparison between different pipelined architectures used
methods, and highlighted its simplicity and efficiency in a for the computation of arcsine using CORDIC.
wide range of applications. Overall, the article provides a Wang et al. [19] proposed a design for a high-accuracy and
comprehensive overview of the CORDIC algorithm and its energy-efficient Izhikevich neuron based on Fast-
importance in modern computing. Convergence Coordinate Rotation Digital Computer. The
Kumar [6] discussed the implementation of serial and design includes an error propagation model for systematic
parallel architectures for several mathematical functions error analysis and effective error reduction, along with two
(Sine, Cosine, Exponential, Inverse Exponential, Logarithm methods for reducing errors in the design. By using FC-
and Rectangular to polar) on the Cyclone IV E FPGA, with CORDIC for square calculation, redundant CORDIC
a focus on comparing the area, delay, and power iterations are eliminated, improving accuracy and energy
consumption metrics of each architecture. The results efficiency.
indicate that the serial architecture is more area-efficient, K. T. Chen et al. [20] mentioned that many functions can be
while the parallel architecture requires more area. However, computed by CORDIC algorithm as shown in the table 1
the parallel architecture outperforms the serial design in below :( *this is our proposed model idea)
terms of speed. This trade-off between latency and accuracy
can be beneficial for various real-time applications. Table 1: CORDIC algorithm calculated functions [20].
Mazenc et al. [7] presented an extension of the Coordinate Coordinate Rotation Mode Vectoring Mode
Rotation Digital Computer algorithm, enabling the system(m)
Zn=0 Xn=0 or Yn=0
computation of several functions, including cos-1, sin-1,
cosh-1 and sinh-1. Circular* sin(x) arcsin(x)
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2024, 12(4), 815–823 | 816
Linear impact on modern computing, providing efficient and
accurate computation for various functions in diverse
m=0 f(x,y)=xy f(x,y)=x/y
applications. Researchers continue to explore and enhance
Hyperbolic sinh(x) arcsinh(x) the algorithm for improved performance and application-
specific optimizations. Finally, it’s obvious that CORDIC
m=-1 cosh(x) arccosh(x)
reduced latency and improved throughput [19].
tanh(x) arctanh(x)
3. Experimental Procedure
ex ln(x)
3.1 Theory
x0.5
3.1.1 Spherical Coordinates System [8]
Table2 presents a summary of some articles about CORDIC
The spherical coordinate system is a way to describe the
algorithm.
location of a point in 3D space using three values: how far
Table 2: Some CORDIC algorithm articles. the point is from a fixed starting point (radial distance), how
high or low the point is compared to a fixed up-down
Researcher Article’s Main topic in CORDIC
direction (inclination or elevation angle), and the direction
Kumar[6] Compared serial and parallel architectures of the point's projection onto a flat plane that passes through
for mathematical functions and found that the starting point and is perpendicular to the up-down
2019
the parallel architecture offers better speed direction (azimuth or reference angle). The inclination angle
but requires more area. can also be replaced by an elevation angle measured from
the flat reference plane. As seen in figure 1.
Mazenc et Extended the algorithm to compute
al.[7] additional functions such as inverse
trigonometric and hyperbolic functions
1993
Paz and Proposed a new CORDIC-based algorithm To plot this point using its spherical coordinates, we follow
Garrido that eliminates the need for complex these steps:
iterations or actual multiplication for 1- Move r units away from the starting point (origin) in the
[18] 2023
accurate function computation. direction of the zenith (upward).
Wang et Designed a high-accuracy and energy- 2- Rotate by θ degrees around the origin in the direction of
al.[19] efficient neuron based on the Fast- the azimuth reference.
Convergence Coordinate Rotation Digital
2022 3-Rotate by φ degrees around the zenith (upward) in the
Computer, which eliminates redundant
iterations and improves accuracy and energy correct direction.
efficiency. These steps help us determine the precise location of the
point in 3D space based on its spherical coordinates (r, θ, φ),
where θ represents inclination or elevation angle. To convert
It can be said that the CORDIC algorithm has a significant spherical coordinates (r, θ, φ) to Cartesian coordinates (x, y,
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2024, 12(4), 815–823 | 817
z), the following equations can be used [8]: K 's
The product of the i approaches 0.607 252 935... as
x = r sin cos (1) the number of iterations goes to infinity. For 11 iterations
Volder’s algorithm is based on general equations for The exact gain depends on the number of iterations,
rotating a vector in 2D space. Given a vector V with according equation below:
coordinates (x, y) that needs to be rotated by an angle Ø, we N −1
can get a new vector V' with updated coordinates (x', y') K = 1 /(1 + 2− 2i )
using the following method, which is derived from the
i =0 (10) [4]
equations for vector rotation [4]:
According to Volder’s algorithm the CORDIC arithmetic
unit is simple as shown in figure 3 below:
xi +1 = K i .[ xi − yi .d i .2 − i ]
(8)
yi +1 = K i .[ yi + xi .d i .2 − i ] (9)
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2024, 12(4), 815–823 | 818
Angles in CORDIC algorithm assume that θi such that, x = r cos (11)
tan(θi)=2-i
y = r sin (12)
Table 3: Look up Table for angles used in CORDIC.
As pointed out above, the transformation is accomplished
Hexadecimal
I tan(θi)=2-i i by selecting the rotation mode.
Value Let X0= polar magnitude, z0= polar phase, y0=0 and
using proposed 2-D CORDIC entity see Fig 6 below , the
0 1 45.00000 ° 1000
output will be rcosθ and rsinθ the result represents the polar
1 0.5 26.56505 ° 9720 input transformed to Cartesian space .
2 0.25 14.03624 ° 4FD9
3 0.125 7.12502 ° 2888
4 0.0625 3.57633 ° 1458
5 0.03125 1.78991 ° A2EB
6 0.015625 0.89517 ° 517B
7 0.0078125 0.44761 ° 28BE
Fig 6: 2-D CORDIC Entity using VHDL
8 0.00396625 0.2238° 145F
In this paper the proposed model used Rotation Mode of
9 0.001953125 0.1119° A2F9
CORDIC algorithm as shown in the following table:
10 0.0009765625 0.0559° 517C
Table 4: Some of CORDIC Rotation Mode Applications.
11 0.00048828125 0.0279° 28BE
Function Input Output
12 0.000244140625 0.0139° 145F
cosƟ X=(1/G) Xn=cosƟ
13 0.0001220703125 0.0069° A2F9
sinƟ Y=0 Yn=sinƟ
14 0.000061035156 0.0034° 517C
tanƟ Z=Ɵ tanƟ=( sinƟ/ cosƟ)
15 0.000030517578 0.0017° 28BE
polar to X=R Xn=RcosƟ
rectangular
Y=0 Yn=RsinƟ
In this paper first building and installation of lookup tables
as shown below to hold the arctangent base angles where: Z=Ɵ
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2024, 12(4), 815–823 | 819
Let the spherical coordinates (r, θ, φ) use 3-D CORDIC to N
get the equivalent Cartesian coordinates(x,y,z) performs in | V ' |= 1 + 2 −2i | V | (13) [6]
two stages as below :
The first 2-D CORDIC has the following inputs:
x0= r ; y0=0 z0= θ and the output of the first stage will be
4.1. 2-D CORDIC Results:
rcosθ and rsinθ which can be used as inputs to the second
stage as follows: Simply let X0= (1/Gn) = (.607253) = (17B9)hexa , and Y0=0
, so the above the final iteration results will be :
x0= rsinθ ; y0=0 , z0=φ and the ouputs will be x=
xn = cos z 0
rsinθcosφ
y n = x0 sin z 0
and y=rsinθsinφ and output x from the first stage
represents zn = 0
z = rcosθ . Table 4:2-D CORDIC Results when X0=(1/Gn) and
3.3 The Gain Consideration Y0=0 and Z =Ɵ .
Z Z X X X Y Y Y
When the CORDIC algorithm is applied to a vector V to
deci hexade Theore Simul Error Theore Error
rotate it by an angle Ө, a new vector V ́ will be generated in Simul
mal cimal tical ation *10-4 tical *10-4
such a way that changes from V to V ́ but magnitude change: ation
This type of change will affect both initial vector 90 2000 0000 0002 2 2710 2711 1
components by a constant factor for a fixed number of
75 1AAA 0A1C 0A1C 0 25BB 25BD 2
iterations, let this factor be called the gain Gn, therefore the
gain will be given as in eq. 17. 60 1555 1388 1387 1 21D4 21D6 2
And it will affect both components of V ́ by multiplications 45 1000 1BF9 1BF9 0 1BF9 1BF9 0
aggregate to:
30 0AAA 21D4 21D7 3 1388 1386 2
Gn = 1.646760258….… as n→ ∞
15 0555 25BB 25BE 3 0A1C 0A19 3
But CORDIC Rotation mode equations are [6]:
-15 FAAA 25BB 25BB 0 F5E4 F5E3 1
xn = Gn [ x0 cos z0 − y0 sin z0 ] (14)
-30 F555 21D4 21D6 2 EC78 EC79 1
zn = 0 (16)
-60 EAAA 1388 1387 1 DE2C DE29 3
N
Gn = 1 + 2 − 2i
(17)
-75 E555 0A1C 0A1F 3 DA45 DA42 3
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2024, 12(4), 815–823 | 820
find the equivalent Cartesian coordinates (x, y, z); by
calculations:
X= r * (sin 60) * (cos 30)= [(1/Gn^2)] * sin60* cos30=0.75
*10000 =7500=(1D4C)hex.
Y= r * (sin 60) * (sin 30)= [(1/Gn^2)] * sin60 *
sin30=0.433012 *10000 =4330=(10EA) hex.
Z= r * (cos 60) = [(1/Gn^2)] * cos60=0.3036707
*10000=3036= (0BDC) hex.
Fig 8: The proposed 2-D CORDIC model Error in
X_Value (COS (z)) and Y_Value (SIN(Z)) .
The simulation result on Quartus II 7.1 software when
4.2. 3-D CORDIC Results: (r=0E68, θ=1555, φ=0AAA)as shown in Figure 10:
Let the spherical coordinates r=0E68, θ=1000, φ=1000 find
the equivalent Cartesian coordinates (x, y, z); by
calculations:
X_ calculated= r * (sin 45) * (cos 45)= [(1/Gn^2)] * sin45 *
cos45=0.5 *10000 =5000=(1388) hexa
Y_ calculated = r * (sin 45) * (sin 45)= [(1/Gn^2)] * sin45
* sin45=0.5 *10000 =5000=(1388) hexa Figure 10: Simulation results when(r=0E68, θ=1555,
φ=0AAA).
Z_ calculated = r * (cos 45) = [(1/Gn^2)] * cos45=0.429455
*10000=4294= (10C6)hexa The simulation results for converting spherical coordinate’s
r=0E68, θ, φ to equivalent Cartesian Coordinates is
The simulation result on Quartus II 7.1 software when summarized in table 5.
(r=0E68, θ=1000, φ=1000)as shown in Figure 9:
Fig 9: Simulation results when(r=0E68, θ=1000, And the average error in Y_Value= 2*10 -4
φ=0AAA). And the average error in Z_Value= 1*10 -4
Let the spherical coordinates r=0E68, θ=1555, φ=0AAA
Table 5: 3-D CORDIC Results Cartesian Coordinates (X, Y, Z) Equivalent to Spherical Coordinates (r=0E68,and θ, φ ).
X X X Y Y Y Z Z Z
θ φ Deviation*10- Deviation*10-
Calculated simulation calculated Simulation De*10-4 Calculate simulation
4 4
Avg 4 2 1
The proposed model evaluates high speed calculation for : processor using two 2-D CORDIC Processor. This 3-D
2-D CORDIC Processor the latency = 16 clock cycle and for CORDIC Processor is used to convert from spherical
3-D CORDIC Processor the latency =32 clock cycle . coordinates to Cartesian coordinates and constructed using
VHDL.
5. Conclusions
Using FPGA as flexible implementation tool make it easy
This research paper focuses on implementing 3-D CORDIC
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2024, 12(4), 815–823 | 821
to modify the proposed model without additional cost. International Conference on Power, Control and
Embedded Systems (pp. 1-5). IEEE.
The accuracy of 2-D CORDIC Processor is acceptable;
since the average error in cosine(Ɵ)= 1.33*10 -4 and the [6] Kumar, P. A. (2019, March). FPGA implementation of
average error in sine(Ɵ) =1.6667*10 -4. the trigonometric functions using the CORDIC
algorithm. In 2019 5th International Conference on
The accuracy of 3-D CORDIC Processor is acceptable.
Advanced Computing & Communication Systems
The proposed model evaluates high speed calculation,
(ICACCS) (pp. 894-900). IEEE.
reducing latency at the cost of accuracy is beneficial for
numerous real-time applications like: Digital Signal [7] Mazenc, Mazenc, C., Merrheim, X., & Muller, J. M.
Processing (DSP), wireless communication systems, (1993). Computing Functions cos-1and sin-1Using
navigation and GPS. CORDIC. IEEE Transactions on Computers, 42(1),
118-122
Nomenclatures
K Constant gain [8] Sadiku, Matthew N. O. (2001),"Coordinate Systems
Abbreviations and Transformation." Chapter 2 in Elements of
C Coordinate Rotation Digital Computer Electromagnetics, third edition, Oxford University
O Press, pp. 23-51.
R
[9] Walther, J. S. (1971, May). A unified algorithm for
D
elementary functions. In Proceedings of the May 18-
I
20, 1971, spring joint computer conference (pp. 379-
C
Field Programmable Gate Array 385)
F
P [10] Neji, N., Boudabous, A., Kharrat, W., & Masmoudi,
G N. (2011, March). Architecture and FPGA
A implementation of the CORDIC algorithm for
L Look Up Table fingerprints recognition systems. In Eighth
U International Multi-Conference on Systems, Signals &
T Devices (pp. 1-5). IEEE.
V Very High-Speed Integrated Circuit Hardware Description
Language [11] Gopikiran, G., & Thilagavathy, R. (2011, July). FPGA
H
implementation of floatingpoint rotation mode
D
CORDIC algorithm. In 2011 International Conference
L
on Signal Processing, Communication, Computing
and Networking Technologies (pp. 506-508).
References
[12] Andraka, R. (1998, March). A survey of CORDIC
[1] Volder, Jack E. (1959)."The CORDIC Trigonometric
algorithms for FPGA based computers. In Proceedings
Computing Technique." IRE Transactions on
of the 1998 ACM/SIGDA sixth international
Electronic Computers, Vol. EC-8, no. 3, 1959, pp.
symposium on Field programmable gate arrays (pp.
330-334.
191-200).
[2] Volder, J. E. (2000). “The Birth of CORDIC”. Journal
[13] Lakshmi, B., & Dhar, A. S. (2010). CORDIC
of VLSI Signal Processing, 25, 101-105.
Architectures: A Survey. Hindawi Publishing
https://doi.org/10.1023/A:1008191618576.
Corporation VLSI Design, 2010, Article ID 794891,
[3] Duprat, J., & Muller, J. (1993). “The CORDIC 19 pages. doi:10.1155/2010/794891.
algorithm: new results for fast VLSI implementation”.
[14] Lang, T., Lang, T., & Antelo, E. (2005). High-
IEEE Transactions on Computers, 42(2), 168-178.
throughput CORDIC-based geometry operations for
[4] Li, Huan, and Yan Xin. (2010). "Modified CORDIC 3D computer graphics. IEEE Transactions on
algorithm and its implementation based on FPGA." Computers, 54(3), 347-361.
2010 Third International Conference on Intelligent
[15] Li, J. H., Wang, G. C., Chen, Y., Zhang, M., & Li, P.
Networks and Intelligent Systems.(pp. 618-621).
(2012). A VLSI Design of Image Rotation for Real
IEEE.
Time 2-D Barcode Identification. Applied Mechanics
[5] Bhuria, S., & Muralidhar, P. (2010, November). and Materials, 198, 357-360.
FPGA implementation of sine and cosine value
[16] Sergiyenko, A., Moroz, L., Mychuda, L., & Samotyj,
generators using Cordic Algorithm for Satellite
V. (2021, September). FPGA implementation of
Attitude Determination and calculators. In 2010
CORDIC algorithms for sine and cosine floating-point
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2024, 12(4), 815–823 | 822
calculations. In 2021 11th IEEE International
Conference on Intelligent Data Acquisition and
Advanced Computing Systems: Technology and
Applications (IDAACS) (Vol. 1, pp. 383-386). IEEE.
[17] Nair, H., & Chalil, A. (2022, March). FPGA
Implementation of Area and Speed Efficient CORDIC
Algorithm. In 2022 6th International Conference on
Computing Methodologies and Communication
(ICCMC) (pp. 512-518). IEEE.
[18] Paz, P., & Garrido, M. (2023). CORDIC-Based
Computation of Arcsine and Arccosine Functions on
FPGA. IEEE Transactions on Circuits and Systems II:
Express Briefs. doi: 10.1109/TCSII.2023.3262353.
[19] Wang, J., Peng, Z., Zhan, Y., Li, Y., Yu, G., Chong, K.
S., & Wang, C. (2022). A high-accuracy and energy-
efficient CORDIC based izhikevich neuron with error
suppression and compensation. IEEE Transactions on
Biomedical Circuits and Systems, 16(5), 807-821.
[20] Chen, K. T., Fan, K., Han, X., & Baba, T. (2015). A
CORDIC algorithm with improved rotation strategy
for embedded applications. Journal of Industrial and
Intelligent Information, 3(4), 274-279.
[21] Weijun Zhang (2001)." VHDL Tutorial: Learn by
Example," University of California, Retrieved
April,1,2023,from http://esd.cs.ucr.edu/labs/tutorial/.
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2024, 12(4), 815–823 | 823