Skip to content

Latest commit

 

History

History
85 lines (65 loc) · 4.05 KB

File metadata and controls

85 lines (65 loc) · 4.05 KB

Contributors MIT License LinkedIn

Designing a traffic light controller to coordinate traffic lights on highways and farm ways

State Diagram

  • In a Mealy machine, the output depends on both the current state and the current inputs.

  • A general model of a Mealy sequential machine consists of a combinatorial network, which generates the outputs and the next state, and a state register which holds the current state as shown below.

  • The state register is normally modeled as D flip-flops.

  • The other block(s) can be modeled either using the always procedural block or a mixture of the always procedural block and dataflow modeling statements.

  • The two blocks Mealy machine image

  • Traffic Light Controller - A sensor on the farmway is to detect if there are any vehicles and change the traffic light to allow the vehicles to cross the highway. Otherwise, highway light is always green since it has higher priority than the farmway.

Schematic

image

  • Enlarge the left half image

  • Enlarge the right half image

Simulation

  • Highway light is always green since it has higher priority than the farmway

  • Green on highway and red on farmway image

  • Sensor detects vehicles on farmway, green on highway and red on farmway turn to yellow on highway and red on farmway

  • Yellow on highway and red on farmway image

  • Yellow on highway and red on farmway for 3s, then turn to red on highway and green on farmway

  • Red on highway and green on farmway image

  • Red on highway and green on farmway for 10s, then turn to red on highway then yellow on highway

  • Red on highway and yellow on farmway image

  • Red on highway and yellow on farmway for 3s, then turn to green on highway and red on farmway

  • Green on highway and red on farmway image

Monitor

image

License

Distributed under the MIT License. See LICENSE for more information.

Let's Get Social

Contact

吳華楨 Trista Wu - [email protected]

Project Link: https://github.com/trista-csee/Traffic_Light_Controller_Mealy_Machine

(back to top)