# cebarnes/cordic architecture

> Architecture diagram of the GitHub repository cebarnes/cordic, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cebarnes/cordic
- Repository: https://github.com/cebarnes/cordic

## Overview

This small repository contains a Python CORDIC rotation demo and a separate Verilog source file. In Python, `main` runs the rotation, then computes an angle from the returned pair. The rotation routine builds a tangent table, obtains the gain factor, and prints and returns its computed values. The Verilog file appears to be a hardware implementation based on its name, but its contents and connections could not be verified; the testbench is omitted as validation machinery.

Main entry points: [`cordic.py`](https://github.com/cebarnes/cordic/blob/master/cordic.py) (Python main)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_main["Python main<br/>[cordic.py]"]
node_rotation["CORDIC rotation<br/>[cordic.py]"]
node_table["Tangent table<br/>[cordic.py]"]
node_gain["Gain factor<br/>[cordic.py]"]
node_angle["Angle calculation<br/>[cordic.py]"]
node_math["Math library"]
node_results["Printed results"]
node_hdl["Verilog source<br/>[cordic.v]"]

node_user -->|"runs"| node_main
node_main -->|"calls"| node_rotation
node_main -->|"calls"| node_angle
node_rotation -->|"builds"| node_table
node_rotation -->|"calls"| node_gain
node_table -->|"uses atan"| node_math
node_gain -->|"uses sqrt"| node_math
node_rotation -->|"prints"| node_results
node_main -->|"prints angle"| node_results

click node_main "https://github.com/cebarnes/cordic/blob/master/cordic.py"
click node_rotation "https://github.com/cebarnes/cordic/blob/master/cordic.py"
click node_table "https://github.com/cebarnes/cordic/blob/master/cordic.py"
click node_gain "https://github.com/cebarnes/cordic/blob/master/cordic.py"
click node_angle "https://github.com/cebarnes/cordic/blob/master/cordic.py"
click node_hdl "https://github.com/cebarnes/cordic/blob/master/cordic.v"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user toneBlue
class node_main,node_rotation,node_table,node_gain,node_angle,node_hdl toneTeal
class node_math,node_results toneIndigo
```

## Components

### Other components

- **User**
- [Python main](https://github.com/cebarnes/cordic/blob/master/cordic.py): `cordic.py`
- [CORDIC rotation](https://github.com/cebarnes/cordic/blob/master/cordic.py): `cordic.py`
- [Tangent table](https://github.com/cebarnes/cordic/blob/master/cordic.py): `cordic.py`
- [Gain factor](https://github.com/cebarnes/cordic/blob/master/cordic.py): `cordic.py`
- [Angle calculation](https://github.com/cebarnes/cordic/blob/master/cordic.py): `cordic.py`
- **Math library**
- **Printed results**
- [Verilog source](https://github.com/cebarnes/cordic/blob/master/cordic.v): `cordic.v`

## Connections

- User → Python main: runs
- Python main → CORDIC rotation: calls
- Python main → Angle calculation: calls
- CORDIC rotation → Tangent table: builds
- CORDIC rotation → Gain factor: calls
- Tangent table → Math library: uses atan
- Gain factor → Math library: uses sqrt
- CORDIC rotation → Printed results: prints
- Python main → Printed results: prints angle
