Draw state diagram, write VHDL code, write test bench
code and implement using Spartan-III kit.
1. VCR Controller:
Implement a VCR controller as a Moore FSM.
The user controls the motion as follows:
Pressing
the Play button causes the tape to play.
Pressing the FF button causes the tape to advance:
Without playing, if stopped.
Scanning, if in play mode.
Pressing the Stop button causes the tape to stop.
Pressing the Rew button causes the tape to rewind:
Without playing, if stopped.
Scanning, if in play mode.
Pressing the FF button causes the tape to advance:
Without playing, if stopped.
Scanning, if in play mode.
Pressing the Stop button causes the tape to stop.
Pressing the Rew button causes the tape to rewind:
Without playing, if stopped.
Scanning, if in play mode.
Note: I
haven’t specified all transitions possible...
Outputs: Forward, Reverse,
Fast, HeadReading
2. Combinational Lock 1:
A 3-bit serial combination
lock is used to allow entry into a locked room.
The lock has RESET button, an
ENTER button, and a two-position switch to represent the key being entered. When the signal UNLOCK is asserted, an
electromechanical relay is released, allowing the door to open. The unlock process begins when the operator
presses RESET. He or she then sets the
input switch, followed by pressing the ENTER button. This is repeated for the second and third key
digits. An ERROR light should be illuminated
if, after entering the three binary digits, the operator has not matched the
key. The process can be started again by
hitting reset again.
3.
Air
Lock Controller
Implement an airlock controller as a Moore FSM.
The airlock has two doors – insideDoor and outsideDoor.
These are controlled by the signals insideDoorOpen and outsideDoorOpen.
There are two buttons – insideRequest and outsideRequest.
The airlock pressure is controlled by a single signal –
pressurize. The pressurize/depressurize process takes 10 seconds.
A ten second timer is available. It has input StartTimer
and output TimeUp.
The reset state is:
Both doors closed. Airlock pressurized.
When a request button is pressed, the following must
happen:
- The
chamber is either pressurized or depressurized depending on which button
was pressed.
- The
appropriate door is opened for ten seconds and then closed.
- The
chamber’s pressure is inverted.
- The
opposite door is opened for ten seconds and then closed.
______________________________________________________________________
4. Combinational
Lock 2:
Design another combo lock controller as a Mealy FSM...
The combination is A-A-B-A-B-A. If this is entered, output “open”.
From any state, three B’s in a row will reset the lock to
it’s beginning state.
Whenever an out-of-sequence A occurs, an output “bell” is
asserted to raise an alarm.
Once the lock is open,
pressing either A or B will reset it to the beginning state.
5 Washing Machine Controller:
Design a washing machine
controller as a Moore FSM...
Operation: When start is pressed, goes through wash,
spin, rinse, spin cycles. If “double rinse” is selected, an extra rinse and
spin cycle is added.
Details: Must fill the tub with water before washing or
rinsing – output the signal “filltub” to do this. A timer is provided that
gives the appropriate amount of time for a wash, rinse, or spin cycle.
Outputs:
Filltub – turns on water to tub.
Agitate – turns on agitator for wash and rinse
Spin – turns on spinner
StartTimer – starts the wash/rinse/spin timer – the timer’s start input is rising-edge triggered
Agitate – turns on agitator for wash and rinse
Spin – turns on spinner
StartTimer – starts the wash/rinse/spin timer – the timer’s start input is rising-edge triggered
Inputs:
Start – starts a wash
Tubfull – true when tub is full of water
Double – true if user wants a double rinse
TimeUp – true when time for wash/rinse/spin is done
Start – starts a wash
Tubfull – true when tub is full of water
Double – true if user wants a double rinse
TimeUp – true when time for wash/rinse/spin is done
6.
6. Tennis Scorer:
Design a Moore finite state
machine that keeps track of score in a tennis game. Tennis is scored as follows:
•
There
are two players, A and B.
•
Scoring
starts at zero, which is known in tennis lingo as love.
•
As
a player wins games, his/her score advances as follows:
Love à 15 à 30 à 40 à Game
•
The
first one to achieve “Game” wins.
•
The
score 40-40 is known as deuce.
If the score is deuce, then the first player to win two
points in a row wins the game.
Your finite state machine will have synchronous inputs A,
which is true whenever A wins a point, and B, which is true whenever B wins a
point, and a reset input.
The outputs should be “A
wins” and “B wins”, asserted at the appropriate times. Each state should be labeled with the current
score of player A and player B (i.e. 15-Love or 40-15).
7.
7. Traffic
Light Controller:
n A
busy highway is intersected by a little used farmroad
n Detectors
C sense the presence of cars waiting on the farmroad
q with
no car on farmroad, light remain green in highway direction
q if
vehicle on farmroad, highway lights go from Green to Yellow to Red, allowing
the farmroad lights to become green
q these
stay green only as long as a farmroad car is detected but never longer than a
set interval
q when
these are met, farm lights transition from Green to Yellow to Red, allowing
highway to return to green
q even
if farmroad vehicles are waiting, highway gets at least a set interval as green
n Assume
you have an interval timer that generates:
q a
short time pulse (TS) and
q a
long time pulse (TL),
q in
response to a set (ST) signal.
q TS
is to be used for timing yellow lights and TL for green lights
Prof. Dr. Sunita P. Ugale
No comments:
Post a Comment