Rather than running the CORDIC off degrees, run it off a phase value from

0-1 corresponding to 0-360 degrees.

Just multiply an 18-bit input by 2^18/360 and use only the bottom 18 bits

from the multiply, effectively truncating the integer portion of a

fixed-decimal number. The 18 bits are (phase/360 - int(phase/360)) * 2^18

or using a less popular notation frac(phase/360)*2^18.

<

[email protected]> wrote in message

news:

[email protected] oups.com...

> I am attempting to implement a sine function using cordic method. I

> can't figure out how to reduce an arbitrary angle to -90 and 90 deg.

> For example, if an input is 390 deg, it should be reduced to 30 deg

> before passing to the cordic method. What algorithm can i use to

> efficiently reduce a arbitrary angle down to -90 and 90 deg.

>

> Any help would be much appreciated

>

> Thanks

> pvn