How many bits precision do you need? How many angles, or what is the

angular resolution you need? How about the angular range if less than

+/-pi? There are several ways of obtaining the sine. For lower angular

resolution, a look up table works fine if you have the on-chip memory

available. There are also several approximations (one that I've used is

a two step linear approximation with a correction that uses two fairly

small look-ups). You can also compute the sign algorithmically using a

CORDIC rotation at the expense of more latency. If your design needs to

multiply some signal by a sine, say a mixer and local oscillator, then

CORDIC might be advantageous as it can accomplish both the sine and the

multiply in one operation. I have papers on my website on CORDIC and a

Xilinx XCELL article I wrote on using CORDIC as a mixer in a digital

radio app. For behavioral VHDL, you can use the sine and cosine

functions in ieee.math_real...those are computed using CORDIC in that

package, by the way.

SD wrote:

> Hi,

> I am trying to implement a DSP algorithm in a FPGA. My algorithm has

> sine and cosine functions in it. Can somebody help me in implementing

> sine and cosine functions in MATLAB fixed point (using fixed point

> toolbox) or VHDL.

> Thanks,

> SD
--

--Ray Andraka, P.E.

President, the Andraka Consulting Group, Inc.

401/884-7930 Fax 401/884-7950

email

[email protected]
http://www.andraka.com
"They that give up essential liberty to obtain a little

temporary safety deserve neither liberty nor safety."

-Benjamin Franklin, 1759