State Machine Operation - BJACK
Click
Operation when an ace is drawn is essentially the same. If the card is an ace
and no aces has been drawn previously, the state machine goes to state Add10,
and ten is added to the count (effectively making the ace = 11). Transitions to
and from Test17 and Test22 proceed as before. However, if the score exceeds 21
and an ace has been set to 11, the state machine goes to state Sub10, 10 is
subtracted from the score, and the state machine goes to state Test17.
If a card is needed - go to ShowHit.
When CardIn goes low - go to AddCard (Card values is added to score).
Wait until the card is taken from the reader.
Go to Test17 state.
If score is less than 17 take another card.
If the score is greater than or equal to 17 - go to state Test22.
If the score is less than 22 - go to ShowStand state.
If the score is 22 or greater - go to ShowBust state.
In either ShowStand or ShowBust state - go to Clear when Restart goes low.
When Restart goes high - return to ShowHit and cycle begins again.