Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to implement y=sinx in VHDL?

Status
Not open for further replies.

sachinmaheshwari

Member level 4
Member level 4
Joined
Aug 7, 2007
Messages
69
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,743
can any one tell me how to impliment
y=sinx in VHDL

please be sure whatever you r saying
 

Re: VHDL code

you can do it by :

1. preparing ROM for the calculation with all values defined.

2. in xilinx you can use CORDIC core for generating this function.

3. if your input is more limited to specific values, you can even use a decoder to
decode the values.
 

Re: VHDL code

if you want to design some core then you can try using the cordic algorithm...
there references available in the net about this algorithm which uses only shift and add operatios to compute sine as well as cos...
 

Re: VHDL code

what exactly is CORDIC algorithm?
is their some pdf regarding this?
 

Re: VHDL code

this is from xilinx coregen lib :
 
  • Like
Reactions: ypasha

    ypasha

    Points: 2
    Helpful Answer Positive Rating
Re: VHDL code

thanks

Added after 2 minutes:

Yes u can use CORDIC or look up table...

but any one tried the results??

I mean, what input u r giving , and wat iutput u r getting?? Coz, i m trying with cordic, and look up table, both i m unable to analyze the results..
 

VHDL code

hi
Is cordic Cordic algorithm is advantageous over the LUT based method ? Please let me know
 

Re: VHDL code

how to impliment
y=sinx

inputs as angles in degree represented by IEEE 32-bit floating-point no.
and produces output as IEEE 32-bit floating number

sign(1-bit) Exponent(8-bit) Mantissa(23 bit)
0/1 [(2^8 -1)- 127]=+128 to (0-127)=-127

floating point number = (+-)[1.mantissa]*2^exponent
 

VHDL code

use vhdl_Ams for the same. it becomes very simple.
 

Re: VHDL code

what is vhdl_ams
can u be more specific
n do u have any example?
i just have to write the behavioral code of it.
 

Re: VHDL code

kalyansrinivas said:
hi
Is cordic Cordic algorithm is advantageous over the LUT based method ? Please let me know

LUT method is faster, you generate the address using the input data, and pick the value from the ROM; but the accuracy depends on the LUT size, or sampling density. Since sin/cos is periodic, you can combine LUT with some taylor interpolations to improve the accuracy.

CORDIC is relatively slow, the accuracy depends on the number of iterations, so higher accuracy means longer latency. But it only requires add/shift, very area efficient.
 

VHDL code

VHDL-AMS is VHDL for Analog & Mixed Signal Modeling. Use the following link to download "The Designer's Guide to AMS Modeling", author: R. Scott Cooper, Published by Synopsys, 2004, 356 pages:
 

Re: VHDL code

Please notice, that VHLD AMS or any other HDL that can calculate sine and other mathematical function, don't help somehow to get synthesizable code for a FPGA calculating sine function. They just support this function for simulation or can calculate a ROM table.

I understand, that you want the sine function for float numbers. Known Cordic cores are using fixed point only, e. g. from opencores.org or Xilinx. In contrast, usual FPGA floating point packages have 4 fundamentals and squareroot only.

I think, if full floating point resolution is needed, you should implement an usual numerical math iterative alrorithm. That's also done by processor FPU supporting higher math functions. A lot of literature can be found regarding implementation details.
 

VHDL code

Here's a nice web page describing CORDIC algorithms:
**broken link removed**
 

    V

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top