# How can calculate the sine an cosine function by using FPGA?

Status
Not open for further replies.

#### nattawoot_s

##### Newbie level 5 how to calculate cosine

How can calculate the sine and consine function by using FPGA or VHDL code?

#### lollobrigido

##### Full Member level 2 calculate sine

try to search in google or similar, about "CORDIC" algorithms

Good luck
Lollo

#### redsk_y

##### Member level 4 cos calculation vhdl

You can use a look-up table or a CORDIC algorithm.

Try a search also in this forum.

If you use @ltera they have an evaluation macro that implements
CORDIC in serial or parallel way.

Bye

#### Gunship

##### Member level 2 sine calculation vhdl

nattawoot_s said:
How can calculate the sine and consine function by using FPGA or VHDL code?

If you are using Xilinx, you can use the coregen to produce a sine cosine lookup table. I am not sure how Altera will work but I will assume they have something like that also.

Gunship

#### Mazi3

##### Advanced Member level 4 vhdl code to calculate sine using cordic

for small table of sines/cosines you can use look-up table, for values more precise you can use CORDIC.

CORDIC is very simple in fact, if you take any complex number, let it be overal length of 1, then if you multiply with another complex number with length 1 then you in fact just rotates the first one.

for example take Z*e^ia where a is angle (let it be 0) and i is SQRT(-1);imaginary unit and Z is nonzero constant. this is complex number laying on real axe (cos a + i sin a)-Euler's rule.
then if you multiply it with e^ib, where b is also angle (nonzero for example), you get
Z*e^î(a+b). as you see you have rotated vector Z around center for angle b. :idea:
with this in mind you can make sin/cos generator (but you need very small look table - very eficient method is by principle of succesive aproximation). the resut is precise as you want it Use pipeline multiplier, becouse you need four multipliers (if' it's pipelined, you can multiplex imput data and then demultiplex result)

#### nattawoot_s

##### Newbie level 5 calculate sinus

I'm used altera Flex10k FPGA.

#### steshenko

##### Member level 3 how to calculate cos

There are special IP Core In Xilinx Core Generator. Imho, best way - look-up table - calculation provide many cells and slowly.

#### bunalmis

##### Full Member level 5 calculation of sines

Do you want to calculate sinus of any angle. (0, pi/2, pi, pi/4 .. random)
or do you want to calculate sinus of periodic incremental angle.(0,0.01,0.02,0.03.....) Which one ?

#### gnomix

##### Member level 4 cosine series vhdl code

nattawoot_s said:
How can calculate the sine and consine function by using FPGA or VHDL code?

For synopsys users:
If you have the DesignWare Foundation Library (dw_2) licensed, you can use the DW02_sincos model.

see attached file.

#### snakebites

##### Junior Member level 2 sine lookup table fpga

Xilinx has IPcore named CORDIC. It will can be configured as sin, cos, arc tan, square root function.

#### lcking

##### Member level 1 how to calculate sine

DDS through LUT or CORDIC algorithm

#### ddt694

##### Full Member level 3 how to calculate sinus

LUT may be the most popular way for FPGA

#### lcking

##### Member level 1 tan lookup table fpga

CORDIC algorithm is easy to implement with FPGA

#### Aircraft Maniac

##### Member level 5 #### Hello

##### Newbie level 2 vhdl+sine

if I use xilinx FPGA, what is the max speed that can be achieved...and how much resource will it take...

#### Hello

##### Newbie level 2 sine cosine fpga

if I use xilinx FPGA, and use cordic algorithm, what is the max speed that can be achieved...and how much resource will it take...

#### Aircraft Maniac

##### Member level 5 using lookup tables sine cosine in vhdl

For the cordic core at opencores the following data is available:

Vendor Family Device Resource usage Max. Clock speed
Altera ACEX EP1K50-1 2190lcells 68MHz
Xilinx Spartan-II XC2S100-6 704slices 93MHz

Aircraft Maniac

#### amithsanu

##### Newbie level 4 how to use the ipcore for sine in a project

#### bigdogguru

##### Administrator Re: How can calculate the sine an cosine function by using F

If you want to "Roll Your Own" here an interesting PDF on CORDIC Algorithms for FPGAs.

It's always good to know the reason why!

#### rohi

##### Newbie level 4 Re: How can calculate the sine an cosine function by using F

i want to implement a function which will convert cartesian to polar co-orinates using IPcoder CORDIC in VHDL using Xlinx.

help me

Status
Not open for further replies.

Replies
4
Views
2K
Replies
8
Views
2K
Replies
1
Views
4K
Replies
2
Views
1K
Replies
5
Views
2K