i am tring to create a DDS in fpga but i am wondering if a can because:
the precision i need is too big so my look up table it is 20 address bits
and 15 bits wide ?
From your later response I see that you're trying to create a
sinusoid rather than an arbitrary waveform, so you have many
options.
First, if the required precision is only 15 bits, you surely don't
need all 20 bits of address into the table!
Second, you can reduce the size of the table by a factor of 4
easily by dividing the 20-bit phase range into four quadrants.
You need a 2s complement negate operation on both address and
data, but otherwise it's easy.
Finally, you can use something a bit more clever than a
simple lookup table. There are two obvious possibilities:
CORDIC and interpolation.
CORDIC is so well covered by material on Ray Andraka's website
www.andraka.com that I won't even try to describe it here.
Interpolation is a useful idea. You know, of course, that
the first derivative of (sin) is (cos), which is simply (sin)
displaced by a quarter of a cycle. So, given a phase value
P, rewrite P = P0 + dP by the cunning trick of splitting the
address binary word into two equal pieces. Now you can make
the approximation
sin(P) = sin(P0) + cos(P0).dP
cos(P0) is only a second lookup in the table. You need a
multiplier and an adder, of course. And there's some scaling
to be done.
Other possibilities include creating a very approximate sine
wave and then passing it through a digital lowpass filter
whose sample rate is also controlled by the DDS.
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL, Verilog, SystemC, Perl, Tcl/Tk, Verification, Project Services
Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail:
[email protected]
Fax: +44 (0)1425 471573 Web:
http://www.doulos.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.