Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. Design a state machine that will control a vending machine. The vending machine has 4 inputs, N, D indicating a nickel or dime was
1. Design a state machine that will control a vending machine. The vending machine has 4 inputs, N, D indicating a nickel or dime was inserted as well as clk and an active high asynchronous reset. The vending machine should assert output OK if the amount inserted equals $0.25. The machine does not give change. Inputs N and D cannot simultaneously assert. Amounts inserted over $0.25 will be retained for the next product. For example, if input D asserts twice (indicating 2 dimes were inserted) and then input D asserts (indicating another dime was inserted) output OK will assert and then only $0.20 will need to be inserted for output OK to assert again. (40 pts) Requirements: a. Draw the state transition graph b. Implement in Verilog the module describing the state machine c. Use parameters to encode the state of your state machine d. Turn in your module and testbench code as well as a simulation waveform 1. Design a state machine that will control a vending machine. The vending machine has 4 inputs, N, D indicating a nickel or dime was inserted as well as clk and an active high asynchronous reset. The vending machine should assert output OK if the amount inserted equals $0.25. The machine does not give change. Inputs N and D cannot simultaneously assert. Amounts inserted over $0.25 will be retained for the next product. For example, if input D asserts twice (indicating 2 dimes were inserted) and then input D asserts (indicating another dime was inserted) output OK will assert and then only $0.20 will need to be inserted for output OK to assert again. (40 pts) Requirements: a. Draw the state transition graph b. Implement in Verilog the module describing the state machine c. Use parameters to encode the state of your state machine d. Turn in your module and testbench code as well as a simulation waveform
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started