- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Is there anyone can help me to deal with one problem: How to create sine or cos waves in Cyclone III FPGA in VHDL. I have no clear idea to program the VHDL code although I have search some documents. I will be much appreciate if someone can help me out. Thank you very much. Best wishes, peipeiLink Copied
9 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you have no VHDL knowledge, my first suggestion would be to find a good tutorial and get yourself familiar with the language.
As for the sin waves, sine and cosine are identical, but with a phase shift. It would be easy enough to build a ROM of sin values in VHDL and just read them out.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Or read up on Goertzel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are many methods that can be used, A simple lookup table is the easiest, then just step through the lookup table at different rates.
If you truly want to generate Sin and Cos values, a CORDIC algorithm is the way to go. Pete- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If it was me I will use the altera ip away from manual hdl coding. I think cordic is too much for a beginner to hand code or understand.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- If it was me I will use the altera ip away from manual hdl coding. I think cordic is too much for a beginner to hand code or understand. --- Quote End --- Does altera provide cordic IP for user now?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tricky,
I have learnt VHDL and I suppose I have some knowledge of this language. But just for this application, I have not clear idea to achieve this. In my mind, I want to use Look up table, due to the ADA board is 14 bits, and I have generated the different values in Excel for one cycle, I am not sure should I generate all 2^14 values or not. Thanks for your reply. Best wishes, peipei --- Quote Start --- If you have no VHDL knowledge, my first suggestion would be to find a good tutorial and get yourself familiar with the language. As for the sin waves, sine and cosine are identical, but with a phase shift. It would be easy enough to build a ROM of sin values in VHDL and just read them out. --- Quote End ---- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jerry,
I am planning to use LUT. Do you have specific suggestions? My ADA board is 14 bits. Thanks, Best wishes, peipei --- Quote Start --- Does altera provide cordic IP for user now? --- Quote End ---- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Remember Sin and cosine are reflective, so you only need 2^13 values in the rom, you use the 14th bit as the sign bit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CORDIC is suitable for generating the sin/cos of an angle.
You can generate sin(a + delta) from sin(a - delta) and sin(a) with a single multiply (and a shift). The only slight problen is that the amplitude can drift.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page