FPGA Lab 5

Abstract

Lab 5 instructed us to design a stopwatch using the supplied FPGAs. The circuit needed to be able to increment every tenth of a second and track the number of minutes and hours that had passed. While I was instructed to make a three-state machine that is driven by one button that causes the timer to stop/stop/reset in that order. However, I implemented a two-state system and attached the reset functionality to a second button in order to reflect the design of stopwatches that I had encountered. This lab was very useful in demonstrating the steps that are involved when creating a complete circuit. This included designing state machines as well as importing modules previously defined as external libraries which are extremely common when designing circuits.

Introduction

There were two main parts to the stopwatch: the controller which handled the state of the counters, and the counter itself. The main obstacle that I encountered while designing this circuit was to find a way to have the same button perform two different tasks. By implementing the controller using a finite state machine, I could easily trigger the transition between the various states off of the same input. Another difficulty I encountered was that the inputs were staying high longer than the transition time, causing two transitions to happen back to back. In order to prevent this, I attached the button to a positive edge trigger which only sent a short burst.

The counter was implemented using a series of decimal coded binary counters with appropriate modulus’s in order to cause the next counter to increment at 59 minutes rather than 99.

Circuits / Figures

The circuit built in this lab can be broken into two separate parts: the controller and the display. The controller is discussed in figure \ref{fig:control} and the display in figure \ref{fig:display}.