Close
0%
0%

Tic Tac Toe in TTL

This is a human versus TTL circuit version of Tic Tac Toe, but with no CPU. It's all plain old digital logic.

Similar projects worth following
I've seen several circuits for two-player tic-tac-toe games on the Internet, but I thought I'd try to design one with these constraints:

done with TTL components only, no CPU
minimum number of chips
not two player: human versus the board, board makes optimal moves

The circuit uses flip-flops to register both the human and the board's moves. The board has a register which holds the current state of the board's moves. The board state and the user's moves are combined to access a ROM to look up the next board move and any tie or win result.
Video at https://www.youtube.com/watch?v=WPPjL46z-Ag, Github repository at https://github.com/DoctorWkt/TTL_TicTacToe

Enjoy this project?

Share

Discussions

cihakex553 wrote 04/05/2022 at 08:38 point

oh welldone brother I am play this game Tic Tac Toe Multiplayer at a free time this is very best game for time pass

  Are you sure? yes | no

bia.maria10 wrote 12/02/2019 at 20:41 point

olá você poderia me mandar como foi o passo a passo de como foi ligado os fios? esta meio confuso na imagem. 

  Are you sure? yes | no

Ken Yap wrote 06/22/2019 at 10:04 point

Ok, I think I have the minimal hack (this is HaD after all) to the finite state machine to allow the machine to make the first move. Interpose an AND gate and a normally open switch between S9 and Boardmoves/Move9 like this:

S9 ----------------

                      AND ----> Boardmoves/Move9

S13-NO/SW---

Location 0 in the state lookup ROM is changed to 0x0D, which causes the FSM to loop attempting to turn on Boardmoves/LED9 via S13 but is blocked by the open switch. When the user presses this "you go first" switch, LED9 is turned on, and then play proceeds as usual.

Entries in the ROM which were previously unreachable (e.g. 5 machine moves) need to be fixed to indicate tie or win.

One motivation for this mod is that when the machine goes first on a corner, it is possible to trap the user if they do not reply with centre.

Nice exemplar of a finite state machine implementation by the way. 👍

  Are you sure? yes | no

Warren Toomey wrote 06/22/2019 at 21:42 point

Actually, I'm using a 32kx8 ROM so there is more space in there for other moves. Why not a switch and pull-down resistor connected to the A13 address line on the ROM. Low selects the current 8K of ROM where the user moves first. High selects the 8K where the board moves first. It's too late for my PCBs (they are ordered), but I can try this out on the breadboard in the next few days.

  Are you sure? yes | no

Warren Toomey wrote 06/22/2019 at 23:12 point

I've generated the new 8K set of moves and states. I've rewrired the Logisim version to have a "move first" selector and it all works. Next up, try it out on the breadboard. After that, change the schematic and PCB design.

  Are you sure? yes | no

Ken Yap wrote 06/23/2019 at 00:15 point

Nice work! Your mod preserves the purity of the FSM model (all state transitions through mapping.) 👍

  Are you sure? yes | no

Warren Toomey wrote 06/23/2019 at 01:47 point

I've modified the breadboard with the switch and it works. I've updated the PCB design and the Github repository to have this new version.

  Are you sure? yes | no

[deleted]

[this comment has been deleted]

Ken Yap wrote 06/20/2019 at 11:21 point

It's not hard to add. You just need another switch for the null (I pass) move and a initial state in the ROM. Machine can then make a predetermined first move, probably corner.

  Are you sure? yes | no

Warren Toomey wrote 06/20/2019 at 12:02 point

I think it will make the required ROM a bigger one. I'm happy with the game as it is, but feel free to clone/fork the Github repository and change it!

  Are you sure? yes | no

Ken Yap wrote 06/20/2019 at 12:09 point

Yes, I think it will require one extra latch, but no LED, and 10 bits of state. What would make it cute would be the machine making a hmmm sound for a few seconds before "making its move". 😉

  Are you sure? yes | no

Ken Yap wrote 06/20/2019 at 08:56 point

👍 Can the machine make the first move?

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates