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

Vending Machine Controller—using VHDL and Logicworks 5

Altera_Forum
Honored Contributor II
1,905 Views

Vending Machine Controller—using VHDL and Logicworks 5 

This is my final project of a Digital System course. I am very unfamiliar with VHDL and my team members, teacher and TA have not been able to help. The deadline is very soon. I desperately need some help. Thank you all.  

Description: It is a relative simple project in terms functionality. Basically I want simulate a vending machine that sells candies. Each item is 50 cents and the machine accepts nickels, dimes and quarters. Once 50 cents are collected, the user would press an “OK” button and the machine would give out the candy. I am using the finite state machine (FSM) to keep track of the amount of money that remains and execute according actions depends on what the user does subsequently. St0 being no money is remained, all the way to st100 being 1 dollar is remained.  

Objectives:  

1. The vending machine must have the “refund” feature at any point of the finite state machine.  

2. Once the refund has been issued, the FSM must return to st0.  

3. Once 50 cents is reach, the user has the option to buy the candy and the FSM must return to st0 after.  

4. Once 50 cents is reached, any additional money that the machine collects will be automatically return. The FSM then return st50 and await the user’s next action.  

I will have my code in a text document file and some screenshots in this Word file. I will try to make some helpful comments.  

 

The code does not have any syntactical error, but it is not doing what I desire. Here is the list of the problems I recognized: 

1. RST (reset) doesn’t reset the FSM to st0. 

2. After refund has been issued, the FSM does not return to st0 and the refund outputs stay on.  

3. Additional money after st50 does not get returned, it stays on the FSM.  

 

My thought is that the excess use of “if-else” statement within a switch statement may be the cause of the problems, but I can’t figure it out at this moment.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
1,032 Views

hi ,  

 

I can help you simulate and take its bugs out . 

Email me the complete quartus project .
0 Kudos
Altera_Forum
Honored Contributor II
1,032 Views

The problem is that you havent simulated and debugged the design. How can you expect to learn something if you get someone else to do your work? 

 

I suggest downloading modelsim (you can get the altera starter edition for free) and writing a testbench to test the design.
0 Kudos
Reply