Sign in to follow this  
DoctorWkt

Tic Tac Toe in VHDL, no CPU

Recommended Posts

Here's a game of tic tac toe in VHDL for the Nexys4 DDR, written as a set of finite state machines and not as a computer running a program.

The design is inspired from John F. Wakerly's tic tac toe code from his book "Digital Design: Principles and Practices", but I've completely rewritten it. The game logic is contained in the files TTTdefs.vhd, TwoInARow.vhd and game_logic.vhd.

The rest of the code is there to interface with the user: to print strings to the user, to get digits and to control when moves are made. There are also two UART driver components.

You should be able to set this up as a Vivado project by importing all the .vhd files and setting up the .xdc file as the constraints. When you run the bitstream, open up a 9600 bps serial connection to the Nexys4 DDR board and follow the instructions that you should see:

        Welcome to the computerless tic-tac-toe game.
        You get to make the first move.
        Please enter moves as digits from 1 to 9.
        What move would you like to make?

Cheers, Warren

(c) GPL3, 2015

tic_tac_toe.zip

Edited by JColvin
tags

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this