13-02-2013, 04:16 PM
Vending Machine using Verilog
Vending Machine.pdf (Size: 121.83 KB / Downloads: 609)
Introduction
Vending Machine is a soft drink dispensor machine that dispenses drink based
on the amount deposited in the machine. It accepts all the coins ie: Nickel(5
cents), Dime(10 cents), Quarter(25 cents). Till it recieves 40 cents it will not
dispense anything. After it has recieved 40 cents it will dispense a softdrink.
Any amount above that will be given back as a change.
Finite State Machine
Any Sequential digital circuit can be converted into a state machine using
state diagram. In a State machine the circuit’s output is defined in a different
set of states ie. each output is a state. There is a State Register to hold the
state of the machine and a nextstate logic to decode the nextstate. There is
also a output register that defines the output of the machine. The nextstate
logic is the sequential part of the machine and the Output and Currentstate
are the Register part of the logic.
Explaination of Output
The Output is explained here. We start by adding coins. We start first with
the least amount NICKEL. Then we reset the machine to see the output ie:
state and the SOFTDRINK. Then we add a DIME and see the result. So
on till till QUARTER is also added. Then i add a dime 5 times to see the
output and it vends. ie. a softdrink is given . When i add an extra amount
it gives a change also. so my machine works.