Lab 12: State Machine Project

Table of Contents



Objective

Learn to to design a statemachine, implement a state machine using logic gates, and verify the design using Verilog.

Lab Description

Almost all of the real world electronic systems are synthesized using
one or multiple finite state machines. This lab considers a finite
state machine controller for a 'coin to bills converter' machine. To
help needy children, a generous company has decided to offer $1 food
voucher for every 30 cents dropped into the machine. You are required to
design the state machine for the specifications provided below.

Specifications

The machine accepts only nickels (5 cents) and dimes (10 cents). The
output $1 food voucher should be dispensed when the total coin amount
reaches or exceeds 30 cents. If the amount exceeds 30 cents, the change
should be applied as credit towards next time the machine is used, i.e.,
no coins will be dispensed.

For the lab, there should be a 1 bit input which specifies the
following:

Input Coin
0 5 Cents
1 10 Cents

The diagram illustrates the input and output to the controller. The
asynchronous Reset input is to reset the state machine to its IDLE
state. As the food voucher is dispensed, the state machine should
reset itself to its initial (IDLE) state or a state that reflects the
amount to be credited (change).

There should be 2 outputs denoting the following:

You are to develop the state table and determine the number of bits "N" required for denoting the current state (and determine the number of
flip-flops).

To Do

Lab Report

Submission

Please do NOT email your lab submissions to the TA or the instructor, unless you have a problem with for your blackboard account.

Important Notes

Provided Verilog and Sample Results

Test 1, only 5 cents

Test 2 - Only 10 cents + enable test

Test 3 - Credit test