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


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



\date{\today}

\maketitle

\selectlanguage{english}
\begin{abstract}
Lab 7 instructed me to build an 8-bit triangle-wave and sine-wave generator. After building the triangle-wave generator I designed a sine-wave generator by using the output of the triangle wave as the read address for a ROM block which had the appropriate values in order to generate a since wave over the correct period. This lab was extremely useful in demonstrating how one can use a ROM block in order to save data that needs to be reproduced at a later time, an extremely common task in designing complicated circuits. %
\end{abstract}%



hello

\section{Introduction}
Lab 7 instructed me to design a signal generator capable of producing two different kinds of signals: triangle and sine. In order to construct the triangle generator, I used an updown counter which switched at the half period of the generated wave. the only challenged that I encountered while desinging this was to find a way to have the counter switch at a particular value. This was accomplished using an S/R flip flop. In order to have the triangle wave oscillate with a particular frequency, I connected the 5th bit of a counter which changes every $2^5$ clock cycles. For the 50 MHz clock driving the FPGA, this corresponded to a frequency of 1.3 KHz.  I then was able to turn the triangle wave generator into a sine wave by connecting the output of the triangle wave to a ROM block which had the necessary values to generate it.  As this lab was relatively short and the FPGA has an on board codec, there were not many obstacles that I encountered while designing this circuit. I was able to easily test my design by attaching the audio jack to an osciliscope and verifying the waveform.

\section{Circuits}\selectlanguage{english}
\begin{figure}[h!]
\begin{center}
\includegraphics[width=0.70\columnwidth]{figures/6-1/6-1}
\caption{{Part 1 of the lab instructed me to design a triangle wave generator which produces a signal with a frequency of around 1 kHz. In order to do this, I used an up/down counter which increments when the \textit{updown} pin is one and decrements with \textit{updown} is low. By taking the output from the counter and connecting it to a decoder, I  was able to have two different actions at different points of the count since it needs to count up to a particular value and then count down. By attaching the output of corresponding to data = 1 on the decoder, I can send the S/R Flip flop a set signal in order to have it read one. Then, when the counter hits 254, I set a reset signal to the S/R flip flop and cause the counter to decrement. The flip flop has a 1 clock cycle delay which would cause the counter to flip at a clock cycle past the half way point. In order to prevent this, I used pins 1 and 254 for the decoder output.%
}}
\end{center}
\end{figure}\selectlanguage{english}
\begin{figure}[h!]
\begin{center}
\includegraphics[width=0.70\columnwidth]{figures/6-2/6-2}
\caption{{Part 2 of this lab instructed me to create a sine wave generator using the triangle generator from before. In order to do this, I connected the output of the triangle wave to the read address of a ROM block. This ROM block was provided and has values of sin(x) on the same period of the triangle wave (255 bits). This allowed me to generate a sine wave with decent accuracy. The lab also instructed me to design a switch which would allow me to choose whether I wanted generate a triangle or a square wave.%
}}
\end{center}
\end{figure}

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

