COSC 201: Computer Organization

Lab 6: Finite State Machines

Purpose
Learn how finite state machines work and build a circuit for an FSM
Method
Define a FSM for a garage door opener controller and create a circuit for it.
Preparation
Read Appendix C from the text (from the disk)
Files to Use
           garageTT.doc and main.circ and garage.circ
What to Hand In
Completed garageTTXX.doc and garageXX.circ.

The garage door opener has four states: closed (at the bottom) - 00, open (at the top or part way) -- 10, going up 01, going down 11.

The garage door has three sensors and one control as input: at bottom sensor (0 if not, 1 if at bottom), at top sensor (0 if not, 1 if at top), electric eye (0- blocked so down motion should be reversed, 1 - unblocked), and a control button which should start the door moving in an appropriate way.

The rules are these:

  1. If the door is at the bottom (state 00), then pushing the button should start it moving up.
  2. If the door is moving up and the top sensor goes on, the door should stop in an open position at the top.
  3. If the door is moving up and the button is pushed, the door should stop in an open position, partially open.
  4. If the door is in a open position and the eye is not blocked and the button is pushed, then the door should start moving down.
  5. If the door is moving down and the button is pushed, then the door should reverse and start moving up.
  6. If the door is moving down and the eye becomes blocked, then the door should reverse and start moving up.
  7. If the door is moving down and the bottom sensor goes on, then the door should stop in the closed position.
  8. For any sensor indication(s) that is/are not possible for a given state, the state should remain the same. For example, when the door is moving up, it cannot make the bottom sensor go on, so in that state if the bottom sensor is 1 (impossible situation) the state should remain the same.

1. Draw a finite state machine diagram for the garage door control.

2. Fill out the garageTT table for state transitions. Then fill out the compressed table that reduces the table by using "don't cares" (indicated by X in the table). Also fill out the table that gives the outputs to the garage-opener motor for each possible state.

3. Complete the circuits for the transitions and the state-to-output in the file garage.circ. Then add this file to the main.circ file by opening the main.circ file and using the menu selection Project-library-logisim library and selecting your garage file.

4. Experiment with your circuit to see that it behaves as expected. The "one-shot" circuit makes pushing the button active for only one clock cycle, then it must be set to zero again before "pushing" by setting it to 1. The output should show when the door is moving up or down.

Hand in your file with the truth tables filled out and your garageXX.circ file via email.