contents.gifindex.gif

State Machine Operation - BJACK

Operation of the state machine proceeds as follows if no aces are drawn:

webpack00090000.gif If a card is needed - go to ShowHit.

webpack00090000.gif When CardIn goes low - go to AddCard (Card values is added to score).

webpack00090000.gif Wait until the card is taken from the reader.

webpack00090000.gif Go to Test17 state.

webpack00090000.gif If score is less than 17 take another card.

webpack00090000.gif If the score is greater than or equal to 17 - go to state Test22.

webpack00090000.gif If the score is less than 22 - go to ShowStand state.

webpack00090000.gif If the score is 22 or greater - go to ShowBust state.

webpack00090000.gif In either ShowStand or ShowBust state - go to Clear when Restart goes low.

webpack00090000.gif When Restart goes high - return to ShowHit and cycle begins again.

Click here to see the state diagram.

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.