Tetris
A group of peers and I implemented a baseline version of the game Tetris. This project was done using VHDL code flashed to an FPGA, an NES controller for input, and a 64 x 32 Adafruit LED matrix to display output. The LED matrix was very particular about the current and voltage it used; in this video, the board glitches because we did not have a constant source of voltage. Ordinarily, it takes 5 Volts and keeps a clear image.
​
The controls for the NES are as follows: the left and right controls shift the current piece, or tetromino, horizontally across the game board; the up and down controls shift the piece vertically; the A button rotates the piece 90 degrees; the B button spawns a new piece to the starting position; and finally, the start button resets the tetromino’s position back to where it was initially spawned.
Each tetromino was made up of two types of pixels: reference pixels and relative pixels. Each one had a reference x and y placement and the remaining relative pixels would be calculated and supplied around them. This way, when in Game State, we could just focus on moving the piece by changing the reference (x,y) and the rest would follow suit. This also saved us memory on the FPGA for representing a piece.
​
We also had a 5-bit representation for our "Select", which determined which piece would spawn and in what rotation.
​
The piece itself was represented with 14 bits by holding information about it's location in terms of the reference pixel's (x,y) coordinate and which piece was being displayed and what rotation it was currently at.
The game board's memory was represented as a series of std_logic_vector's all initialized to 0s which would later be written to during the game state. When changed to ones, it would cause certain LEDs on the board to turn on.
Figure 1: Demonstational video of Tetris

Figure 2: NES Controls

Figure 3: Tetromino representation

Figure 4: Select representation

Figure 5: Tetromino representation

Figure 6: Representation of board memory