element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
FPGA
  • Technologies
  • More
FPGA
Blog Tic Tac Toe on FPGA Platform
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join FPGA to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: alexwonglik1
  • Date Created: 16 Dec 2020 11:24 PM Date Created
  • Views 3603 views
  • Likes 6 likes
  • Comments 0 comments
  • game project
  • keyboard
  • embed
  • project
  • clk
  • fpga_projects
  • ps2
  • fpga
  • vivado
  • game
  • embedded
  • Design
  • digilent
  • fpga based
  • arty
  • contect
  • design contest
  • pmod modules
  • arty a7
  • vga
  • fpga platform
  • tictactoe
  • verilog
  • xilinx fpga
  • pmod
  • module
Related
Recommended

Tic Tac Toe on FPGA Platform

alexwonglik1
alexwonglik1
16 Dec 2020

image

Tic-Tac-Toe is one of the best known games in the world. A group of students port Tic Tac Toe to Digilent Arty A7 Field Programmable Gate Array (FPGA) platform.  The game uses the classical Tic Tac Toe grid of 9 squares, running on a VGA monitor using a 640x480 resolution. Players can use a PS/2 keyboard as the game controller. Pressing up, down, left and right select a square on the game board and hitting “ENTER” or “SPACE”  place the square on the board. A player push “ESC” to restart the game at any time. LEDs on Arty A7 are used to keep track the score.

 

Required Hardware:

  • • Arty A7 FPGA Development Board
  • • Pmod PS/2 to connect to PS/2 Keyboards
  • • Pmod VGA to connect to VGA Display
  • • PS/2 Keyboard
  • • VGA Display

 

Toolchain & Language:

  • Xilinx Vivado Design Suite
  • Verilog Hardware Description Language

 

Hardware Design:

 

The top modules include the following inputs and ouputs:

InputsDescription
CLK

The clock of the board (100 MHz in case of the Arty A7)

PS2PS2_CLK clock PS clock signal and PS_DATA PS2 data
RST_BTNThe reset button of the board
VGAVGA_HS_0 H-sync, VGA_VS_0 V-sync, VGA_R to VGA_B VGA RGB
LEDEnable LED on Arty A7

image

There are four submodules:

  • vga640x480: used for interfacing with the VGA port at a 640x480 resolution, using a 25MHz clock
  • keyboard_controller: used for reading keyboard inputs from the PS/2 port
  • graphics_display: used for displaying the Tic tac toe game board as well as the squares placed on the screen
  • check_winner: used for checking whether a player has won the game

 

Game Demonstration:

 

Let's do a game demonstration. You can watch the demo video too. The game starts out with the middle square selected. Players can move the cursor by the arrow keys. When the player wants to make a selection, he/she presses "ENTER" or "SPACE". In this particular game, Player 1 is on blue while Player 2 is on red. After a player select the grid and presses the key to lock the selection, the game automatically jumps to the other player's turn. If the board is filled up, the game is draw. This leads to  a new game. If a player wins, LEDs on Arty A7 will be updated to show the latest score. The player can push the reset button to reset the score.

 

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

The project file can be downloaded at https://github.com/Norkal/Ultimate-Tic-Tac-Toe/blob/Release/37MSRO.zip.

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube