Question
Create a truth table In this two player game, each player holds up either 0, 1, 2, or 3 fingers behind his or her back.
Create a truth table
In this two player game, each player holds up either 0, 1, 2, or 3 fingers behind his or her back. If the sum of the number of fingers both players is holding up is even, player 1 wins. If the sum is odd, player two wins. In addition, the sum of the fingers held up must be at least 2 and cannot be more than 5. If the sum is out of bounds then the players must try again and no one wins. For example, if player 1 held up 1 finger and player two held up 3 fingers the sum would be 4 (an even number) and player 1 would win. As a second example, if both players held up 3 fingers, the sum would be 6 and the players would have to try again since 6>5.
You will use 4 binary inputs. These binary inputs will represent the number of fingers held up by each of the two players. Inputs P11 and P12 will be used to represent the number of fingers held up by player 1 in binary with P11 being the MSB and P12 being the LSB of a 2-digit binary number. Inputs P21 and P22 will be used to represent the number of fingers held up by player 2.
You must drive 3 digital binary outputs as follows:P1 wins- 1 if player 1 wins (even sum of fingers), 0 otherwise
P2 wins- 1 if player 2 wins (odd sum of fingers), 0 otherwise
Out of bounds-1 if sum of fingers held up is 0, 1, or 6
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started