Docsity

Vending Machine Controller: Mealy FSM Design and Encoding - Prof. Shantanu S. Dutt, Assignments of Digital Systems Design

Toggle sidebar
bg1
1
ECE 465, Spring 2009, Instructor: Prof. Shantanu Dutt
Homework 3 : Due Thurs, April 23
1. Obtain a state-transition diagram for a Mealy FSMfor a vending machine controller with the following
specifications: It dispenses gum for 15 cents and accepts nickels, dimes and quarters inserted one at
a time. Three sensors detect which type of coin has been inserted and a 4-to-2 encoder converts the 3
outputs of the sensor into a 2-bit input

to the FSM (

means no coins inserted, = 01
means a nickel inserted, = 10 means a dime inserted, and = 11 means a quarter inserted). It returns
change; assume that the user will not put in more then a total of 25 cents and that the amount of
change to be returned is always available. Three outputs are required from the FSM, one is “OPEN”
for dispensing gum and the other two
for controlling coin return (= 00 for no change, = 01 for
5 cents change, = 10 for 10 cents change).
Draw a clear block diagram of the system (see, e.g., the block diagram of the simpler vending machine
system in the lecture notes on “Sequential Circuit Synthesis”) and then give the FSM’s state-transition
diagram. Label the states so that it is clear what they represent. 100
2. (a) Perform a classical binary state encoding of the vending machine FSM solution of Prob. 3 above,
and use this to obtain a D-FF realization of the sequential circuit. 100
You need to go throught the following steps (see Lecture Notes on “Sequential Ckt Synthesis” for
examples):
Perform the state encoding.
Obtain the state transition and D-FF excitation table.
Minimize the output and state excitation functions using K-maps for each function (you need
not use multi-function QM, though it will be useful here, and I understand you’ll be thrilled to
have that opportunity).
Implement the circuit using AND/OR/NOT gates and D-FFs.
(b) Now implement the FSM using the one-hot design style and D-FFs. 100
(c) Compare the following metrics of the one-hot and binary encoing designs you have obtained:
(i) The total logic cost in terms of total AND and OR gate inputs across all the logic gates (FFs are
not counted here). Show your analysis clearly and methodically. 50
(ii) The maximum delay in the next-state transition and output logic circuit part of the the two designs.
Assume that a
-input gate (AND/OR/NOT) has a delay of

ns (thus your final delays are to be in
units of ns). Show your analysis clearly and methodically. 100
3. 9.1 (b) & (c) 30
4. 9.3 50
5. 9.7 50

Partial preview of the text

Download Vending Machine Controller: Mealy FSM Design and Encoding - Prof. Shantanu S. Dutt and more Assignments Digital Systems Design in PDF only on Docsity!

ECE 465, Spring 2009, Instructor: Prof. Shantanu Dutt

Homework 3 : Due Thurs, April 23

  1. Obtain a state-transition diagram for a Mealy FSM for a vending machine controller with the following specifications: It dispenses gum for 15 cents and accepts nickels, dimes and quarters inserted one at a time. Three sensors detect which type of coin has been inserted and a 4-to-2 encoder converts the 3

outputs of the sensor into a 2-bit input ^ to the FSM ( ^   ^ means no coins inserted, = 01

means a nickel inserted, = 10 means a dime inserted, and = 11 means a quarter inserted). It returns change; assume that the user will not put in more then a total of 25 cents and that the amount of change to be returned is always available. Three outputs are required from the FSM, one is “OPEN”

for dispensing gum and the other two    for controlling coin return (= 00 for no change, = 01 for

5 cents change, = 10 for 10 cents change). Draw a clear block diagram of the system (see, e.g., the block diagram of the simpler vending machine system in the lecture notes on “Sequential Circuit Synthesis”) and then give the FSM’s state-transition diagram. Label the states so that it is clear what they represent. 100

  1. (a) Perform a classical binary state encoding of the vending machine FSM solution of Prob. 3 above, and use this to obtain a D-FF realization of the sequential circuit. 100 You need to go throught the following steps (see Lecture Notes on “Sequential Ckt Synthesis” for examples):

 Perform the state encoding.

 Obtain the state transition and D-FF excitation table.

 Minimize the output and state excitation functions using K-maps for each function (you need

not use multi-function QM, though it will be useful here, and I understand you’ll be thrilled to have that opportunity).

 Implement the circuit using AND/OR/NOT gates and D-FFs.

(b) Now implement the FSM using the one-hot design style and D-FFs. 100 (c) Compare the following metrics of the one-hot and binary encoing designs you have obtained: (i) The total logic cost in terms of total AND and OR gate inputs across all the logic gates (FFs are not counted here). Show your analysis clearly and methodically. 50 (ii) The maximum delay in the next-state transition and output logic circuit part of the the two designs.

Assume that a -input gate (AND/OR/NOT) has a delay of  ns (thus your final delays are to be in

units of ns). Show your analysis clearly and methodically. 100

  1. 9.1 (b) & (c) 30
  2. 9.3 50
  3. 9.7 50