38.6k views
1 vote
Implement a Mealy model circuit to control a coin-operated vending machine. This machine only accepts quarters, dimes, and nickels. Coins are inserted until a total of 30 cents or more is deposited. Only 1 coin is deposited at a time. Once a total of 30 or more cents has been deposited your circuit should set Give_Mechandise to 1 to dispense the product in the vending machine. You should also set the change outputs for the circuit to give back the appropriate amount of change. Assume that the machine can give one dime and/or nickel back. If the customer does something silly like entering a quarter followed by a quarter (total of 50 cents), correct change does not have to be provided ( 20 cents) but the maximum amount of change should be given ( 15 cents). Note that only 1 input can be high at a time.

Inputs
Pin Size (in bits) Explanation
Enablein 1 Connect to enable port of your registers/flip-flops. When 1 your circuit works normally. When 0 your circuit does nothing
QuarterReceive 1 1 if the user entered a quarter into the machine and 0 otherwise

1 Answer

5 votes

Final answer:

Implementing a Mealy model circuit for a vending machine requires a state machine that tracks coin insertion to reach at least 30 cents. Upon reaching the threshold, the machine will dispense the product and handle change up to 15 cents.

Step-by-step explanation:

To implement a Mealy model circuit for a coin-operated vending machine that accepts quarters, dimes, and nickels, we need to create a state machine that tracks the total amount of money inserted and controls the outputs based on the accumulated value. In a Mealy machine, the output is a function of both the state and the input. In this case, once the total reaches 30 cents or more, the Give_Mechandise output should be set to 1 to dispense the product.

The machine should also handle change, which requires output signals for a dime and a nickel. If the user enters an overpayment, such as two quarters, the vending machine gives a maximum of 15 cents back, but does not need to provide the exact change. We would need a series of states representing the accumulated value, ranging from 0 to 30 or more cents, with transitions dependent on the coin input and outputs that reflect the state of the Give_Mechandise signal and the change given.

User Chsh
by
7.3k points