A part of my project in Signal Processing is to generate a sine signal with the cordic algorithm in VHDL and put the VHDL Code on a board and test it. Do somebody have an idea for a VHDL code example?
You need to check some basic papers related to this field. They are http://teal.gmu.edu/courses/ECE645/projects_S06/talks/CORDIC.pdf, http://zatto.free.fr/manual/Volder_CORDIC.pdf (citations 2230). I had studied architectural design of IC back in 2012 fall during my MS course work and found this segment (CORDIC) very interesting. You first study the theory portions, understand the working principle and architecture. Once you are done with architecture, you can go ahead with verilog/VHDL for implementing the same. I think this helps you.
Depending on the accuracy you need, you might want to use table lookup with interpolation. It is much faster as only one or two fixed point arithmetic operations are needed. Rotate into a quadrant to reduce table size, and extract a number of bits from the argument corresponding to your table size for immediate lookup.
Hi, you can check my implementation of a universal, multi-mode, CORDIC machine in synthesizable RTL VHDL. It comes with reference C code and a number of tests.
http://opencores.org/project,kvcordic
I am sure that this can be parameterized for the new VHDL-2008 fixed-point data types with reasonable effort.
The algorithm in the code shown seems to be fine. It has fixed number of iterations - 15. The angles given in a table (see tan_array) range from 0.25*pi to ~(10^-5)*pi covering the total area of more than pi/2. This allows you to find any angle from the cordic input range (if no preprocessors are used) with ~0,002 deg maximum accuracy.
You might want to checkout kvcordic, my implementation of a multi-mode, universal, CORDIC. There is documentation, software implementation of the algorithm plus VHDL hardware description. You can download it from either: http://github.com/nkkav/kvcordic or http://opencores.org/project,kvcordic . The Github repository is always up-to-date. I use fixed-point arithmetic with a Q2.14 representation. Both the C and VHDL testbenches showcase function approximation as for sine, cosine, atan, sqrt, etc.
It, mostly, depends of vendor, most of them have different IP-cores for that. If you use Altera (now Intel FPGA), they have NCO IP core. You can generate sin signal with it. If you want to calculate sin from some input value, then you can choose CORDIC IP-core, wich appeared in Quartus 16.0
can anyone please help me with matlab code for sine wave generation using cordic!!?? i have seen people doing it in VHDL.. if there any code in matlab please send me.. Atleast the pseudo code.
Daniil Smirnov yes i saw this code..but i need to know what is written inside the cordicsin function..and also whether when we generate a sine wave it will start only from 0 or from some other amplitude?