Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17255 Discussions

help me through vhdl code

Altera_Forum
Honored Contributor II
1,888 Views

Vending machine 

The vending machine dispenses two items: a can of soda or a candy bar. The can  

of soda costs $7 while the candy bar costs $4.  

1. There is an input select for each product and a reset input that takes the machine  

to the idle state. 

2. The machine only accepts $1 and $5 bills.  

3. When sufficient funds have been inserted, the product selection is made. The  

maximum amount of money that can be inserted is $10. 

4. Change is dispensed but only in $1 bills.  

5. If a product selection is made and insufficient funds have been inserted, the  

machine illuminates an “insufficient funds” display and waits for more money to  

be inserted.  

6. The transaction can be cancelled at any time with the appropriate refund.  

7. If the product is not available, all money is returned. 

8. When a product is dispensed the customer must take it before a new transaction  

can start.
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
790 Views

you talk about Algorithmic Machine, you can use FSM approach. Try stateflow from Matlab. Good luck

0 Kudos
Altera_Forum
Honored Contributor II
790 Views

Sounds like a good project - please ask any questions when you get stuck writing code..

0 Kudos
Altera_Forum
Honored Contributor II
790 Views

I'd suggest to design your state machine on paper first, defining your different states and transitions. Then it will be easier to translate it into VHDL code. 

As I side note I find those prices expensive. If the point is to prevent people from eating and drinking unhealthy food you should also consider distributing fruits and vegetable snacks.
0 Kudos
Reply