3. (40 points) In this question, you are asked to design a FSM to control a vend
ID: 3714570 • Letter: 3
Question
3. (40 points) In this question, you are asked to design a FSM to control a vending machine. The vending machine accepts zero or one coin in each clock cycle. It sells a single product of 40 cents. Whenever the balance is more than or equal to 40 cents, the product will be dispensed and the balance will be reduced by 40 cents. The vending machine will not return any change. Any balance will be used towards the purchase of the next product. The FSM accepts a 2-bit input Ci CO to represent the coin inserted (in addition to Clock and Reset). C1 C0 00 represents no coin, 01 represents a nickel, 10 represents a dime, and 11 represents a quarter. Besides, the FSM generates a 1-bit output P which is set to 1 if the product should be dispensed and 0 otherwise Please write a state table for your FSM design. (State table is the only thing that you are asked to do. You do not need to do state assignment, state-assigned table, logic expressions, etc.) Hint: You may design either a Moore machine or a Mealy machine. But a Mealy machine has fewer states.Explanation / Answer
The state table is as follows:
Present State Input(C1C0) Next State Output
Q0 00 Q0 0
Q0 01 Q1 0
Q0 10 Q2 0
Q0 11 Q3 0
Q1 00 Q1 0
Q1 01 Q2 0
Q1 10 Q4 0
Q1 11 Q5 0
Q2 00 Q2 0
Q2 01 Q4 0
Q2 10 Q6 0
Q2 11 Q7 0
Q3 00 Q3 0
Q3 01 Q5 0
Q3 10 Q7 0
Q3 11 Q8 1
Q4 00 Q4 0
Q4 01 Q6 0
Q4 10 Q7 0
Q4 11 Q8 1
Q5 00 Q5 0
Q5 01 Q7 0
Q5 10 Q8 1
Q5 11 Q8 1
Q6 00 Q6 0
Q6 01 Q3 0
Q6 10 Q5 0
Q6 11 Q8 1
Q7 00 Q7 0
Q7 01 Q8 1
Q7 10 Q8 1
Q7 11 Q8 1
Q8 No input Q0 0
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.