Page 152 - Bebop to The Boolean Boogie An Unconventional Guide to Electronics Fundamentals, Components, and Processes
P. 152

State Diagrams, State Tableg and State Machines      7 33


                The states are represented by the circles labeled 0-cents, 5-cent5, 10-cents,
             15-cents, and ZO-cents, and the values on the dispense and change outputs
             are associated with these states. The arcs connecting the states are called
             state transitions and the values of the nickel and dime inputs associated with the
             state transitions are called guard conditions. The controller will only sequence
             between two states if the values on the nickel and dime inputs match the guard
             conditions.
                Let’s assume that the controller is in its initial state of 0-cents. The values
             of the nickel and dime inputs are tested on every rising edge on the clock.2 As

             long as no coins are deposited, the nickel and dime inputs remain at 0 and the
             controller remains in the 0-cents state. Once a coin is deposited, the next
             rising edge on the clock will cause the controller to sequence to the 5-cents
             or the IO-cents states depending on the coin’s type. It is at this point that the
             controller sends an acknowledge signal back to the receiver instructing it to reset
             the nickel and dime signals back to 0 and to await the next coin.
                Note that the 0-cents, 5-cents, and 10-cents states have state transitions
             that loop back into them (the ones with associated nickel = 0 and dime = 0
             guard conditions). These indicate that the controller will stay in whichever
             state it is currently in until a new coin is deposited.
                So at this stage of our discussions, the controller is either in the 5-cents
             or the 10-cents state depending on whether the first coin was a nickel or dime,
             respectively. What happens when the next coin is deposited? Well this depends
             on the state we’re in and the type of the new coin. If the controller is in the
             5-cents state, then a nickel or dime will move it to the 10-cents or 15-cents
             states, respectively. Alternatively, if the controller is in the 10-cents state, then
             a nickel or dime will move it to the 15-cents or 20-cents states, respectively.
                When the controller reaches either the 15-cents or 20-cents states, the
             next clock will cause it to dispense a “gizmo” and return to its initial 0-cents
             state (in the case of the 20-cents state, the controller will also dispense a nickel
             in change).







             2 The controller is known to sequence between states only on the rising edge of the clock, so
              displaying this signal on every state transition would be redundant.
   147   148   149   150   151   152   153   154   155   156   157