Implement a vending machine controller that is able to give change by releasing nickels. The inputs are: ? N, D: single bit inputs indicating whether a nickel or a dime (but never both) have been inserted ? CLK, ?R?S?T?: the usual clock and active low reset inputs The outputs are: ? open: set to 1 for one cycle to vend an item ? return: set to 1 for one cycle to return a nickel. The machine accepts only nickels and dimes, and vends a single item whose price is 15¢. The machine should accept and credit all coins entered, including while vending or returning change. a. Draw a state transition diagram for a Moore implementation of this machine. Your design should minimize the number of states. b. Using the minimum necessary D flip-flops, set the state encoding and derive expressions for the next state and output logic. C. Draw a state transition diagram for the Mealy implementation, again minimizing the number of states. D. Using the minimum necessary D flip-flops, set a state encoding and derive expressions for the next state and output logic of the Mealy implementation.
Added by Jackie M.
Close
Step 1
We can have 3 states: - State 0: No money inserted - State 1: 5 cents inserted - State 2: 10 cents inserted a. State Transition Diagram for Moore Implementation: - From State 0, if a nickel (N=1) is inserted, we move to State 1. If a dime (D=1) is inserted, we Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 61 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Do a finite state machine that detects the sequence 101 on serial one-bit input x. One-bit output Z is 0 unless the 101 has been detected. Z should be one in any case in which the previous 3 inputs are 101, including overlapping cases. Reset = 1 should take the finite state machine back to the initial state. This is a block diagram of a generic FSM. Assume a Moore Model (Remember in a Moore model, states alone combinatorially determine output Z). If it takes 4 states to make this machine, then n = 2. And if you do {Q, x} m = 3. What to do: A) Draw a state diagram for this machine. B) Create a state assignment table for your state machine. C) Create a state transition table for your state machine. D) Find the logic to get Z from the state Q.
Patha S.
Engineers/Circuit Designers frequently describe systems as finite-state machines. Your job as an engineer is to produce/write Verilog code for a vending machine described below and also draw an ASM Diagram. [CLO1] {marks 5} Vending Machine Imagine that you want to show how a vending machine behaves. To keep the example small, we'll assume that there is only one item in the vending machine that costs Rs 20, and that the machine accepts Rs 5 coins and Rs 10 notes. If the machine receives a coin or note, it moves to the next state, and if it doesn't receive any input (coin or note), it remains in the current state. The machine will not give change, so in the state Rs 15, it doesn't receive notes and remains in the current state. The following figure shows the state machine:
Adi S.
Sri K.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD