# Flexible and Cost-Effective Spherical to Cartesian Coordinate Conversion Using 3-D CORDIC Algorithm on FPGA

Nadia M. Salem, Sami I. Serhan, Khawla M. Al-Tarawneh, Ra'fat Al-Msie'Deen

► To cite this version:

Nadia M. Salem, Sami I. Serhan, Khawla M. Al-Tarawneh, Ra'fat Al-Msie'Deen. 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, ISSN: 2147-6799, 2024, 12 (4), pp.815-823. hal-04917834

HAL Id: hal-04917834

https://hal.science/hal-04917834v1

Submitted on 5 Feb 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution - ShareAlike 4.0 International License
# Flexible and Cost-Effective Spherical to Cartesian Coordinate Conversion Using 3-D CORDIC Algorithm on FPGA

Nadia M. Salem<fnref n="1" />, Sami I. Serhan<fnref n="2" />, Khawla M. Al-Tarawneh<fnref n="3" />, Ra'fat Al-Msie'deen<fnref n="4" />

**Submitted:** 14/03/2024

**Revised:** 28/04/2024

**Accepted:** 04/05/2024

**Abstract:** In computer science, transforming spherical coordinates into Cartesian coordinates is an important mathematical operation. The CORDIC (Coordinate Rotation Digital Computer) iterative algorithm can perform this operation, as well as trigonometric functions and vector rotations, using only simple arithmetic operations like addition, subtraction, and bit-shifting. This research paper presents hardware architecture for a 3-D CORDIC processor using Quartus II 7.1 ALTERA software, which enables easy modifications and design changes due to its regularity and simplicity. The proposed 3-D CORDIC model is evaluated by comparing the calculated results with the simulated results to determine its accuracy. The results were satisfaction and the proposed model could be suitable for numerous real-time applications.

**Keywords:** Cartesian, CORDIC, Cosine, FPGA, Sine, Spherical, VHDL

## 1. Introduction

The iterative algorithm called: CORDIC Coordinate Rotation Digital Computer calculates the values of trigonometric functions like sine, cosine, square root, logarithm, magnitude, phase and more functions. [1].

The CORDIC algorithm is a method that rotates a vector repeatedly to approximate mathematical functions. It accomplishes this by decomposing the desired function into a series of minute rotations and shifts. The vector rotates by a predetermined degree on each iteration, and its coordinates are updated accordingly. Multiple iterations of this procedure are carried out until the desired precision is achieved. Because of CORDIC's efficiency and simplicity, hardware and embedded systems can benefit from its use [2].

In computer science, transforming spherical coordinates to Cartesian coordinates is a crucial mathematical operation with applications in computer graphics [14], game development, robotics, and signal processing [5], Barcode Identification [15], fingerprints recognition systems [10]. The 3-D CORDIC algorithm is a well-known method for this conversion, rotating the spherical coordinate system and approximating the conversion with high precision through using straightforward shift and adds operations. Due to the CORDIC algorithm's regularity and simplicity for generating high throughput and low latency, implementing

it using an FPGA provides a flexible and affordable development environment, allowing for easy design revisions [11]. The proposed 3-D CORDIC processor that converts from spherical to Cartesian coordinates was implemented using the (Very High-Speed Integrated Circuit Hardware Description Language) VHDL. First of all build and installation of memory entity (angle) to hold the arctangent, then Build the 2-D CORDIC entity with angle LUT memory entity, then compile and simulate the entity functions using Quartus II 7.1 tool of ALTERA. The last step construct 3-D CORDIC Processor using two entities of 2-D CORDIC and compile and simulate the entity functions using Quartus II 7.1 tool of ALTERA.

VHDL stands for Very High-Speed Integrated Circuit Hardware Description Language. It is a programming language used to describe and simulate digital circuits and systems. VHDL allows for the design and modeling of hardware components, such as processors, controllers, and other digital systems, using a concise and structured syntax. It is commonly used in the field of digital design for FPGA and ASIC implementations [21].

The remaining paper is organized as follows:

Section 2 presents the prior work for various CORDIC architecture types. In Section 3 experimental work includes the theory of CORDIC algorithm and spherical coordinates and the proposed architecture for rotation mode derived from the algorithm for 2-D CORDIC and 3-D CORDIC processor are presented. In section 4 the results and discussion about the simulation of the proposed model on VHDL are reported. Finally, section 5 have the conclusions.

## 2. Related works

The Cordic algorithm has a rich history dating to the 1950s

<footnote n="1">¹ King Abdullah II School for Information Technology, Jordan's University, nad9220478@ju.edu jo</footnote>

<footnote n="2">² King Abdullah II School for Information Technology, Jordan's University, samiserh@ju.edu jo</footnote>

<footnote n="3">³ King Abdullah II School for Information Technology, Jordan's University, Kol9220471@ju.edu jo</footnote>

<footnote n="4">⁴ Faculty of Information Technology, Mutah University, rafatalmsiedeen@mutah.edu jo</footnote>
when it was first introduced by Jack Volder. It was initially developed as a method to perform trigonometric calculations using digital hardware. Over the years, the algorithm has been refined and expanded, finding widespread application in various fields such as navigation, signal processing, and graphics due to its efficiency and versatility [2].

Jack Volder [1] presented the Coordinate Rotation Digital Computer (CORDIC) which is designed for real-time airborne computation. It utilizes a distinct computing technique that is particularly suited for resolving the trigonometric relationships required for plane coordinate rotation and rectangular to polar coordinate conversion. Volder compares the limitations of existing methods, explains how CORDIC overcomes these, and covers various forms of the algorithm. Volder highlighted the algorithm's accuracy and efficiency and its applications in signal processing, control systems, and computer graphics. Compared the limitations of existing methods, explained how CORDIC overcomes these, and covers various forms of the algorithm.

Jack Volder [2] traced the history and development of the CORDIC algorithm, a technique used for computing basic functions such as sine, cosine, and logarithms. The article provides a detailed explanation of the algorithm's derivation and the motivation behind its creation which was the need of B-58 aircraft's analogy navigation computer to be replaced with a high-accuracy and high-performance digital computer. The author also discussed the advantages and disadvantages of the CORDIC algorithm compared to other methods, and highlighted its simplicity and efficiency in a wide range of applications. Overall, the article provides a comprehensive overview of the CORDIC algorithm and its importance in modern computing.

Kumar [6] discussed the implementation of serial and parallel architectures for several mathematical functions (Sine, Cosine, Exponential, Inverse Exponential, Logarithm and Rectangular to polar) on the Cyclone IV E FPGA, with a focus on comparing the area, delay, and power consumption metrics of each architecture. The results indicate that the serial architecture is more area-efficient, while the parallel architecture requires more area. However, the parallel architecture outperforms the serial design in terms of speed. This trade-off between latency and accuracy can be beneficial for various real-time applications.

Mazenc et al. [7] presented an extension of the Coordinate Rotation Digital Computer algorithm, enabling the computation of several functions, including cos⁻¹, sin⁻¹, cosh⁻¹ and sinh⁻¹.

Walther [9] presented Coordinate Rotation Digital Computer algorithm for computing elementary functions such as multiplication, division, sin, cos, tan, arctan, sinh,

cosh, tanh, arctanh, exp and square-root. The author also describes a hardware floating point processor built using the algorithm at Hewlett-Packard Laboratories, complete with a block diagram, microprogram control details, and actual performance metrics.

Lakshmi et al. [13] A Survey implied that CORDIC algorithm has two main advantages reduced latency and improved throughput.

Sergiyenko et al. [16] proposed a new algorithm for calculating sine and cosine functions using three stages of rotations based on a modified hybrid approach. These stages involve using a ROM table, a network of CORDIC micro rotations. The error in calculations for small angles is within acceptable limits.

H. Nair and A. Chalil [17] implemented a 32-bit floating-point serial and parallel CORDIC architecture on an FPGA using different adders to create a more area and speed efficient CORDIC architecture. The proposed architecture with Ladner Fischer adder has better area utilization and less delay compared to other adders in both serial and parallel CORDIC architectures

Paz and Garrido [18] proposed that new CORDIC-based algorithm does not require complex iterations or actual multiplication to compute functions accurately, unlike previous approaches. The proposed algorithm has been implemented in hardware and shown to have a better balance between space usage and accuracy compared to other CORDIC-based approaches. The authors make a comparison between different pipelined architectures used for the computation of arcsine using CORDIC.

Wang et al. [19] proposed a design for a high-accuracy and energy-efficient Izhikevich neuron based on Fast-Convergence Coordinate Rotation Digital Computer. The design includes an error propagation model for systematic error analysis and effective error reduction, along with two methods for reducing errors in the design. By using FC-CORDIC for square calculation, redundant CORDIC iterations are eliminated, improving accuracy and energy efficiency.

K. T. Chen et al. [20] mentioned that many functions can be computed by CORDIC algorithm as shown in the table 1 below :(*this is our proposed model idea)

<table><caption>Table 1: CORDIC algorithm calculated functions [20].</caption><thead><tr><th>Coordinate system(m)</th><th>Rotation Mode<br>Zn=0</th><th>Vectoring Mode<br>Xn=0 or Yn=0</th></tr></thead><tbody><tr><td><strong>Circular*</strong></td><td><strong>sin(x)</strong></td><td>arcsin(x)</td></tr><tr><td><strong>m=1</strong></td><td><strong>cos(x)</strong></td><td>arccos(x)</td></tr><tr><td></td><td><strong>tan(x)</strong></td><td>arctan(x)</td></tr></tbody></table>
<table><tr><td>Linear<br>m=0</td><td>f(x,y)=xy</td><td>f(x,y)=x/y</td></tr><tr><td>Hyperbolic<br>m=-1</td><td>sinh(x)<br>cosh(x)<br>tanh(x)<br>e<sup>x</sup></td><td>arcsinh(x)<br>arccosh(x)<br>arctanh(x)<br>ln(x)<br>x<sup>0.5</sup></td></tr></table>

Table2 presents a summary of some articles about CORDIC algorithm.

<table><caption>**Table 2: Some CORDIC algorithm articles.**</caption><thead><tr><td>Researcher</td><td>Article's Main topic in CORDIC</td></tr></thead><tbody><tr><td>Kumar[6]<br>2019</td><td>Compared serial and parallel architectures for mathematical functions and found that the parallel architecture offers better speed but requires more area.</td></tr><tr><td>Mazenc et al.[7]<br>1993</td><td>Extended the algorithm to compute additional functions such as inverse trigonometric and hyperbolic functions</td></tr><tr><td>Walther [9]<br>1971</td><td>Presented the CORDIC algorithm for elementary functions and described a hardware floating-point processor implementation</td></tr><tr><td>Lakshmi et al.<br>[13] 2010</td><td>Highlighted the advantages of the CORDIC algorithm, including reduced latency and improved throughput</td></tr><tr><td>Sergiyenko et al.<br>[16] 2021</td><td>Introduced a modified hybrid approach for calculating sine and cosine functions with reduced hardware volume and calculation delay.</td></tr><tr><td>Nair and Chalil<br>[17] 2022</td><td>Implemented a more efficient CORDIC architecture using different adders</td></tr><tr><td>Paz and Garrido<br>[18] 2023</td><td>Proposed a new CORDIC-based algorithm that eliminates the need for complex iterations or actual multiplication for accurate function computation.</td></tr><tr><td>Wang et al.[19]<br>2022</td><td>Designed a high-accuracy and energy-efficient neuron based on the Fast-Convergence Coordinate Rotation Digital Computer, which eliminates redundant iterations and improves accuracy and energy efficiency.</td></tr></tbody></table>

It can be said that the CORDIC algorithm has a significant

impact on modern computing, providing efficient and accurate computation for various functions in diverse applications. Researchers continue to explore and enhance the algorithm for improved performance and application-specific optimizations. Finally, it's obvious that CORDIC reduced latency and improved throughput [19].

# 3. Experimental Procedure

## 3.1 Theory

### 3.1.1 Spherical Coordinates System [8]

The spherical coordinate system is a way to describe the location of a point in 3D space using three values: how far the point is from a fixed starting point (radial distance), how high or low the point is compared to a fixed up-down direction (inclination or elevation angle), and the direction of the point's projection onto a flat plane that passes through the starting point and is perpendicular to the up-down direction (azimuth or reference angle). The inclination angle can also be replaced by an elevation angle measured from the flat reference plane. As seen in figure 1.

<figure><img src="image_2.png" /><figcaption>**Fig 1: Spherical Coordinates [8]**</figcaption></figure>

A set of three values (r, θ, φ) in the spherical coordinate system tells us the exact location of a point in 3D space.

Spherical coordinate takes its importance because they are related to longitude (θ) and latitude (φ) which widely used in navigation systems. Based on this fact we can transfer any point on the earth (R, θ, φ) to its equivalent Cartesian coordinates (X, Y, Z).

To plot this point using its spherical coordinates, we follow these steps:

1. Move r units away from the starting point (origin) in the direction of the zenith (upward).

2. Rotate by θ degrees around the origin in the direction of the azimuth reference.

3. Rotate by φ degrees around the zenith (upward) in the correct direction.

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 spherical coordinates (r, θ, φ) to Cartesian coordinates (x, y,
z), the following equations can be used [8]:

$$x = r \sin \theta \cos \Phi \quad (1)$$

$$y = r \sin \theta \sin \Phi \quad (2)$$

$$Z = r \cos \theta \quad (3)$$

### 3.1.2 CORDIC Algorithm

Volder's algorithm is based on general equations for rotating a vector in 2D space. Given a vector V with coordinates (x, y) that needs to be rotated by an angle Ø, we can get a new vector V' with updated coordinates (x', y') using the following method, which is derived from the equations for vector rotation [4]:

<figure><img src="image_3.png" /><figcaption>Fig 2: Vector V is rotated by angle Ø. [4]</figcaption></figure>

$$x' = \cos(\Phi) \cdot [x - y \cdot \tan(\Phi)] \quad (4)$$

$$y' = \cos(\Phi) \cdot [y + x \cdot \tan(\Phi)] \quad (5)$$

$$(\theta)_{16} = \left\{ (\theta)_{10} * \left( \frac{16^4}{720} \right)_{10} \right\}$$

Rewrite in terms of αi: (0 ≤ i ≤ n) where i is iteration number [4]:

$$x_{i+1} = \cos(\alpha_i) \cdot [x_i - y_i \cdot d_i \cdot \tan(\alpha_i)] \quad (6)$$

$$y_{i+1} = \cos(\alpha_i) \cdot [y_i + x_i \cdot d_i \cdot \tan(\alpha_i)] \quad (7)$$

$$x_{i+1} = K_i \cdot [x_i - y_i \cdot d_i \cdot 2^{-i}] \quad (8)$$

$$y_{i+1} = K_i \cdot [y_i + x_i \cdot d_i \cdot 2^{-i}] \quad (9)$$

$$K_i = \cos(\theta_i) = \cos(\tan^{-1}(2^{-i})) = 1/\sqrt{1+2^{-2i}}$$

$$d_i = \pm 1$$

The product of the $K_i$'s approaches 0.607252935...as the number of iterations goes to infinity. For 11 iterations

$$K = \begin{aligned} & \cos(45.00000^\circ) * \cos(26.56505^\circ) * \cos(14.03624^\circ) * \\ & \cos(7.12502^\circ) * \cos(3.57633^\circ) * \cos(1.78991^\circ) * \\ & \cos(0.89517^\circ) * \cos(0.44761^\circ) * \cos(0.22380^\circ) * \\ & \cos(0.11190^\circ) * \cos(0.05590^\circ) = 0.607252935... \end{aligned}$$

The exact gain depends on the number of iterations, according equation below:

$$K = \prod_{i=0}^{N-1} \sqrt{1/(1 + 2^{-2i})} \quad (10) \quad [4]$$

According to Volder's algorithm the CORDIC arithmetic unit is simple as shown in figure 3 below:

<figure><img src="image_4.png" /><figcaption>Fig 3: CORDIC Hardware. [1]</figcaption></figure>

## 3.2 Implementation

### 3.2.1 Angle Conversion Formula

This paper assumes that the conversion formula as follows:

Step size □ 1 degree = (2^16)/720 = 91.02 decimal = (5B)hex.

Assume that Θ =30 then t its equivalent in hexadecimal.

$$ (30) \qquad \text{hex.} \qquad = \qquad \{[(2^16)/720]*30\}_{\text{decimal}} = (2730)_{\text{decimal}} = (0AAA)_{\text{hex.}} $$

<figure><img src="image_5.png" /><figcaption>Fig 4: Decimal to Hex-decimal conversion angles in 2's complement representation.</figcaption></figure>
Angles in CORDIC algorithm assume that θi such that,
tan(θi)=2⁻¹

<table><caption>**Table 3:** Look up Table for angles used in CORDIC.</caption><thead><tr><th>I</th><th>tan(θ<sub>i</sub>)=2<sup>-i</sup></th><th>θ<sub>i</sub></th><th>Hexadecimal Value</th></tr></thead><tbody><tr><td>0</td><td>1</td><td>45.00000°</td><td>1000</td></tr><tr><td>1</td><td>0.5</td><td>26.56505°</td><td>9720</td></tr><tr><td>2</td><td>0.25</td><td>14.03624°</td><td>4FD9</td></tr><tr><td>3</td><td>0.125</td><td>7.12502°</td><td>2888</td></tr><tr><td>4</td><td>0.0625</td><td>3.57633°</td><td>1458</td></tr><tr><td>5</td><td>0.03125</td><td>1.78991°</td><td>A2EB</td></tr><tr><td>6</td><td>0.015625</td><td>0.89517°</td><td>517B</td></tr><tr><td>7</td><td>0.0078125</td><td>0.44761°</td><td>28BE</td></tr><tr><td>8</td><td>0.00396625</td><td>0.2238°</td><td>145F</td></tr><tr><td>9</td><td>0.001953125</td><td>0.1119°</td><td>A2F9</td></tr><tr><td>10</td><td>0.0009765625</td><td>0.0559°</td><td>517C</td></tr><tr><td>11</td><td>0.00048828125</td><td>0.0279°</td><td>28BE</td></tr><tr><td>12</td><td>0.000244140625</td><td>0.0139°</td><td>145F</td></tr><tr><td>13</td><td>0.0001220703125</td><td>0.0069°</td><td>A2F9</td></tr><tr><td>14</td><td>0.000061035156</td><td>0.0034°</td><td>517C</td></tr><tr><td>15</td><td>0.000030517578</td><td>0.0017°</td><td>28BE</td></tr></tbody></table>

In this paper first building and installation of lookup tables
as shown below to hold the arctangent base angles where:

$$ \text{angles} = \tan^{-1} 2^{-i} \quad \text{where} \quad 0 \le i \le 15 $$

<figure><img src="image_6.png" /><figcaption>**Fig 5:** Angle LUT Input/output</figcaption></figure>

### 3.2.2 Two-D CORDIC

In this paper 3-D CORDIC processor contains two cascaded
2-D CORDIC Processor that transforms from polar to
Cartesian coordinates which is defined by the following
equation [5]:

$$ x = r \cos \theta \quad (11) $$

$$ y = r \sin \theta \quad (12) $$

As pointed out above, the transformation is accomplished
by selecting the rotation mode.

Let **X0**= polar magnitude, **z0**= polar phase, **y0**=0 and using proposed 2-D CORDIC entity see Fig 6 below, the output will be rcosθ and rsinθ the result represents the polar input transformed to Cartesian space.

<figure><img src="image_7.png" /><figcaption>**Fig 6:** 2-D CORDIC Entity using VHDL</figcaption></figure>

In this paper the proposed model used Rotation Mode of
CORDIC algorithm as shown in the following table:

<table><caption>**Table 4:** Some of CORDIC Rotation Mode Applications.</caption><thead><tr><th>Function</th><th>Input</th><th>Output</th></tr></thead><tbody><tr><td>cosθ</td><td>X=(1/G)</td><td>Xn=cosθ</td></tr><tr><td>sinθ</td><td>Y=0</td><td>Yn=sinθ</td></tr><tr><td>tanθ</td><td>Z=θ</td><td>tanθ=( sinθ/ cosθ)</td></tr><tr><td rowspan="3">polar to<br>rectangular</td><td>X=R</td><td>Xn=Rcosθ</td></tr><tr><td>Y=0</td><td>Yn=Rsinθ</td></tr><tr><td>Z=θ</td><td></td></tr></tbody></table>

### 3.2.3 Three-D CORDIC

To implement 3-D CORDIC Processor two cascade 2-D
CORDIC processors are used; the new processor called
sphere and shown in the following figure:

<figure><img src="image_8.png" /><figcaption>**Fig 7:** 3-D CORDIC Entity using VHDL</figcaption></figure>
Let the spherical coordinates (r, θ, φ) use 3-D CORDIC to get the equivalent Cartesian coordinates(x,y,z) performs in 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
rcosθ and rsinθ which can be used as inputs to **the second**
stage as follows:

x0= rsinθ ; y0=0 , z0=φ and the outputs will be x=rsinθcosφ

and y=rsinθsinφ and output x from the first stage represents

z = rcosθ .

**3.3 The Gain Consideration**

When the CORDIC algorithm is applied to a vector V to
rotate it by an angle Θ, a new vector V' will be generated in
such a way that changes from V to V' but magnitude change:

Where n is the number of iterations needed to generate the
end vector.

This type of change will affect both initial vector
components by a constant factor for a fixed number of
iterations, let this factor be called the gain Gn, therefore the
gain will be given as in eq. 17.

And it will affect both components of V' by multiplications
aggregate to:

Gn = 1.646760258....... as n→ ∞

But CORDIC Rotation mode equations are [6]:

$$
x_n = G_n[x_0 \cos z_0 - y_0 \sin z_0] \quad (14)
$$

$$
y_n = G_n [y_0 \cos z_0 + x_0 \sin z_0] \quad (15)
$$

$$
z_n = 0 \tag{16}
$$

$$
G_n = \prod_{i=1}^{N} \sqrt{1 + 2^{-2i}} \quad (17)
$$

Because of implementation of CORDIC twice in the
proposed 3-D model, the gain must considered twice to
eliminate the gain factor R must set to:

R = (1/Gn) * (1/Gn) = (.607253)^2 =
(0.368756206)*10000 ((to eliminate Floating Point)) =
3687.5 = (0E68)hex.

**4. Results and Discussion**

The input of 2-D CORDIC is X0=(1/Gn) and Y0=0 and Z
=Θ to get the desired output Xn=cos(Θ) and Yn=sin(Θ)
after 15 iteration.

$$
|V'| = \prod^{N} \sqrt{1 + 2^{-2i}} |V| \quad (13) \quad [6]
$$

**4.1. 2-D CORDIC Results:**

Simply let X0= (1/Gn) = (.607253) = (17B9)hexa, and Y0=0
, so the above the final iteration results will be :

$$
x_n = \cos z_0
$$

$$
y_n = x_0 \sin z_0
$$

$z_n = 0$

<table><caption>**Table 4:2-D CORDIC Results when X0=(1/Gn) and**
**Y0=0 and Z =Θ.**</caption>
  <thead>
    <tr>
      <th>Z<br>decimal</th>
      <th>Z<br>hexadecimal</th>
      <th>X<br>Theoretical</th>
      <th>X<br>Simulation</th>
      <th>X<br>*10<sup>-4</sup></th>
      <th>Y<br>Theoretical</th>
      <th>Y<br>Simulation</th>
      <th>Y<br>*10<sup>-4</sup></th>
    </tr>
    <tr>
      <td></td>
      <td></td>
      <td>Cos(z)</td>
      <td>Cos(z)</td>
      <td></td>
      <td>Sine(Z)</td>
      <td>Sine(Z)</td>
      <td></td>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>90</td>
      <td>2000</td>
      <td>0000</td>
      <td>0002</td>
      <td>2</td>
      <td>2710</td>
      <td>2711</td>
      <td>1</td>
    </tr>
    <tr>
      <td>75</td>
      <td>1AAA</td>
      <td>0A1C</td>
      <td>0A1C</td>
      <td>0</td>
      <td>25BB</td>
      <td>25BD</td>
      <td>2</td>
    </tr>
    <tr>
      <td>60</td>
      <td>1555</td>
      <td>1388</td>
      <td>1387</td>
      <td>1</td>
      <td>21D4</td>
      <td>21D6</td>
      <td>2</td>
    </tr>
    <tr>
      <td>45</td>
      <td>1000</td>
      <td>1BF9</td>
      <td>1BF9</td>
      <td>0</td>
      <td>1BF9</td>
      <td>1BF9</td>
      <td>0</td>
    </tr>
    <tr>
      <td>30</td>
      <td>0AAA</td>
      <td>21D4</td>
      <td>21D7</td>
      <td>3</td>
      <td>1388</td>
      <td>1386</td>
      <td>2</td>
    </tr>
    <tr>
      <td>15</td>
      <td>0555</td>
      <td>25BB</td>
      <td>25BE</td>
      <td>3</td>
      <td>0A1C</td>
      <td>0A19</td>
      <td>3</td>
    </tr>
    <tr>
      <td>-15</td>
      <td>FAAA</td>
      <td>25BB</td>
      <td>25BB</td>
      <td>0</td>
      <td>F5E4</td>
      <td>F5E3</td>
      <td>1</td>
    </tr>
    <tr>
      <td>-30</td>
      <td>F555</td>
      <td>21D4</td>
      <td>21D6</td>
      <td>2</td>
      <td>EC78</td>
      <td>EC79</td>
      <td>1</td>
    </tr>
    <tr>
      <td>-45</td>
      <td>F000</td>
      <td>1B9F</td>
      <td>1BA0</td>
      <td>1</td>
      <td>E461</td>
      <td>E461</td>
      <td>0</td>
    </tr>
    <tr>
      <td>-60</td>
      <td>EAAA</td>
      <td>1388</td>
      <td>1387</td>
      <td>1</td>
      <td>DE2C</td>
      <td>DE29</td>
      <td>3</td>
    </tr>
    <tr>
      <td>-75</td>
      <td>E555</td>
      <td>0A1C</td>
      <td>0A1F</td>
      <td>3</td>
      <td>DA45</td>
      <td>DA42</td>
      <td>3</td>
    </tr>
    <tr>
      <td>-90</td>
      <td>E000</td>
      <td>0000</td>
      <td>0000</td>
      <td>0</td>
      <td>D8F0</td>
      <td>D8EE</td>
      <td>2</td>
    </tr>
    <tr>
      <td>Average</td>
      <td></td>
      <td></td>
      <td></td>
      <td>1.33</td>
      <td></td>
      <td></td>
      <td>1.666<br>7</td>
    </tr>
  </tbody>
</table>

The error in X value (Cos Θ) and error in Y Value (sin Θ) is shown in figure 8 below:
<figure><img src="image_9.png" /><figcaption>**Fig 8:** The proposed 2-D CORDIC model Error in X_Value (COS (z)) and Y_Value (SIN(Z)).</figcaption></figure>

### 4.2. 3-D CORDIC Results:

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}$$

$$Z\_calculated = r * (\cos 45) = [(1/Gn^2)] * \cos45 = 0.429455 * 10000 = 4294 = (10C6)_{hexa}$$

The simulation result on Quartus II 7.1 software when (r=0E68, θ=1000, φ=1000)as shown in Figure 9:

<figure><img src="image_10.png" /><figcaption>**Fig 9:** Simulation results when(r=0E68, θ=1000, φ=0AAA).</figcaption></figure>

Let the spherical coordinates r=0E68, θ=1555, φ=0AAA

<table><caption>**Table 5:** 3-D CORDIC Results Cartesian Coordinates (X, Y, Z) Equivalent to Spherical Coordinates (r=0E68,and θ, φ).</caption><thead><tr><th>θ</th><th>φ</th><th>X<br>Calculated</th><th>X<br>simulation</th><th>X<br>Deviation*10<sup>-4</sup></th><th>Y<br>calculated</th><th>Y<br>Simulation</th><th>Y<br>De*10<sup>-4</sup></th><th>Z<br>Calculate</th><th>Z<br>simulation</th><th>Z<br>Deviation*10<sup>-4</sup></th></tr></thead><tbody><tr><td>60</td><td>30</td><td>1D4C</td><td>1D52</td><td>6</td><td>10EA</td><td>1.00E+08</td><td>3</td><td>0BDC</td><td>0BDC</td><td>0</td></tr><tr><td>45</td><td>30</td><td>17EC</td><td>17F0</td><td>4</td><td>0DCF</td><td>10C5</td><td>1</td><td>10C5</td><td>10C4</td><td>1</td></tr><tr><td>45</td><td>45</td><td>1388</td><td>138A</td><td>2</td><td>138A</td><td>10C5</td><td>2</td><td>10C6</td><td>10C4</td><td>2</td></tr><tr><td>Avg</td><td></td><td></td><td></td><td>4</td><td></td><td></td><td>2</td><td></td><td></td><td>1</td></tr></tbody></table>

The proposed model evaluates high speed calculation for : 2-D CORDIC Processor the latency = 16 clock cycle and for 3-D CORDIC Processor the latency =32 clock cycle.

## 5. Conclusions

This research paper focuses on implementing 3-D CORDIC

processor using two 2-D CORDIC Processor. This 3-D CORDIC Processor is used to convert from spherical coordinates to Cartesian coordinates and constructed using VHDL.

$$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}$$

The simulation result on Quartus II 7.1 software when (r=0E68, θ=1555, φ=0AAA)as shown in Figure 10:

<figure><img src="image_11.png" /><figcaption>**Figure 10:** Simulation results when(r=0E68, θ=1555, φ=0AAA).</figcaption></figure>

The simulation results for converting spherical coordinates r=0E68, θ, φ to equivalent Cartesian Coordinates is summarized in **table 5**.

The accuracy of 2-D CORDIC Processor is acceptable; since the average error in cosine(Θ)= 1.33*10⁻⁴ and the average error in sine(Θ) =1.6667*10⁻⁴.

The accuracy of 3-D CORDIC Processor is acceptable;

Since the average error in X_Value= 4*10⁻⁴

And the average error in Y_Value= 2*10⁻⁴

And the average error in Z_Value= 1*10⁻⁴

Using FPGA as flexible implementation tool make it easy
to modify the proposed model without additional cost.

The accuracy of 2-D CORDIC Processor is acceptable; since the average error in cosine(Θ)= 1.33*10⁻⁴ and the average error in sine(Θ) =1.6667*10⁻⁴.

The accuracy of 3-D CORDIC Processor is acceptable. The proposed model evaluates high speed calculation, reducing latency at the cost of accuracy is beneficial for numerous real-time applications like: Digital Signal Processing (DSP), wireless communication systems, navigation and GPS.

Nomenclatures

K Constant gain

Abbreviations

C Coordinate Rotation Digital Computer

O

R

D

I

C

F Field Programmable Gate Array

P

G

A

L Look Up Table

U

T

V Very High-Speed Integrated Circuit Hardware Description

H Language

D

L

References

[1] Volder, Jack E. (1959). "The CORDIC Trigonometric Computing Technique." IRE Transactions on Electronic Computers, Vol. EC-8, no. 3, 1959, pp. 330-334.

[2] Volder, J. E. (2000). "The Birth of CORDIC". Journal of VLSI Signal Processing, 25, 101-105. https://doi.org/10.1023/A:1008191618576.

[3] Duprat, J., & Muller, J. (1993). "The CORDIC algorithm: new results for fast VLSI implementation". IEEE Transactions on Computers, 42(2), 168-178.

[4] Li, Huan, and Yan Xin. (2010). "Modified CORDIC algorithm and its implementation based on FPGA." 2010 Third International Conference on Intelligent Networks and Intelligent Systems.(pp. 618-621). IEEE.

[5] Bhuria, S., & Muralidhar, P. (2010, November). FPGA implementation of sine and cosine value generators using Cordic Algorithm for Satellite Attitude Determination and calculators. In 2010

International Conference on Power, Control and Embedded Systems (pp. 1-5). IEEE.

[6] Kumar, P. A. (2019, March). FPGA implementation of the trigonometric functions using the CORDIC algorithm. In 2019 5th International Conference on Advanced Computing & Communication Systems (ICACCS) (pp. 894-900). IEEE.

[7] Mazenc, Mazenc, C., Merrheim, X., & Muller, J. M. (1993). Computing Functions cos-1and sin-1Using CORDIC. IEEE Transactions on Computers, 42(1), 118-122

[8] Sadiku, Matthew N. O. (2001), "Coordinate Systems and Transformation." Chapter 2 in Elements of Electromagnetics, third edition, Oxford University Press, pp. 23-51.

[9] Walther, J. S. (1971, May). A unified algorithm for elementary functions. In Proceedings of the May 18-20, 1971, spring joint computer conference (pp. 379-385)

[10] Neji, N., Boudabous, A., Kharrat, W., & Masmoudi, N. (2011, March). Architecture and FPGA implementation of the CORDIC algorithm for fingerprints recognition systems. In Eighth International Multi-Conference on Systems, Signals & Devices (pp. 1-5). IEEE.

[11] Gopikiran, G., & Thilagavathy, R. (2011, July). FPGA implementation of floatingpoint rotation mode CORDIC algorithm. In 2011 International Conference on Signal Processing, Communication, Computing and Networking Technologies (pp. 506-508).

[12] Andraka, R. (1998, March). A survey of CORDIC algorithms for FPGA based computers. In Proceedings of the 1998 ACM/SIGDA sixth international symposium on Field programmable gate arrays (pp. 191-200).

[13] Lakshmi, B., & Dhar, A. S. (2010). CORDIC Architectures: A Survey. Hindawi Publishing Corporation VLSI Design, 2010, Article ID 794891, 19 pages. doi:10.1155/2010/794891.

[14] Lang, T., Lang, T., & Antelo, E. (2005). High-throughput CORDIC-based geometry operations for 3D computer graphics. IEEE Transactions on Computers, 54(3), 347-361.

[15] Li, J. H., Wang, G. C., Chen, Y., Zhang, M., & Li, P. (2012). A VLSI Design of Image Rotation for Real Time 2-D Barcode Identification. Applied Mechanics and Materials, 198, 357-360.

[16] Sergiyenko, A., Moroz, L., Mychuda, L., & Samotyj, V. (2021, September). FPGA implementation of CORDIC algorithms for sine and cosine floating-point
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/.