The initial state, State A is the reset state. The player will be ahead by 1 point if they score
a point. A state is defined for each player being ahead by 1 point. Same goes for each player
being ahead by 2 points.
Figure 1 – Moore State Diagram
The first design is the Moore design. There is one input, x where when x =0, Player 1 scored
and if x=1, Player 2 scored. The outputs were (Y, Z) and they determined both if somebody
won and who. If there was a 1 for any output, that defined as someone winning. If Y = 1,
Player 1 won and if Z=1, Player 2 won. If both Y and Z are 0, neither player has won yet. It
is impossible to have the output (1, 1) in this design.
State A is the reset state. The score is initially (0, 0). State B is where Player 1 is ahead of
Player 2 by one point, the output is still (0, 0). The same is for Player 2 and State C. In
State D, Player 1 is ahead of Player 2 by 2 points and wins the game, output (1, 0). Same
goes for Player 2 and State E with output (0, 1).
This machine works where the start point is State A. If the input is 0, this means that
Player 1 scores. The machine will be in State B. If Player 1 scores again (input, x=0) the
machine goes to State D. There is an output of (1, 0). Virtually, the machine is reset to State
A so if Player 1 scores again, the machine will go to State B. If the current state is State B
and Player 2 scores, the machine goes to State A. If both Player 1 and Player 2 alternate
scoring points, the machine will be in a loop of State A and State B.