As a homework assignment, I was given to design a simple vending machine circuit as follows
- Receives 5 cent, and 10 cent one at at time.
- 20 cent per snack, gives change when necessary (IE, 25 cents, gives 5 cents back with a snack)
- Once snack is given, it goes back to it's original state.
- Requires asynchronous reset. Resets at active low (back to initial state), and forces to give out any change. At active high, operates normally.
- 3 Inputs (D, N, R) 2 outputs (Snack, Change)
- DN (00) specifies no coins, (01) specifies a nickel and (11) specifies a dime
I have completed everything from state tables to drawings but it's VERY complicated and I don't think this is the best way of doing it. Here's what I did
State Diagram
State Table
The circuit was designed using a JK flip flop, D flip flop and T flip flop. (Had to use these because said so) and I end up with 32 situations that I have to account for which made the circuit very complicated (Could not use k-maps T_T). If anyone can give me an idea on how to simplify (not for the sake of homework, for my own knowledge as well), or rather reduce the amount of material in the truth table, would be great. Also I don't know how to integrate the asynchronous reset properly. If anyone needs any more information I'd be glad to give it to you.