Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design a VHDL module for the following state machine that will be used to control a vending machine. Assumptions: Clock speed is 100 MHz. Reset

Design a VHDL module for the following state machine that will be used to control a vending machine.

image text in transcribed

Assumptions:

Clock speed is 100 MHz.

Reset is active high and must set the state machine in an idle state.

The vending machine only takes quarters, dimes, and nickels.

The vending machine only returns quarters, dimes, and nickels.

Each input (25c, 10c, 5c) is a one-clock cycle wide pulse that is synchronous with the clock signal.

Inputs will occur one at a time. You will never have two or more inputs asserted on the same clock cycle.

To dispense change, assert each output (return_25c, return_10c, and return_5c) for one clock cycle.

Each beverage in the machine costs $0.25.

The supply of coins for change and beverages is unlimited.

The vend signal should only be asserted for one clock cycle when the user has inserted at least $0.25.

Part I: Design

Construct a state diagram for your vending machine. Make sure to include all the states necessary to collect the coins and vend a beverage as soon as the total amount of change inserted is greater than or equal to $0.25. Always dispense the proper amount of change.

Example1: If the user inserts 3 dimes, your machine should vend one drink and then dispense 1 nickel in change.

Example2: If the user inserts four nickels and then a quarter, your machine should vend one drink and then dispense 2 dimes in change.

Try to optimize your design to use a few states as possible.

Include your diagram and a complete explanation.

Part II: VHDL Coding

Convert your state diagram into a Moore state machine implementation in VHDL. Design processes for the state register, the next state logic, and the output forming logic. Use one-hot encoding.

Include your VHDL code.

Part III: Simulation

Write a testbench to completely test your vending machine. Make sure you have covered as many possible input combinations as possible.

Include your VHDL testbench.

Include your simulation waveforms.

Coin Sensor Coin Return State Machine Soft Drinks Coin Sensor Coin Return State Machine Soft Drinks

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions