Professional Documents
Culture Documents
(a) Write the Verilog behavior description for the corresponding circuit.
(b) Draw the circuit diagram for one-hot encoded implementation. (You may assume that flip-flops have
both "set" and "reset" inputs, but you must label which one you would use for each flip-flop.)
State 1: Reset
State 2: Five
State 3: Ten
State 4: Fifteen
State 5: Twenty
State 6: Twenty Five
The next state is the RESET state again. The diagram is given below and is self-explanatory.
Whenever a coin is dropped, the system jumps to the next state. For example, if the coin dropped from
the RESET State is a NICKEL, then the system jumps to the FIVE State. Otherwise, the system stays in the
present state. When the system gets an extra amount, it goes back to the RESET State and the difference
is given back to the user. Write the Verilog behavior description of this vending machine system.