Home
Welcome
Information


FPGA projects
Basic
Music box
LED displays
Pong game
R/C servos
Text LCD module
Quadrature decoder
PWM and one-bit DAC
Debouncer
Crossing clock domains
External contributions

Interfaces
RS-232
JTAG
I2C
EPP
SPI
PCI
PCI Express
10BASE-T

Advanced
Digital oscilloscope
Graphic LCD panel
Direct Digital Synthesis
CNC steppers
Spoc CPU core

Hands-on
A simple oscilloscope


FPGA introduction
What are FPGAs?
How FPGAs work
Internal RAM
FPGA pins
Clocks and global lines
Download cables
Configuration
Learn more

FPGA software
Design software
Pin assignment
Design-entry/HDL
Simulation/HDL
Synthesis and P&R

FPGA electronic
SMD technology
Crystals and oscillators

HDL info
HDL tutorials
Verilog tips
VHDL tips

Quick-start guides
ISE
Quartus

Site
News
FPGA links
HDL tutorials
Forum


Direct Digital Synthesis (DDS) - Introduction

Let's see how easy an FPGA DSS implementation can be.

DAC

Ok, your new FPGA board has a fast DAC (digital-to-analog converter). Here's a possible board setup with a 10-bits DAC running at 100MHz.

The FPGA provides 10-bits values at a speed of 100MHz to the DAC.
The DAC outputs an analog signal, and for periodic signals, speeds up to 50MHz can be achieved (the Nyquist limit).

A simple DDS

A DDS is used to generate periodic signals.
For now, let's try something simple and generate a square wave.

module SimpleDDS(DAC_clk, DAC_data);
input DAC_clk;
output [9:0] DAC_data;

// let's create a 16 bits free-running binary counter
reg [15:0] cnt;
always @(posedge DAC_clk) cnt <= cnt + 16'h1;

// and use it to generate the DAC signal output
wire cnt_tap = cnt[7];     // we take one bit out of the counter (here bit 7 = the 8th bit)
assign DAC_data = {10{cnt_tap}};   // and we duplicate it 10 times to create the 10-bits DAC value 
                                     // with the maximum possible amplitude
endmodule

We used above the 8th bit of a counter to generate our output.
With a counter clocked at 100MHz, the 8th bit toggles at a frequency of 100MHz/2^8=39KHz. So the DAC output is a 39KHz square signal.

Now if we want a triangular see-saw wave, let's replace the last two lines of the code with this one:

assign DAC_data = cnt[9:0];

A triangular signal isn't difficult either.

assign DAC_data = cnt[10] ? ~cnt[9:0] : cnt[9:0];

We created a DSS, all right. But a real-world DDS would allow us to:



>>> NEXT: Direct Digital Synthesis (DDS) - Arbitrary signals >>>



This page was last updated on November 17 2008.