E21 Digital System Design Lab #3: Sequential Circuit Design

Due 23 October, 2000

Overall Comments

The purpose of this lab is to introduce you to state machine design using a programmable logic chip. You will be working on the real-world problem of traffic light control.

Tasks

For part I of this lab you will design and implement a state machine to run a traffic light through a fixed sequence of states. For part II, you will add a pressure sensor input to the state machine that can vary the timing of the light sequence.

For all of the tasks you will be hooking together various components to make the complete circuit. You can do this using either VHDL and port map statements or using the graphical design editor.

The circuits you design for this lab should all have reset inputs that set the circuit to a known state, preferably a Red-Red state.

For both parts of this lab, you should program the MAX7128 chip on one of the lab boards and use it to run the actual traffic lights. As noted below, each light has its own input and the traffic lights are asserted low (on for a low voltage).

  1. For the static design, the traffic light should follow the sequence below.
  2. Traffic light specification with static times

    State

    Time

    NS Red

    EW Red

    2 seconds

    NS Green

    EW Red

    10 seconds

    NS Yellow

    EW Red

    4 seconds

    NS Red

    EW Red

    2 seconds

    NS Red

    EW Green

    10 seconds

    NS Red

    EW Yellow

    4 seconds

    To implement a static process, you can design a timer and then make the outputs--traffic light signals--a function of the timer outputs (Note: you already did this for the previous lab). This separates the problem into a sequential task--the timer--and a combinational task--the output generation.

    As an alternative overall design, you can make a single state machine that both counts and runs the traffic light. This is a more general design method that may be easier to generalize for task II.

    The outputs to the traffic lights are active low (low = on), so design your circuit appropriately. There are six outputs, one for each light.

    For sequential tasks, be sure to follow the appropriate design steps:

    If you are doing the design using basic gates, then you need to select a flip-flop type, determine the output equations and develop the appropriate logic diagrams. Using VHDL, however, you can write the state transition table as a case statement within a process to implement the circuit. In either case, you need to follow at least these four steps.

    For combinational circuits, follow the appropriate design steps, including a truth table and Karnaugh map in order to optimize the circuit.

  3. For the dynamic design you will create a sequential circuit that incorporates the pressure sensor and flexible programming for the traffic light. The traffic light should follow this sequence:

    Traffic light specification with pressure sensor

    State

    Time

    NS Red

    EW Red

    2 seconds

    NS Green

    EW Red

    At least L1 seconds, but not more than L2 seconds.

    NS Yellow

    EW Red

    4 seconds

    NS Red

    EW Red

    2 seconds

    NS Red

    EW Green

    At least L1 seconds, but not more than L2 seconds.

    NS Red

    EW Yellow

    4 seconds

    If you use VHDL, L1 and L2 should be macros in your code to make them easy to modify. They should be in the range of 10 to 25, and L1 < L2. For demonstration purposes, use 10 and 15 as the defaults for L1 and L2, respectively.

    For this second task, you will find that either developing it as a single state machine, or viewing the timer as the clock to a second state machine will make the design more tractable.

Extensions:

What to Hand In

You need to demo your working circuit for part II. Plan to do this during the lab period on Monday the 23rd.

If you follow the above steps, you will have the majority of your writeup for this lab completed. Clarity in your writeups is essential. Convey what you have done in a clear and concise manner, and in sufficient detail that someone else could replicate your work.

In addition to the design steps mentioned above, your lab writeup should include the following: