Simon says is a simple electronic memory game: the user has to repeat a growing sequence of colors. The sequence is displayed by lighting up the LEDs. Each color also has a corresponding tone.
In each turn, the game will play the sequence, and then wait for the user to repeat the sequence by pressing the buttons according to the color sequence. If the user repeated the sequence correctly, the game will play a "leveling-up" sound, add a new color at the end of the sequence, and move to the next turn.
The game continues until the user has made a mistake. Then a game over sound is played, and the game restarts.
Check out the online simulation at https://wokwi.com/projects/408757730664700929 (including wiring diagram).
The clk_sel
input selects the clock source:
0
: external 50 KHz clock, provided through the clk
input.1
: internal clock, generated by the ring_osc
module, with a frequency of ~55 KHz.The internal clock is generated by a 13-stage ring oscillator, divided by 16384 to get the desired frequency. The divider value was determined by running the ring oscillator simulation in xschem/simulation/ring_osc.spice.
When using the internal clock, its signal is also output on the uo_out[7]
pin for debugging purposes.
Use a Simon Says Pmod to test the game.
Provide a 50 KHz clock input, reset the game, and enjoy!
If you don't have the Pmod, you can still connect the hardware manually as follows:
btn1
, btn2
, btn3
, and btn4
.
Also connect each button to a pull down resistor.led1
, led2
, led3
, and led4
, matching
the colors of the buttons (so led1
and btn1
have the same color, etc.).
Don't forget current-limiting resistors!speaker
pin (optional).seg_a
through sev_g
to
individual segments, dig1
to the common pin of the tens digit, dig2
to the common pin of the ones digit.
Set seginv
according to the type of 7 segment display you have: high
for common anode, low for common cathode.Simon Says Pmod or four push buttons (with pull-down resistors), four LEDs, and optionally a speaker/buzzer and two digit 7-segment display.
# | Input | Output | Bidirectional |
---|---|---|---|
0 | btn1 | led1 | seg_a |
1 | btn2 | led2 | seg_b |
2 | btn3 | led3 | seg_c |
3 | btn4 | led4 | seg_d |
4 | seginv | speaker | seg_e |
5 | dig1 | seg_f | |
6 | dig2 | seg_g | |
7 | clk_sel | clk_internal |