State Machine Design Example

Tom Kelliher, CS 240

Mar. 3, 1999

Administrivia

Announcements

Homework due Friday. Homework questions? Solution will be posted by Monday.

Review Monday. Midterm Wednesday. Friday?

Assignment

From Last Time

State machine model. Clocks and latches.

Outline

  1. Flip-Flops.

  2. State machine design example.

Coming Up

MIPS datapath and control.

D Flip-Flop

An edge-sensitive D flip-flop with a falling-edge trigger:

Trace operation.

The importance of set-up and hold times.

Bicycle Light Design Example

The product: a bicycle light which has a button and a number of LEDs. Push the button once and the LEDs shine steadily. Push again and it goes off. Push a third time and the LEDs flash on and off a few times a second. Push one more time and it goes off again.

Design steps:

  1. Determination of inputs and outputs.

  2. Determination of machine states.

  3. Transition assignment.

  4. State assignment.

  5. Truth tables.

  6. Implementation.

Questions along the way:

  1. How many state bits?

  2. The state assignment problem. In this case: simplify LED equation.

  3. What to do with unused states? Don't cares; or do we care?

  4. What clock frequency? Issues: design simplification, power consumption.

  5. An alternative: one-hot state machines.



Thomas P. Kelliher
Tue Mar 2 16:21:50 EST 1999
Tom Kelliher