
This chip computes sin(θ) and cos(θ) with the CORDIC algorithm (COordinate Rotation DIgital Computer). It uses no multiplier and no lookup table of sine values, only shifts, adds and a 12-entry table of angles. That is why CORDIC is used in calculators, radios, GPS receivers and motor controllers.
Start with a vector of length 1 pointing along the x-axis. Rotate it to angle θ, and its coordinates are (cos θ, sin θ).
The trick is to rotate in steps whose angles are atan(1), atan(1/2), atan(1/4), and so on (45°, 26.6°, 14.0°, 7.1°, ...). For these angles, the rotation needs only a shift by i bits and an add:
d = +1 if remaining angle z >= 0, else -1
x' = x - d * (y >> i)
y' = y + d * (x >> i)
z' = z - d * atan(2^-i)
At each step the chip rotates left or right, whichever brings the remaining angle z closer to 0. After 12 steps z is nearly 0, and (x, y) is (cos θ, sin θ).
Each step also stretches the vector slightly, by 1.647x in total. So the chip starts with x = 1/1.647 = 0.607 instead of 1, and the result comes out exactly unit length.
CORDIC only reaches about ±99.7°. For angles in the 2nd and 3rd quadrant, the chip first rotates by 180° and then negates the answer.
| Pin | Name | Description |
|---|---|---|
| ui[7:0] | ANGLE | 0..255 maps to 0°..358.6° (1.40625° per step) |
| uo[7:0] | RESULT | Signed 8-bit sin (SEL=0) or cos (SEL=1); 127 = +1.0 |
| uio[0] | START (in) | Rising edge starts a calculation |
| uio[1] | SEL (in) | 0 = show sin, 1 = show cos |
| uio[2] | SWEEP (in) | 1 = auto-step the angle, a new result every 16 clocks |
| uio[4] | DONE (out) | One-clock pulse when a new result is ready |
| uio[5] | BUSY (out) | Calculation running |
| uio[7:6] | QUAD (out) | Quadrant of the current angle |
ANGLE. For example, 32 is 45°.START. After 12 clocks DONE pulses.uo_out as a signed number: with SEL=0 it shows sin(45°) × 127 ≈ 90 (0x5A). Set SEL=1 for cos.uo_out, and one full period takes 256 results. Feed uo_out to an R-2R resistor DAC and an oscilloscope to see it.The cocotb testbench in test/ checks all 256 angles in two ways. First, it compares them bit-exactly with a Python model of the same fixed-point algorithm. Second, it checks them against the true math.sin/math.cos: the worst error is 1.47 LSB of the 8-bit output, and the internal 12-bit result is within 0.12%. It also checks timing (12 clocks), that START is ignored while busy, and that sweep mode produces a full sine period.
None required. The demo board's RP2040 can set the angle and read the results. LEDs show the value, and an optional 8-bit R-2R DAC on uo_out turns sweep mode into a visible analog sine wave.
We gratefully acknowledge the Center of Excellence (CoE) in Integrated Circuits and Systems (ICAS) and the Department of Electronics and Communication Engineering (ECE) for providing the necessary resources and guidance.
Special thanks to Dr. H V Ravish Aradhya (HoD - ECE), Dr. K R Usha Rani (Associate Dean - PG), Dr. K. S. Geetha (Vice Principal) and Dr. K. N. Subramanya (Principal) for their constant encouragement and support in facilitating this Tiny Tapeout SKY26E submission.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | ANGLE[0] | RESULT[0] | START (in) |
| 1 | ANGLE[1] | RESULT[1] | SEL (in) 0=sin 1=cos |
| 2 | ANGLE[2] | RESULT[2] | SWEEP (in) auto sine wave |
| 3 | ANGLE[3] | RESULT[3] | |
| 4 | ANGLE[4] | RESULT[4] | DONE (out) |
| 5 | ANGLE[5] | RESULT[5] | BUSY (out) |
| 6 | ANGLE[6] | RESULT[6] | QUAD[0] (out) |
| 7 | ANGLE[7] | RESULT[7] | QUAD[1] (out) |