CSE 140L Hardware Lab Three


Objective In this lab, we will learn how to build different types of finite state machine circuits.

Part 1 15-second time bomb

Design a counter that starts at 15 and count to 0.
There are several input to this circuit:

[start] : start the counter
[stop] : stop the counter
[reset] : reset back to 15 seconds

The output will include:

[counter index] (in binary is OK)
[blow_up] indicator when the sequence reaches 0000.

You should use a D-FF that allows your to initialize value to 1111 as counter start. Note, figure out which D-FF you want to use & understand how it works before you connect all the wires together. Once you figure out how the D-FF works, you may need to add a few logics so that the time bomb does not blow up when you set start=1 initially.

Simulate with start=0 first, then switch start=1. The counter should be at 1111 & the blow_up indicator should be 0 until the counter becomes 0000. Also, simulate the case that when start=1 but you realize at 5 second before blowing up, you need to stop it & reset it back to 15 seconds again.

Build this circuit and demonstrate the simulation to the TA.
Part 2 Freeway Traffic Control

Around 4pm in the afternoon when much of the traffic starts to enter the freeway, a set of GREEN/RED signal are used to prevent highway jams. Here is how the traffic signal works.

» There will be 2 lanes to enter the freeway: 1 carpool lane and 1 regular lane. Each lane will have a GREE/RED signal.
» When both lanes have cars waiting, each lane will take turns to go (GREEN will rotate between 2 lanes but both signals must turn RED before rotation).
» When both lanes have no cars, both signal will be RED
» When 1 lane has cars, only that lane will be GREEN. The other lane will always be RED.

Build this circuit and demonstrate the simulation to the TA.
Part 3 Vending Machine Control

Design a circuit that will be used in a coffee dispensing machine. This machine will dispense coffee when $0.35 (or more) is received. No change will be given if more than $0.35 is received. The machine can only take nickels, dimes, and quarters.

Use VHDL to implement your circuit. Be sure you are able to synthesize your code into an actual circuit.

Build this circuit and demonstrate the simulation to the TA.