Vending machine example

The problem is to design a Nabs dispenser. The Nabs machine has two inputs, x and y, which encode the following information:

xyMeaning
00nothing is happening
01nickel inserted
01dime inserted
11Nabs button pushed

There is a single output, z. When z is 0, the machine produces nothing. When z is 1, the machine outputs a package of Nabs.

Assume that Nabs cost 15 cents. Nabs are returned only if the Nabs button is pushed after 15 cents are deposited. Assume that this %!@%$# machine returns no change and just keeps any money you deposit over 15 cents.

Draw the finite state machine for the Nabs dispenser below.

The state table

xyABzABJAKAJBKB
00000000?0?
00010010??0
0010010?00?
0011011?0?0
01000010?1?
01010101??1
0110011?01?
0111011?0?0
10000101?0?
10010111??0
1010011?01?
1011011?0?0
11000000?0?
11010010??0
1110010?00?
1111100?1?1

The Equations

Implementation with D flip-flops

Nabs with D flip-flops

Press here to retrieve a copy.

Implementation with JK flip-flops

Nabs with JK flip-flops

Press here to retrieve a copy.


Return to the Handout index