Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

If individual flip flops are used to represent the squares on the board, what ty

ID: 1834581 • Letter: I

Question

If individual flip flops are used to represent the squares on the board, what type of logic is needed to detect wins and draws? How are Xs and Os represented by flip flops? How are the player turns sequenced? How are the flip flops that represent the squares changed during the game to represent Xs or Os? Your game logic should generate the following output signals based on the state of the board flip flops:
Output Signal Meaning
XWINS The flip flop pattern for X has been found in any row, column, or diagonal.
OWINS The flip flop pattern for O has been found in any row, column, or diagonal.
DRAW All board positions are filled, but neither XWINS nor OWINS is active.
XTURN Active when it is Xs turn to place an X.
OTURN Active when it is Os turn to place an O.
ILLEGAL Active when either player tries to move into an occupied board position. Allow player to re-enter move.
For simplicity, X will always go first. Use 4 switches to represent the board position (0 to 8 or 1 to 9) where the next X or O will be placed. Another switch must be used to enter the board position chosen by the first 4 switches. Finally, a reset switch must be used to place all board flip flops and other logic into their initial states (to start a new game).


This is my project. I am not looking for someone to do it for me (unless they want!), but I am in desperate need for help. Can someone show me visually, aka not just "throw this and that in" how I could approach this? This project is kicking my tail and I can't seem to build it. MultiSim is my design program. Thanks...

PLEASE HELP!

Explanation / Answer

4 switches for an input is workable if not user-friendly. That can count 0 to 15 which can map to game cell 0 to 8 or 1 to 9 (your choice, I would use 1-9). I would save each Game cell in a single flip flop, 9 F/Fs for X's and another 9 for O's. There needs to be some decoding between the switches and the F/F's not only to set the correct game cell, but to also inhibit setting a used cell. A multiplexer would work for that. These 18 F/Fs can also drive LEDs to indicate who picked game cells. A winner is 3 cells in a row and there are 12 combinations for either X or O, so a total of 24 3 input AND gates. A draw is all cells taken with no winner; brute force for that is to logically OR each X & O cell for 9 lines, AND then with {NOT (OR of all winners)}. That's quite a few gates.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote