Project 4 – Keeping cars in line
A classic design challenge for budding engineers is designing a traffic light controller. The Xilinx project files for the Nexys A7 can be found in CH4/build/traffic_light/traffic_light.xpr
. Basys 3 doesn't provide the tricolor LEDs, so this project cannot be done directly using it:
The preceding diagram shows the basic scenario. We have an intersection with four traffic lights and four sensors labeled up, down, left, and right.
Some ground rules are as follows:
- When a light is green, it will stay green for a minimum of 10 seconds.
- When a car goes through a green light, it is ignored.
- When a car waits at the red light, it signals the green to switch after it has been green for 10 seconds.
- The light will stay yellow for 1 second when transitioning from green to red.
We've defined the problem. The first step, as always, is...