
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Implement a soda dispenser. The cost of the soda is 75 cents. Your machine will accept quarters, dimes, and nickels. As the user feeds coins into the machine you will need to keep track of how much money was inserted. Once you have collected at least 75 cents, you will release a single soda. You will also need to output how much change the machine should return. You do not need to compute the number of quarter, dimes, and nickels to return, rather just an 8-bit value indicating the correct change (i.e. if the user inserts 80 cents, change = 5). Once the soda has been dispensed, your circuit will start over and wait for additional coins.
The system interface is as follows:
The design of Soda_Dispense should be divided into 2 parts - a controller and a datapath. The controller is an FSM which issues commands to the datapath based on the current state and the external inputs. This should be a behavioral description. The datapath contains a netlist of functional units like multiplexors, registers, adders, and comparators, and hence this design is structural.
ECE 574 A ONLY – Extend your implementation to provide the user with a choice between two drinks, soda and water. The soda costs 75 cents, while the water costs one dollar. The user presses a button corresponding to the desired drink. If the user selects a soda, input soda will be high. If the user selects water, input water will be high. If the user presses both buttons, soda has the priority. Additionally, if the user presses either button indicating the desired drink selection but not enough money has been inserted, the n_enough output will go high until presses another button or enters more money.
Soda_Dispense
soda_release
change
nickel
quarter dime
rst clk
8
Soda_Dispense
soda_release
nickel
quarter dime
rst clk
soda water
change 8 n_enough