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.

Implementing a LUT with VHDL's DDS Compiler

Status
Not open for further replies.

waleed82

Newbie level 4
Joined
Mar 12, 2013
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,317
hello guys, I am working on a project which requires sine wave frequencies from MATLAB/SIMULINK using the system generator to be implemented into VHDL as a LUT. I want to use the DDS Compiler to generate the sine waves but am not sure how to put in a LUT for the values. It is an 12-bit output sine wave which is outputted to a DAC, I use a Spartan3E FPGA.

Any help is greatly appreciated, and if you need more info just ask.

THANKS
 

hello guys, I am working on a project which requires sine wave frequencies from MATLAB/SIMULINK using the system generator to be implemented into VHDL as a LUT. I want to use the DDS Compiler to generate the sine waves but am not sure how to put in a LUT for the values. It is an 12-bit output sine wave which is outputted to a DAC, I use a Spartan3E FPGA.

Any help is greatly appreciated, and if you need more info just ask.

THANKS


First point is to understand how much memory you will need for the application.Since your output word is going to be 12 bits long, you require a maximum of 12x2^12(48 Kbits) bits of memory.If you are going to use the symmetric nature of sine wave then it can be brought down to 48/4=12Kbits. Since this much is large for a distributed type of memory, choose a block ram to store the data.

How to generate the data values?

Use MATLAB
n=[0:2^12-1];
x=sin(2*pi*n/(2^12)); % x ranges from +1 to -1; This is the sine wave representing the minimum frequency wave for a particular sampling frequency that encloses almost all the levels in a 12 bit number.

Since DAC requires offset binary with values ranging from 0 to 4095, introduce a DC shift.
i.e x=x+1;
x=x*2048;
x=round(x);
convert the values to binary using dec2bin with 12 bit as length.
export it to a .COE file and use as the init file for block ram to be used in the design.

Hope it serves your purpose.:|
 

Hello,

Thanks a lot vishak for your reply I typed what you gave me in matlan command window but i am a bit conviused, when i type all the equations how can i convert to bin and I am using Xilinx Rom block how can i use the file init. I am sorry if my questions seems stupid but i am really new to this field.

Many thanks.
 

Attachments

  • waa.JPG
    waa.JPG
    115.9 KB · Views: 100

dec2bin is the command. The output will be in char. when i said init file , i meant the initialization vector for the ROM module.
you can search the xilinx website for the syntax for COE file for ROM initialization. When you instantiate ROM in your design, use the COE file containing the binary converted values as your init vector.
 

Thanks a lot there problem is now solved i really appreciate your help
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top