FPGA Lab 6

AbstractLab 6 instructed us to design a digital to analog converter in order to generate a square wave which would drive a speaker connected to the supplied FPGA. We also needed to be able to set the amplitude of the generated signal using the DIP switches present. This lab was very useful to show the basic theory behind digital to analog converters which need to turn digital values into actual signals. Also, this square wave generator is very useful in creating complicated audio signals which are composed of square waves of varying frequency.


In order to build the DAC I needed to find a way to have the binary number turn into a longer pulse width. Luckily, the FPGAs already connected the VGA output to an pulse width modulated audio codec. This meant that all I needed to do was send the correct signal and the board would take care of the rest. After setting the frequency using the select bit on a MUX, the final task was to be able to modulate the volume of the tone with the on board DIP switches. In order to do this I connected the switches to the same MUX that was being used to select the frequency as shown in figure \ref{fig:circuit}.