Vending Machine Presentation

22
Vending Machine With Vending Machine With VHDL VHDL Rajesh Kurpad Rajesh Kurpad Jonathan Bittner Jonathan Bittner James Michelich James Michelich Keeram Lee Keeram Lee

Transcript of Vending Machine Presentation

Page 1: Vending Machine Presentation

Vending Machine With Vending Machine With VHDLVHDL

Rajesh KurpadRajesh KurpadJonathan BittnerJonathan BittnerJames MichelichJames Michelich

Keeram LeeKeeram Lee

Page 2: Vending Machine Presentation

Project GoalsProject Goals

Design and digitally construct a fully Design and digitally construct a fully operational vending machineoperational vending machine Vending machine should be flexible enough to Vending machine should be flexible enough to

allow for multiple programming modesallow for multiple programming modes Vending machine needs to be reliable and user-Vending machine needs to be reliable and user-

friendly friendly Minimize logic and states such that the Minimize logic and states such that the

design can be realized in VHDL and design can be realized in VHDL and synthesized inexpensively onto a Xilinx chipsynthesized inexpensively onto a Xilinx chip

Page 3: Vending Machine Presentation

ApproachApproach Use the Teer Vending machine we all know and love Use the Teer Vending machine we all know and love

as a model for the behavior of our Vending Machineas a model for the behavior of our Vending Machine 8 rows, 8 columns (A-H, 0-7) for selection, with the ability 8 rows, 8 columns (A-H, 0-7) for selection, with the ability

to cancel a selection, price is determined by the to cancel a selection, price is determined by the rowrow Accepts nickels, dimes, quarters, and dollars, with the Accepts nickels, dimes, quarters, and dollars, with the

ability to cancelability to cancel Exact change required indicator, not enough funds Exact change required indicator, not enough funds

indicator, item output, change output based on a greedy indicator, item output, change output based on a greedy algorithmalgorithm

Modular component based design is optimal Modular component based design is optimal Organize vending machine into components with specific Organize vending machine into components with specific

taskstasks Each component will have its own set of states and SM Each component will have its own set of states and SM

chart to determine its own behaviorchart to determine its own behavior A central unit will comprise be responsible for relaying and A central unit will comprise be responsible for relaying and

communicating signals with each individual componentcommunicating signals with each individual component Active Edge of Clock – synchronized on the active Active Edge of Clock – synchronized on the active

edge of the clockedge of the clock

Page 4: Vending Machine Presentation

Vending Machine PackageVending Machine Package Defines coin, row, col, and item typesDefines coin, row, col, and item types

type coin is (NO_COIN, nickle, dime, quarter, dollar);type coin is (NO_COIN, nickle, dime, quarter, dollar);

type row is (NO_SELECTION, A, B, C, D, E, F, G, H);type row is (NO_SELECTION, A, B, C, D, E, F, G, H);

type col is (NO_SELECTION, C0, C1, C2, C3, C4, C5, C6, C7);type col is (NO_SELECTION, C0, C1, C2, C3, C4, C5, C6, C7);

type item is (NO_ITEM, A0, A1, A2, A3, A4, A5, A6, A7type item is (NO_ITEM, A0, A1, A2, A3, A4, A5, A6, A7

B0, B1, B2, B3, B4, B5, B6, B7, B0, B1, B2, B3, B4, B5, B6, B7,

C0, C1, C2, C3, C4, C5, C6, C7,C0, C1, C2, C3, C4, C5, C6, C7,

D0, D1, D2, D3, D4, D5, D6, D7,D0, D1, D2, D3, D4, D5, D6, D7,

E0, E1, E2, E3, E4, E5, E6, E7,E0, E1, E2, E3, E4, E5, E6, E7,

F0, F1, F2, F3, F4, F5, F6, F7,F0, F1, F2, F3, F4, F5, F6, F7,

G0, G1, G2, G3, G4, G5, G6, G7,G0, G1, G2, G3, G4, G5, G6, G7,

H0, H1, H2, H3, H4, H5, H6, H7);H0, H1, H2, H3, H4, H5, H6, H7);

Define a set of common FunctionsDefine a set of common Functionsfunction get_coin_value(c: in coin) return integer;function get_coin_value(c: in coin) return integer;

function get_coin(value: in integer) return coin;function get_coin(value: in integer) return coin;

function get_item_selection(r: in row; cl: in col) return item;function get_item_selection(r: in row; cl: in col) return item;

function get_item_price(r: in row) return integer;function get_item_price(r: in row) return integer;

function dispense_coin(change: in integer) return coin;function dispense_coin(change: in integer) return coin;

Page 5: Vending Machine Presentation

Vending Machine Design – 4 Vending Machine Design – 4 Major ComponentsMajor Components

Coin Insertion – monitors coin input including Coin Insertion – monitors coin input including nickels, dimes, quarters, and dollars and nickels, dimes, quarters, and dollars and communicates coin type and coin valuecommunicates coin type and coin value

Item Selection – monitors row selection and Item Selection – monitors row selection and column selectioncolumn selection

Change Dispenser – outputs the appropriate Change Dispenser – outputs the appropriate amount of changeamount of change

Vending Machine Control – keeps track of the Vending Machine Control – keeps track of the numeric insertion value, price of selected item, numeric insertion value, price of selected item, and controls the flow of the vending machine and controls the flow of the vending machine from coin insertion to item selection to item from coin insertion to item selection to item dispensed and change dispenseddispensed and change dispensed

Page 6: Vending Machine Presentation

Overview of SystemOverview of System

Page 7: Vending Machine Presentation

Change InsertionChange Insertion

InputsInputs CLK, resetCLK, reset Coin Signal – detect Coin Signal – detect

insertion of a coininsertion of a coin Coin Type – detect Coin Type – detect

type of cointype of coin OutputsOutputs

Coin TypeCoin Type Coin ValueCoin Value

Page 8: Vending Machine Presentation

Change Insertion SM ChartChange Insertion SM Chart

Page 9: Vending Machine Presentation

Item SelectionItem Selection

InputsInputs CLK, resetCLK, reset Cancel – cancels selectionCancel – cancels selection row_signal – monitors a row row_signal – monitors a row

selectionselection col_signal – monitors a column col_signal – monitors a column

selectionselection row_selection – given a row_selection – given a

row_signal, reads in the row row_signal, reads in the row selectionselection

col_selection – given a col_selection – given a col_signal, reads in the column col_signal, reads in the column selectionselection

selection_done – signal from selection_done – signal from mainmain

OutputsOutputs item_row – determines price of item_row – determines price of

itemitem item_select – item selected (ie item_select – item selected (ie

B5)B5)

Page 10: Vending Machine Presentation

Item Selection SM ChartItem Selection SM Chart

Page 11: Vending Machine Presentation

Change DispenserChange Dispenser

InputsInputs CLK, resetCLK, reset Initialize – initialize coin registersInitialize – initialize coin registers reset_dispenser – communication reset_dispenser – communication

from main modulefrom main module dispense_ready – signal indicating dispense_ready – signal indicating

change ready to be dispensedchange ready to be dispensed dispense_value – singal dispense_value – singal

determining the amount to be determining the amount to be dispenseddispensed

max_price_met – signal indicating max_price_met – signal indicating that the maximum amount of that the maximum amount of change has been inputted, any change has been inputted, any further change will be dispensedfurther change will be dispensed

OutputsOutputs out_coin_type – signal indicating out_coin_type – signal indicating

the type of coin dispensedthe type of coin dispensed dispense_finished – signal dispense_finished – signal

indicating that the dispense indicating that the dispense routine is finishedroutine is finished

no_more_change – signal no_more_change – signal indicating that no more change is indicating that no more change is left in the machine left in the machine

Page 12: Vending Machine Presentation

Change Dispenser SM ChartChange Dispenser SM Chart

Page 13: Vending Machine Presentation

Main ModuleMain Module

InputsInputs CLK, resetCLK, reset coin_type (from coin coin_type (from coin

insertion module)insertion module) coin_out (from coin coin_out (from coin

dispenser module)dispenser module) item_selectitem_select item_rowitem_row

OutputsOutputs Dispensed itemDispensed item Dispensed changeDispensed change Not enough change Not enough change

indicatorindicator Exact change indicatorExact change indicator

Page 14: Vending Machine Presentation

Main Module SM ChartMain Module SM Chart

Page 15: Vending Machine Presentation

SimulationsSimulations

Normal Operation with change returnedNormal Operation with change returned

Page 16: Vending Machine Presentation

Simulations, Cont.Simulations, Cont.

Insufficient amount of money inputtedInsufficient amount of money inputted

Page 17: Vending Machine Presentation

Simulations, Cont.Simulations, Cont.

Output is 2 dimes, 1 nickel instead of a Output is 2 dimes, 1 nickel instead of a quarterquarter

Page 18: Vending Machine Presentation

Synthesis - MainSynthesis - Main

Page 19: Vending Machine Presentation

Synthesis – Change Synthesis – Change InsertionInsertion

Page 20: Vending Machine Presentation

Synthesis – Item SelectionSynthesis – Item Selection

Page 21: Vending Machine Presentation

Synthesis – Change Synthesis – Change DispensingDispensing

Page 22: Vending Machine Presentation

Final Words and QuestionsFinal Words and Questions