0% found this document useful (0 votes)
17 views3 pages

Vending Machine FSM Design Guide

The document outlines the design specifications for a vending machine that sells soda and water, detailing costs and coin acceptance. It describes the finite state machine (FSM) states, including initialization, coin input thresholds, and outputs for dispensing drinks or returning coins. The machine is programmed to minimize change given and to stop accepting coins once sufficient funds for a selected drink are met.

Uploaded by

manicks369601
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views3 pages

Vending Machine FSM Design Guide

The document outlines the design specifications for a vending machine that sells soda and water, detailing costs and coin acceptance. It describes the finite state machine (FSM) states, including initialization, coin input thresholds, and outputs for dispensing drinks or returning coins. The machine is programmed to minimize change given and to stop accepting coins once sufficient funds for a selected drink are met.

Uploaded by

manicks369601
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

FSM Example

Design a vending machine followed by below specifications:-

Soda cost 9000, Water cost 7000.-

The machine accepts 1000, 2000 and 5000 coin.-

Give a change as small as possible.-

If the total coin pushed into machine already equaled or greater than 9000,the
machine has no longer accepts the coins and put it back.-

Coin return button: put all the coins that user pushed into machine out.-

If no buttons pressed, keep the state.-

Output:
+ Coin return out
+ Water out
+ Soda out
+ Changes

Finite State Machine


State Init: all output = 0 ; wait for user push coins into-
State Coin1: user had pushed coins into machine but the money was < 7k-
State Coin2: the money was equal or greater than 7k but smaller than 9k,Water
is ready now-
State Coin3: the money was greater than 9k already, cannot accept any more
coin. Water and Soda is ready-
State Water : output of Water is set, and if money input greater than 7k,change
will gave back to user.-
State Soda : similar state water-
State Return: Return all money when return button was pressed

You might also like