This project implements a basic 8-bit Direct Digital Synthesizer (DDS) that outputs a digitized sine wave with a user-defined frequency.
phase_inc
) via the ui_in[7:0]
pinsuio_in[0]
(load_freq
) loads this value into DDSload_freq
trigger is applied, the DDS runs at a default low frequency (corresponding to phase_inc = 8'd1
)Internally, a phase accumulator adds phase_inc
to a phase register on each clock cycle. The 8-bit output of the accumulator directly indexes a sine look-up table (LUT) with 256 entries. Each LUT value corresponds to a digtized amplitude sample of a sine wave. These values are sent to uo_out[7:0]
, which can be converted to an analog waveform using an external R-2R DAC.
The output frequency is given by the standard DDS formula:
f_out = (phase_inc / 2^N) * f_clk,
where,
phase_inc
is the user-defined tuning word (8 bits)N = 8
is the size of the phase accumulator (for this simplified implementation)f_clk = 66 MHz
is the system clockThis design is based on principles described in Analog Devices’ application note:
"Fundamentals of Direct Digital Synthesis (DDS)" — Analog Devices https://www.analog.com/media/en/training-seminars/tutorials/MT-085.pdf
ui_in[7:0]
to set the frequencyuio_in[0]
high momentarily to load the new valueuo_out[7;0]
to an R-2R DAC to view the generated sine waveExample:
8'b00000001
produces a wave of ~258 kHz8'b10000000
produces a wave of ~33 MHz (Nyquist limit)ui_in
) and trigger (uio_in[0]
)uo_out[7:0]
into an analog sine waveform# | Input | Output | Bidirectional |
---|---|---|---|
0 | phase bit 0 | sine amplitude bit 0 | load_freq trigger (active high) |
1 | phase bit 1 | sine amplitude bit 1 | |
2 | phase bit 2 | sine amplitude bit 2 | |
3 | phase bit 3 | sine amplitude bit 3 | |
4 | phase bit 4 | sine amplitude bit 4 | |
5 | phase bit 5 | sine amplitude bit 5 | |
6 | phase bit 6 | sine amplitude bit 6 | |
7 | phase bit 7 | sine amplitude bit 7 |