Computer Science 14 -- Lab 4

What To Do Today

Starting your Group Project

Your group should meet, present your designs to one another, and decide which project you want to build.

Turn in your proposals Friday. Put a big star on the proposal selected by your group, and I will expedite my review in order to look for serious problems or make suggestions.

Homework for Monday

Bring your answers to these questions about control and state machines to class on Monday.

(1) You want to build a candy dispenser that accepts (as input), dimes and nickels. When a dime is inserted, the D input is set to 1; otherwise it is 0. When a nickel is inserted, N is 1, otherwise it is 0. There is also a RESET button. When someone inserts 15 (or more) cents the state machine output is C=1, and the candy is dispensed; otherwise C=0. When the user presses RESET, the state machine output is R=1, and the coins fall into the change slot, otherwise R=0. After an output is generated, the state machine starts over in the initial state.

  1. Draw the state machine for this dispenser.
  2. Write the truth tables for the output logic and for the next-state logic.
  3. Draw the circuit diagram for the state machine, using D flip-flops.
  4. Suppose you want to implement this with a memory instead of flip-flops. Show the contents of the memory. The output bits should be labelled with the control lines that they control. You probably will need to include a paragraph or so describing how you will encode the next-state information.

(2) You need a finite state machine to control a traffic light with pedestrians, as follows.

  1. Explain what you want the state machine to do after the pedestrian light is green: that is, what are the transitions out of this state?
  2. Draw the state machine for this traffic controller. It should clearly match your policy.
  3. Draw the Truth Tables for the output logic and the next-state logic. You do not have to draw this circuit or a memory.