eecs270.org

Project 6: Traffic Light Controller

Component Points
Autograder 75
Lab Signoff 60
   
Total 135

Due Date: April 1, 2026 at 11:59 PM

Before Starting

Helpful references:

Starter Files

Design Specification

Design a traffic light controller for an intersection involving a main east-west road and a side north-south road. Analyze the requirements in detail before writing any Verilog.

Traffic intersection

Project 6 controller interface

Figure 1: Traffic intersection, controller interface, module decomposition, and module instantiation graph

The intersection allows three traffic flows:

Inputs and Outputs

Controller states must be represented by positive edge triggered DFFs. The controller has a synchronous Reset input that, when HIGH, sets the next state to traffic flow A and resets the timer to 10.

The Timer output counts down and is displayed in decimal much like a pedestrian crosswalk timer.

Displaying Numbers for the Timer

Figure 2: Displaying Numbers for the Timer

Operation Rules

  1. A Green light must remain Green for intervals that are multiples of 10.
  2. When no sensor is on, the three flows cycle in the order Flow C, Flow B, Flow A, Flow C, …
  3. Only one flow can be green at a time.
  4. Conflicts among all three flows are resolved by giving Flow A priority over Flow B, Flow B over Flow C, and Flow C over Flow A.
  5. When a light changes from Green to Red, it must be Yellow for exactly 1 cycle in between. A light may never go from Yellow to Green, nor from Red to Yellow. The Timer counts down from 10 to 1 when the light is Green and is blank when the light is Yellow.
  6. No starvation. If a sensor is on that isn’t covered by the current flow, its lane must get a Green light as soon as the current conflicting flow ends its 10 cycle Green interval and 1 cycle Yellow interval.
  7. When only one sensor is on, that light will become Green and stay Green until some other sensor input changes (without violating the other rules). In this case, there should be no Yellow states.
  8. No light combinations beyond Flow A, Flow B, and Flow C are allowed (excluding yellow transition states).

Mapping Light Colors to HEX Displays

The HEX displays indicate colors by their first letter in lowercase as shown below.

Displaying Green, Yellow, and Red

Figure 3: Displaying Green (g), Yellow (y), and Red (r)

Modules

Clock_Div Module

Clock_Div usage

Figure 4: The Clock_Div module

Instantiate Clock_Div with CLOCK_50 and tap the output array at the appropriate index to derive a 2 Hz clock ():

wire [36:0] CLOCKS;
wire clk;
Clock_Div (CLOCK_50, CLOCKS);
assign clk = CLOCKS[i];  // pick i for ~2 Hz

The frequency at index i of CLOCKS is:

f[i] = (50 × 106) / 2i Hz

Pick the index that yields the closest approximation to a 0.5-second period without exceeding it.

Design Notes and Hints

Deliverables

File Name Task Testing Process Grading Process
TLC.v Implement the traffic light controller ModelSim Autograder
B4_to_7SEG.v Implement the 4-bit binary to 2-digit decimal HEX converter ModelSim Autograder
TestBench6.v Write test cases for TLC ModelSim Autograder
Project6.v Connect TLC and Clock_Div to FPGA pins LabsLand Signoff

To ensure that your design works with the Autograder, do not modify file names, module names, or interfaces for any of the starter files. All files must be submitted to the Autograder for grading and feedback.

The signoff will be conducted in your assigned lab sections the week after the project deadline.