CORDIC Trigonometric IP
Rotation Mode – Parameter Sensitivity & Accuracy Characterization
1. Configuration Under Test
| Parameter | Value |
|---|---|
| Internal Width (WIDTH) | 32 |
| Iterations (ITER) | 16 |
| Angle Fraction Bits | 30 |
| Sin/Cos Output Width | 16 |
| Sin/Cos Output Shift | 16 |
| Tan Output Width | 32 |
| Tan Fraction Bits | 30 |
| Angle Range | −1.5 rad to +1.4 rad |
2. Error Metrics
- Max Error: Maximum absolute deviation across angle sweep
- RMS Error: Root-mean-square error across angle sweep
- Reference values computed using double-precision math library
3. Iteration Count Sweep (Convergence Depth)

| ITER | Sin Max Err | Sin RMS Err | Cos Max Err | Cos RMS Err | Tan Max Err | Tan RMS Err |
|---|---|---|---|---|---|---|
| 4 | 9.9996e-02 | 5.1013e-02 | 1.1835e-01 | 4.8638e-02 | 1.6101e+01 | 3.1321e+00 |
| 8 | 7.0190e-03 | 3.0690e-03 | 6.8520e-03 | 2.8060e-03 | 1.2101e+01 | 2.4568e+00 |
| 12 | 3.7200e-04 | 1.7700e-04 | 4.1100e-04 | 1.7700e-04 | 1.2101e+01 | 2.4568e+00 |
| 16 | 6.9000e-05 | 3.9000e-05 | 7.2000e-05 | 3.9000e-05 | 1.2101e+01 | 2.4568e+00 |
| 22 | 6.1000e-05 | 3.5000e-05 | 5.8000e-05 | 3.4000e-05 | 1.2101e+01 | 2.4568e+00 |
Observations
- Sin/Cos error decreases exponentially with iteration count until convergence
- Beyond ~ITER = 16, improvement is limited by fixed-point quantization
- Tangent error does not improve beyond ~8 iterations
- Tangent error is dominated by
1 / cos(x)behavior near |x| → π/2
4. Angle Fraction Bits Sweep (Phase Quantization)

| ANGLE_FRAC_BITS | Sin Max Err | Sin RMS Err | Cos Max Err | Cos RMS Err | Tan RMS Err |
|---|---|---|---|---|---|
| 20 | 6.25e-02 | 3.55e-02 | 5.91e-02 | 3.49e-02 | 1.06e-03 |
| 24 | 3.91e-03 | 2.23e-03 | 3.50e-03 | 2.20e-03 | 1.04e-03 |
| 28 | 2.44e-04 | 1.38e-04 | 2.44e-04 | 1.39e-04 | 1.11e+00 |
| 30 | 6.90e-05 | 3.90e-05 | 7.20e-05 | 3.90e-05 | 2.46e+00 |
Observations
- Sin/Cos error scales approximately with
2^(-ANGLE_FRAC_BITS) - Below ~24 bits, phase quantization dominates
- Tangent accuracy improves only until angle resolution exceeds tangent fractional resolution
5. Internal Width Sweep (Datapath Precision)

| WIDTH | ITER | Sin RMS Err | Cos RMS Err | Tan RMS Err |
|---|---|---|---|---|
| 20 | 14 | 9.06e-03 | 9.69e-03 | 2.19e-03 |
| 24 | 16 | 9.50e-03 | 9.69e-03 | 1.06e-03 |
| 28 | 18 | 2.11e-03 | 2.20e-03 | 1.72e-04 |
| 32 | 16 | 3.90e-05 | 3.90e-05 | 2.46e+00 |
| 40 | 24 | FAIL | FAIL | FAIL |
Observations
- Internal width below ~28 bits causes noticeable amplitude distortion
- WIDTH ≥ 32 provides stable convergence for sin/cos
- Excessively large width with mismatched output scaling causes catastrophic failure
6. Sin/Cos Output Width & Scaling
6.1 Correct Scaling (Reference)

| OUT_WIDTH | OUT_SHIFT | Sin RMS Err | Cos RMS Err |
|---|---|---|---|
| 16 | 16 | 3.90e-05 | 3.90e-05 |
6.2 Reduced Output Width (Quantization Noise)

| OUT_WIDTH | OUT_SHIFT | Sin RMS Err | Cos RMS Err |
|---|---|---|---|
| 14 | 14 | 9.49e-03 | 9.69e-03 |
| 12 | 12 | 6.91e-01 | 7.24e-01 |
| 10 | 10 | 6.90e-01 | 7.23e-01 |
6.3 Incorrect Scaling (Failure Region)

| OUT_WIDTH | OUT_SHIFT | Sin RMS Err | Cos RMS Err |
|---|---|---|---|
| 16 | 14 | 7.13e-01 | 7.36e-01 |
| 16 | 12 | 6.86e-01 | 7.24e-01 |
| 16 | 10 | 6.90e-01 | 7.23e-01 |
Observations
-
Incorrect output scaling causes:
- Sign inversion
- Amplitude collapse
- Severe clipping
-
RMS error saturates near ~0.7–0.75 in failure regions
-
These behaviors are deterministic and reproducible
7. Tangent Accuracy Summary
| Configuration | Tan Max Err | Tan RMS Err |
|---|---|---|
| ITER ≥ 8, Correct Scaling | 1.21e+01 | 2.46e+00 |
| Low Angle Resolution | 5.66e-03 | 1.06e-03 |
| Underscaled Outputs | 1.21e+01 | 2.46e+00 |
Observations
- Tangent error is dominated by
cos(x)approaching zero - Large absolute errors near ±1.5 rad are expected
- Tangent behavior is numerically stable but inherently ill-conditioned
8. Key Takeaways (Rotation Mode)
- ITER = 16 is sufficient for full convergence at 30-bit angle precision
- ANGLE_FRAC_BITS ≥ 28 required for high-accuracy sin/cos
- WIDTH ≥ 28 recommended for clean amplitude behavior
- Correct output scaling is mandatory
- Tangent accuracy is fundamentally limited and should be treated as best-effort
CORDIC Trigonometric IP
Vectoring Mode – Parameter Sensitivity & Accuracy Characterization
1. Configuration Under Test
| Parameter | Value |
|---|---|
| Internal Width (WIDTH) | 32 |
| Iterations (ITER) | 16 |
| Angle Fraction Bits | 30 |
| Magnitude Output Width | 16 |
| Magnitude Output Shift | 16 |
| Angle Output Width | 16 |
| Angle Output Shift | 16 |
| Input Range (x,y) | −0.82 to +0.82 |
2. Error Metrics
- Max Error: Maximum absolute deviation across input grid
- RMS Error: Root-mean-square error across input grid
- Reference values computed using double-precision
sqrt(x²+y²)andatan2(y,x)
3. Iteration Count Sweep (Convergence Depth)

| ITER | MAG Max Err | MAG RMS Err | ATAN2 Max Err | ATAN2 RMS Err |
|---|---|---|---|---|
| 4 | 8.4748e-03 | 3.9920e-03 | 3.1891e+00 | 4.8051e-01 |
| 8 | 1.0864e-04 | 4.6999e-05 | 3.3063e+00 | 4.9290e-01 |
| 12 | 5.6371e-05 | 2.5566e-05 | 3.3136e+00 | 4.9396e-01 |
| 16 | 5.6426e-05 | 2.5597e-05 | 3.3140e+00 | 4.9403e-01 |
| 22 | 5.6426e-05 | 2.5598e-05 | 3.3141e+00 | 4.9403e-01 |
Observations
- Magnitude error decreases exponentially with iteration count until convergence
- Beyond ~ITER = 12–16, magnitude accuracy is limited by output quantization
- ATAN2 error does not improve with additional iterations
- ATAN2 RMS error remains approximately constant at ~0.49 rad
- Maximum ATAN2 error occurs at
(x ≈ 0, y ≈ 0)due to undefined phase
4. Angle Fraction Bits Sweep (Phase Quantization)

| ANGLE_FRAC_BITS | MAG Max Err | MAG RMS Err | ATAN2 RMS Err |
|---|---|---|---|
| 20 | 5.7255e-02 | 2.6757e-02 | 4.8723e-01 |
| 24 | 3.4240e-03 | 1.8991e-03 | 4.9388e-01 |
| 28 | 2.2624e-04 | 1.4366e-04 | 4.9402e-01 |
| 30 | 5.6426e-05 | 2.5597e-05 | 4.9403e-01 |
Observations
- Magnitude error scales approximately with
2^(-ANGLE_FRAC_BITS) - Below ~24 bits, phase quantization dominates magnitude accuracy
- ATAN2 accuracy does not significantly improve beyond ~20–24 bits
- ATAN2 error floor is dominated by vectoring decision ambiguity near zero magnitude
5. Internal Width Sweep (Datapath Precision)

| WIDTH | ITER | MAG RMS Err | ATAN2 RMS Err |
|---|---|---|---|
| 20 | 14 | 7.7282e-03 | 4.9277e-01 |
| 24 | 16 | 7.7282e-03 | 4.9280e-01 |
| 28 | 18 | 1.8991e-03 | 4.9388e-01 |
| 32 | 16 | 2.5597e-05 | 4.9403e-01 |
| 40 | 24 | FAIL | FAIL |
Observations
-
WIDTH < 28 introduces significant magnitude distortion
-
WIDTH ≥ 32 provides stable magnitude convergence
-
Excessive internal width with mismatched output scaling causes:
- Severe magnitude collapse
- Incorrect angle quadrant decisions
- Catastrophic numerical failure
6. Magnitude Output Width & Scaling
6.1 Correct Scaling (Reference)

| MAG_OUT_WIDTH | MAG_OUT_SHIFT | MAG RMS Err |
|---|---|---|
| 16 | 16 | 2.56e-05 |
6.2 Reduced Output Width (Quantization Noise)

| MAG_OUT_WIDTH | MAG_OUT_SHIFT | MAG RMS Err |
|---|---|---|
| 14 | 14 | 7.73e-03 |
| 12 | 12 | 7.73e-03 |
6.3 Incorrect Scaling (Failure Region)

| MAG_OUT_WIDTH | MAG_OUT_SHIFT | MAG RMS Err |
|---|---|---|
| 18 | 18 | FAIL |
Observations
- Correct output scaling is mandatory for magnitude stability
- Underscaling introduces deterministic amplitude bias
- Overscaling causes catastrophic underflow and sign instability
7. ATAN2 Accuracy Summary
| Configuration | ATAN2 Max Err | ATAN2 RMS Err |
|---|---|---|
| ITER ≥ 8, Correct Scaling | 3.31e+00 | 4.94e-01 |
| Low Angle Resolution | 3.26e+00 | 4.87e-01 |
| Zero-Magnitude Inputs | π–2π jumps | Dominant |
| Overscaled Internal Width | FAIL | FAIL |
Observations
-
ATAN2 error is dominated by:
(x,y) → (0,0)singularity- Quadrant boundary ambiguity
-
Large absolute errors near zero magnitude are expected
-
ATAN2 is numerically stable but inherently ill-conditioned
8. Key Takeaways (Vectoring Mode)
- ITER = 12–16 sufficient for full magnitude convergence
- ANGLE_FRAC_BITS ≥ 24 required for accurate magnitude
- WIDTH ≥ 28 recommended; WIDTH = 32 ideal
- Correct output scaling is mandatory
- ATAN2 output should be treated as best-effort phase estimation
(x,y) = (0,0)must be explicitly handled in system logic