Lab 4 VGA Display Snake Game Design and implement a digital circuit capable of displaying predefined patterns on the screen of a VGA monitor, and provide the basic components for the Snake game. Your circuit must generate all control and data signals driving the VGA output of the NEXYS3/NEXYS4 board. Please refer to the lecture and the introductory lab slides for information about the meaning and timing of VGA control signals. Task 1: Displaying Snake and Background (Points: 15%) Design a circuit to display a Snake (shown below) in the center of the screen. The background of the screen should be in White color. Each circle of the snake should be 15 pixels in diameter. Task 2: Controlling Snake movement (Up, Down, Left and Right) (Points: 20%) Extend Task 1 by adding the capability to move the Snake to any point inside the boundary. The game should reset when the snake s head hits the boundary, and the snake must not exit the boundary. The movement of the snake should be always ON. Once the direction is given, the Snake moves in the specified direction until a player gives a new direction. The movement of the Snake should be controlled by the four push buttons (BTNU, BTND, BTNL and BTNR).
The Red arrows in the diagram below depict movement of the Snake (these arrows should not be drawn on the screen). When the Snake is moving in the upward direction: BTNR should be used to move Right and BTNL should be used to move left (pushing BTNU and BTND should have no effect). When the Snake is moving in the Right Direction: BTNU should be used move Up and BTND should be used to move Down (pushing BTNR and BTNL should have no effect).
When the Snake is moving in the left direction: BTNU should be used to move Up and BTND should be used to move Down (pushing BTNR and BTNL should have no effect). When the Snake is moving in the downward direction: BTNL should be used to move Right and BTNR should be used to move left (pushing BTNU and BTND should have no effect).
Example: When you turn right, after the first step, the snake should look like in the image below: After the second step, the snake should look like in the image below:
Task 3: Snake speed (Points: 5%) Extend Task 2 to provide the capability to adjust the Snake s speed. Switches 0-1 select the step size to change the Snake s speed (in both horizontal and vertical direction). One step is equal to 4 pixels, which allows the user to change the step size between 4 and 12 pixels in both x and y direction. Position 00 (default) means step size = 4, 01 means step size = 8, and 10 means step size = 12. The default speed of the snake (in steps per second) should be determined experimentally. Task 4: Displaying Boundaries and Diamonds (Points: 25%) Extend Task 3 by adding a boundary (in black color) and Diamonds in Red Color. The snake should be restricted to stay within this boundary. Set the width of boundaries initially to be equal to 2 pixels. You can adjust the width and (x, y) coordinates of the boundary lines in order to obtain the image shown in the figure below. Diamonds should be placed as the shown in the image below. The height and width of each Diamond should be 15 pixels. These Diamonds are the Snake s food. Whenever the Snake touches any of the Diamonds, the Diamond should disappear from the screen meaning that the Snake has eaten the food.
Task 5: Displaying score and rules on VGA display (Points: 25%) Extend Task 4 by displaying the Score and the game rules on VGA display. Whenever the Snake touches any of the Red Diamonds, the Score should be incremented and displayed on the Screen. Whenever the Snake touches the Boundary, the Game has to restart and the score must be reset to 0. Task 6: Displaying Text on the Screen: (Points: 10%) When the Snake eats all food, then You Won! in the Green Color should be displayed on the screen.
Bonus Task 1: Adding movable boundaries (Points 10%) Add two small blue inner boundaries, which should act exactly like the outside black boundary. These boundaries should move up and down, with the constant speed, as shown in the figure below. The thickness of these lines should be set to 6 pixels. Whenever the Snake touches the Boundary, the Game has to restart and the score must be reset to 0.
Bonus Task 2: Adding Blinking Stars (Points 5%) In Task 6, when Snake eats all food, the circuit should display You Won! with yellow stars blinking for 5 seconds, as shown in the figure below.
*Note: You do not need to display any coordinate or axis names shown in the above figures. This information is provided just for your reference. Deliverables: 1. VHDL source codes for all modules required by the game. 2. UCF file. 3. A short report describing A. List of tasks fully implemented B. List of tasks attempted but not completed (please describe shortly what is missing) C. List of tasks not attempted D. List of any deviations from the original specification. E. Resource utilization a. Number of CLB slices b. Number of LUTs c. Number of flip-flops d. Number of DSP units
e. Number of BRAMs E. Timing properties a. Minimum clock period after synthesis [ns] b. Maximum clock frequency after synthesis [MHz] c. Minimum clock period after implementation [ns] d. Maximum clock frequency after implementation [MHz] F. Difficulties encountered and lessons learned. Important Dates Hands-on Sessions and Introductions to the Experiment Demonstration and Deliverables Due for Schedule A Demonstration and Deliverables Due for Schedule B (-8 point penalty for not attempting Lab 5 or Lab 6; no penalty for Lab 4) Monday Section 03/21/2015, 03/28/2015 Tuesday Section 03/22/2015, 03/29/2015 Wednesday Section 03/23/2015, 03/30/2015 04/04/2015 04/05/2015 04/06/2015 04/11/2015 04/12/2015 04/13/2015