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.
- Choose a snazzy team name and get a notebook to store your notes.
Write your names and contact addresses on the first page.
- If you need to finish your register circuit from last week, excuse
yourself from the group and work on it. If your circuit is finished,
you can get started on the project. Here are some things you can do today.
- Make a list of chips you will need, and collect them onto some of the
black antistatic mats.
- Start drawing an overall `map' of the circuit. Space your
design over 4 (or more) circuit boards. Try to partition the design so
that each person in the group can work separately on a different piece.
You should make a `macro' design that says what parts are on what boards,
and a `micro' design for each board showing what chips. Avoid bad layouts that
cause long wires. Don't forget to include
space for input/output, and for the control unit (somewhere in the center of
your map) to be designed in the future.
- Start designing an implementation for the state machine.
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.
- Draw the state machine for this dispenser.
- Write the truth tables for the output logic and for the next-state logic.
- Draw the circuit diagram for the state machine, using D flip-flops.
- 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.
- There are three outputs: NS controls the north/south
light (0=green, 1=red), EW controls the east/west light, and PW controls
the pedestrian walk lights (0=walk, 1=don't walk).
- There are two inputs: T (timer) and P (pedestrian button).
- The (output) lights can be in three configurations:
either north/south traffic light is green and the other two are red;
or east/west traffic light is green and the other two are red; or
pedestrian lights are green and the two traffic lights are red.
- Here are some transition rules:
- If T=0, the traffic signal doesn't change, it stays in the same state.
- If there are no pedestrians present (P=0), the traffic light just
cycles back and forth between NS and EW, whenever T is 1.
- If a pedestrian pushes the button (P=1),
then traffic is stopped and the pedestrian lights
go green, until the next timer signal.
- What to do after the pedestrian light is green is up to you.
- 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?
- Draw the state machine for this traffic controller. It should clearly
match your policy.
- Draw the Truth Tables for the output logic and the next-state
logic. You do not have to draw this circuit or a memory.