Digital_Lab_21
"Soda Vending Machine"
by
Choon B. Kim, Ph.D., a retired ASIC engineer
1. Design Specifications:
You design a Soda Vending Machine(SVM) with following features. The price of a soda is 35 cents.
1.1) Power-on state: When the power is turned on, HEX3-1(7-segment Display) = "SodA"
1.2) Initial state of SVM: When pressing KEY(3) at the Power-on state, HEX3-1 = "0000"
1.3) Inputs: - User specifies input(s) using SW[4:0] to get a soda and change, if any, from the SVM.
- A specified input is submitted to SVM by pressing KEY[3].
- HEX3-1 displays the amount of the Payment and the Change, or other value(s) depending on the input
1.3.1) SW[0] = 1 for Nickel
1.3.2) SW[1] = 1 for Dime
1.3.3) SW[2] = 1 for Quarter
1.3.4) SW[3] = 1 for $1-dollar bill
1.3.5) SW[4] = 1 for Credit card
1.3.6) SW[6:5] **** NOT used ****
1.3.7) SW[7] = 1 for Reset/Clear the SVM ==> HEX3-1 = "0000" (SVM moves to Initial State)
1.3.8) SW[8] = 1 for Exit SVM and move to the Power-on state ==> HEX3-1(7-segment Display) = "SodA"
1.3.9) SW[9] = 1 for Displaying the current total number of dispencing on HEX3-1( e.g., HEX3-1 = "0003" when 3 times of dispensing occurred)
1.4) Input error checking:
When more than one inputs are submitted (e.g., SW[1:0] = 11), HEX3-1 = "Err " and No payment is made.
1.5) Dispensing:
When the payment >= 35 cents, HEX3-1 displays the amount "Payment : Change" and LEDG[9:0] = blinking(sign of dispensing).
1.6) Reset/Clear:
When SW[7] = 1, HEX3-1 = "0000" (SVM moves to Initial State)
1.7) Exit SVM:
When SW[8] = 1, HEX3-1 = "SodA" (SVM moves to Power-on state)
2. Testing(video on YouTube):
Test case:
https://youtube.com/shorts/8qE2naqEct8
3. Key lesson(s) learned from this Lab:
How to handle the FSM in digital system design.
4. Timing(optional):
Assuming your design is used as a part of a bigger clock-based system, find the maximum clock frequency of your design.
Explain how you get it.
------------------------------------------- The End of Digital_Lab_21 ---------------------------------------------------