Forum Discussion
Altera_Forum
Honored Contributor
10 years agoVending Machine
Hi there. I have a school project which consists in a vending machine that has 3 products ( diferent prices) and i can only use 4 type of coins. My idea is to make a FSM ( where each state eq...
Altera_Forum
Honored Contributor
10 years agoIt's probably better keep a total, say a 16 bit number of cents. What you have will use up quite a few resources. Fewer resources = cheaper chip. What happens in your design when someone puts $2.25 or $5.00 in the machine?
Edit: Fewer resources is relative. Your code as it is now will fit in any modern CPLD. It's better to learn to be frugal with resources at all times. It is always easier to design for fewer resources in the first place than it is to trim down a design that is using too many.