Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sine Wave Generation on the XUP Virtex-II Pro Development System Steven Wasson ECE 443 – Hardware Design in VHDL Assignment 3 – Sine Wave Generation October.

Similar presentations


Presentation on theme: "Sine Wave Generation on the XUP Virtex-II Pro Development System Steven Wasson ECE 443 – Hardware Design in VHDL Assignment 3 – Sine Wave Generation October."— Presentation transcript:

1 Sine Wave Generation on the XUP Virtex-II Pro Development System Steven Wasson ECE 443 – Hardware Design in VHDL Assignment 3 – Sine Wave Generation October 17, 2007

2 Sine Computation via CORDIC 16-Bit Architecture with Radix Point after the MSB The Input Angle (Z 0 ) is represented as Fractions of pi not radians  Can be signed [-1, +1) or unsigned [0, 2) Output is signed and is computed from the following iterative equations for i = [0..15]:  Z i+1 = Z i – σ i α i, where α i = atan(2 -i ) / π.  X i+1 = X i – σ i Y i  Y i+1 = Y i + σ i X i  ║(X 0, Y 0 )║ ≈ 0.607253  σ i = +1 if Z i ≥ 0 else -1 Signed Fractions of Pi Representation of Input Angle Unsigned Fractions of Pi Representation of Input Angle

3 Sine Wave Generation Discrete Sine Wave in radians: sin(2πfnT S ) Discrete Sine Wave in fractions of pi: sin(2fnT S ) Let T S = 2 -16 (F S = 65,536 Hz)  sin(2 -15 fn)  Place the radix point of f after the MSB  The parameter, f, can either be interpreted as an integer frequency value or a fraction of the Nyquist rate (32,768 Hz) Use the MULT18X18 Virtex-II primitive to compute f * n Compute the sine wave for f periods and repeat indefinitely  One period: N = 1 / (f * T S ) = 65,536 / fBAD!!  f periods: N f = 1 / T S = 65,536GOOD!!  n can now be derived from a free-running 16-bit counter

4 Block Diagram SINE_WAVE_OUT (16-bit) DONE Y GO Frequency 16-bit System_Clock 100 MHz 16-Bit Counter Clock Divider f out = f in / 2 Clock Divider f out = f in / 1526 Sample_Clock ≈ 65,536 Hz CORDIC_Clock 50 MHz 16-bit Multiplier MULT18X18 Sine Wave Controller CORDIC 16-Bit Sequential Implementation DATA_IN SAMPLE_PULSE n f * SINE_WAVE_OUT is valid on Rising Edge of SAMPLE_PULSE

5 Simulation with ModelSim & MATLAB Simulate with frequency = 100 Hz for 100 ms Save simulation data to a text file Read data into MATLAB and plot

6 Verification with Chipscope & MATLAB Capture 8192 samples Save captured data to a text file Read data into MATLAB and plot

7 Resource Utilization without Chipscope

8 Resource Utilization with Chipscope

9 Preview of Next Week’s Presentation PC_BEEP_TONE_INDivider Buttons[4:0] Switch Debouncer Tone Select Sine Wave Generator Square Wave Generator Frequency AC97 CODEC Switch[0] DATA_IN The goal is to hear the difference in sound between a “pure” tone (sine wave) and a heavily distorted tone (square wave).


Download ppt "Sine Wave Generation on the XUP Virtex-II Pro Development System Steven Wasson ECE 443 – Hardware Design in VHDL Assignment 3 – Sine Wave Generation October."

Similar presentations


Ads by Google