Vending Machine
Vending Machine
Vending Machine
Vending Machine
Design Vending Machine Circuit
• Dispense a Coke when depositing 15 ¢
• Inputs:
– 5: 5¢ coin
– 10: 10¢ coin
– WC: Wrong Coin (all coins except 5¢ and 10 are WC)
• Outputs
– R: Reject (In case of unacceptable coins)
– C: Bottle of Coke
– N: No bottle (When money is less than 15¢)
State Diagram
Encode State Names
State Table
NB=A’B’X1’X0’+AX0+BX1
Logic Circuit Design
Present State Inputs (5,10,WC) Next State Outputs (N,C,R)
A B X1 X0 NA NB Y1 Y0
0 0 0 0 0 1 0 0
0 0 0 1 1 0 0 0
0 0 1 0 0 0 1 0
Y1=X1
0 1 0 0 1 0 0 0
0 1 0 1 0 0 0 1
0 1 1 0 0 1 1 0
1 0 0 0 0 0 0 1
1 0 0 1 0 1 0 1
1 0 1 0 1 0 1 0
X X 1 1 X X X X
1 1 X X X X X X
Y0=AX1’+BX0
Logic Circuit
Y1=X1
Y0=AX1’+BX0
NA=BX1’X0’+A’B’X0+AX1
NB=A’B’X1’X0’+AX0+BX1
State Table
Z = XAB
Logic Circuit Design
Z = XAB
NA = XA’B + AB’
NB = X(A⊕B)’ + X’AB’