We would like to implement the following state machine as a circuit:
Start from the following skeleton file: StateMachine.circ
You are to design a Mealy state machine to control an old fashioned vending machine that would drop a token for a price of 20 cents. There are two possible inputs at any state: N (for nickel) and D (for dime). Based on the input, the machine is to transition to a new state. When any sequence of coins worth 20 cents or more is input, the machine transitions to the start state and outputs a 1 to indicate that the vending machine is to drop the token. All other transitions are accompanied with an output of 0. If the value of the coins is higher than 20 cents, the extra money is lost.
Draw the state diagram for this machine.