\documentclass{article}
\usepackage[affil-it]{authblk}
\usepackage{graphicx}
\usepackage[space]{grffile}
\usepackage{latexsym}
\usepackage{textcomp}
\usepackage{longtable}
\usepackage{tabulary}
\usepackage{booktabs,array,multirow}
\usepackage{amsfonts,amsmath,amssymb}
\providecommand\citet{\cite}
\providecommand\citep{\cite}
\providecommand\citealt{\cite}
\usepackage{url}
\usepackage{hyperref}
\hypersetup{colorlinks=false,pdfborder={0 0 0}}
\usepackage{etoolbox}
\makeatletter
\patchcmd\@combinedblfloats{\box\@outputbox}{\unvbox\@outputbox}{}{%
  \errmessage{\noexpand\@combinedblfloats could not be patched}%
}%
\makeatother
% You can conditionalize code for latexml or normal latex using this.
\newif\iflatexml\latexmlfalse
\AtBeginDocument{\DeclareGraphicsExtensions{.pdf,.PDF,.eps,.EPS,.png,.PNG,.tif,.TIF,.jpg,.JPG,.jpeg,.JPEG}}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}




\begin{document}

\title{FPGA Lab 6}


\author{Alec Aivazis}
\affil{Affiliation not available}



\date{\today}

\maketitle

\selectlanguage{english}
\begin{abstract}
Lab 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.%
\end{abstract}%



\section{Introduction}

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}.

\section{Circuit}\selectlanguage{english}
\begin{figure}[h!]
\begin{center}
\includegraphics[width=0.70\columnwidth]{figures/lab6/lab6}
\caption{{\label{fig:circuit}
As discussion in section 2, the digital to audio converter was built by connecting the on board DIP switches to a MUX which allowed me to choose when I was playing the provided tone or nothing. By attaching the selection bit to a specific bit in a counter, I was able to force it to play zero for the rest of the duration. This can be thought of a a \textit{cout} pin for a modulus counter that doesn't rest when the total hits the modulus (it stays high as the counter counts). Choosing the right pin allowed me to select a particular frequency for the generated square wave. I also needed to attach the VGA connection to my clock in order to be able to read the signal.%
}}
\end{center}
\end{figure}

\selectlanguage{english}
\FloatBarrier
\end{CJK}\end{document}

