Design a soda vending machine that can deliver three kinds of soda, A, B and C. All the three soda cost the same amount - 70 cents. The vending machine has four coin slots, one each for nickel (N = 5c), dime (I = 10c), quarter (Q = 25c) and dollar (D = 100c). Coins are inserted into the machine one at a time in any order.
The machine should take coins until 70 cents or more has been put in. When this occurs, the machine should wait for the choice of the soda A, B or C. After the choice is made, the machine is ready for vending. The machine should indicate vending by turning on one of the lines A_O, B_O or C_O for 1 second. During this time the machine cannot accept any coins. After 1 second, the machine is ready to accept coins again. The machine does not return any change. The machine should be a Finite State Machine (FSM) operating with a 100 Hz clock. The machine should have a reset input (R), which when pressed and released puts the machine in READY mode. Whenever this happens, the machine should display the total amount accumulated since last reset. Also, the internal amount accumulated is reset to zero cents.
You can assume that the soda cans are unlimited in number.
Write a VHDL code that implements the above soda machine. You have to turn in the following:
1. A state diagram showing the implementation of your design. Clearly show all the states and the conditions on which transitions occur.
2. Hardcopy of your VHDL code and the testbench.
3. Hardcopy of annotated waveforms that show at least the following cases:
(a) Normal operation of soda vending, showing the order in which the coins are inserted, the state transitions and the vending process. Show that your machine does not accept coins when the machine is vending.
(b) Show the reset operation after a few sodas are vended, clearly displaying the total amount accumulated and the state change.