EE396 Junior Project - University of Hawaii at Manoa
Spring 2013
Hardware Languages: Verilog
Applications: Xilinx, Digilent Adept
In this project, our task was to replicate a Simon game on an FPGA board. In Simon, a light sequence would turn on and the player would have to press the button corresponding to the light. If the user is correct, an extra light will be added to the sequence and the player would input the entire sequence in order. This continues for eight rounds when the play will win. If the user inputs the wrong button or waits over three seconds without an input, the play loses and must reset the game.
Control
Determines the state of the circuit.
-0: wait for start
-1: display sequence
-2: wait for user input
-3: determine if end of round
-4: Lose
-5: Win
RNG (Random Number Generator)
Runs on a 8-bit counter, incrementing by one for every clock cycle. When the game begins (ie start button is pressed), the value will be loaded to the rest of the circuit, which will be used as the sequence to follow.
Compare
Waits for user input when in state 2, and compares the button input to the generated sequence from the RNG. The result will be sent to state, which will determine what happens next in the game (lose, win round, or win game).
LED Display
Displays both the sequence and the button inputs in states 1 and 2, respectively.
Timer
Runs on a counter similar to RNG which will send a pulse for every half-second. Half-second intervals are used for LED sequence displaying and seven-segment flashing. Waiting for an input in state 2 will also run on this timer, but will wait for six half-seconds (three seconds).
Debounced Button
Stops ringing of button input. This prevents a button press to be read as multiple pushes.
Seven-Segment Display
Determines what to display on the seven-segment display.