Design a vending machine that accepts nickels, dimes and quarters and outputs tw
ID: 2988261 • Letter: D
Question
Design a vending machine that accepts nickels, dimes and quarters and outputs two products A and B.
The machine accepts only one coin at a time, controlled by switches SW1 and SW0. A nickel, dime, or quarter is added if SW1, SW0 = 01,10, or 11 respectively.
The vending machine cannot hold more than 35 cents. Thus, if inputting a coin would cause the total to go over this value, the total should not be updated and the coin should be rejected.
Products A and B cost 10 and 25 cents respectively. A user indicates they wish to purchase these products by setting SW2 to 1 (for product A) or SW3 to 1 (for product B). If both SW2 and SW3 are set to 1, the machine dispenses the change.
A product should not be dispensed if there is not sufficient money inside the vending machine. The remaining change is dispensed alone with the product and the total is reset to zero.
If both a coin is added and a product is selected, the product will have priority and the coin will be rejected. A rejected coin should be indicated by a single LED.
I'll need to display the amount of money in the vending machine using a two seven segment displays. Also need to display the value of the coin the user wishes to enter into the machine.
Another seven segment display will indicate the output of the vending machine:
0: nothing
A: product A
B: product B
C: change
Explanation / Answer
answer
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.