Skip to content

🚦 Digital logic implementation of a 4-way intersection traffic light controller using D-flip flops and state machine design. Features timing-based transitions, safe traffic flow management, and complete cycle control for North-South/East-West directions.

Notifications You must be signed in to change notification settings

alotanna/Logism_Traffic_Light

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Traffic Light Controller for Four-Way Intersection

A digital logic implementation of an intelligent traffic light control system for a four-way intersection using state machine design with D-flip flops.

🚦 Overview

This project implements a traffic light controller that manages traffic flow at a four-way intersection using a finite state machine approach. The system uses two D-flip flops to create four distinct states, each controlling the traffic light patterns for North-South and East-West directions.

πŸ“‹ Features

  • 4-State Traffic Control: Manages complete traffic light cycle for both directions
  • Timing-Based Transitions: Uses 5-second and 15-second timing intervals
  • Safe Traffic Flow: Ensures proper yellow light transitions and prevents conflicts
  • Digital Logic Implementation: Built using D-flip flops and combinational logic

πŸ”§ System Architecture

State Machine Design

The controller uses 2 D-flip flops (A, B) to create 4 states:

State A B North-South East-West
00 0 0 🟒 Green πŸ”΄ Red
01 0 1 🟑 Yellow πŸ”΄ Red
10 1 0 πŸ”΄ Red 🟒 Green
11 1 1 πŸ”΄ Red 🟑 Yellow

Timing Control

The system uses two timing inputs:

  • x = 1: When counter reaches 5 seconds (for yellow light duration)
  • y = 1: When counter reaches 15 seconds (for green light duration)

πŸš€ Implementation

Hardware Requirements

  • 2 Γ— D-flip flops
  • Combinational logic gates (AND, OR, NOT)
  • Timing counter circuit
  • LED indicators for traffic lights

Software Tools

  • Digital logic simulator (e.g., Logisim)

πŸ“Š Operation Cycle

  1. State 00: North-South GREEN (15 seconds) β†’ East-West RED
  2. State 01: North-South YELLOW (5 seconds) β†’ East-West RED
  3. State 10: North-South RED β†’ East-West GREEN (15 seconds)
  4. State 11: North-South RED β†’ East-West YELLOW (5 seconds)
  5. Repeat: Returns to State 00

πŸ”¬ Design Methodology

This project demonstrates:

  • Finite State Machine Design: Systematic approach to sequential logic
  • State Encoding: Efficient use of flip-flops for state representation
  • Timing Constraints: Real-world timing requirements integration
  • Safety Considerations: Proper traffic light sequencing

πŸ§ͺ Testing

The design includes comprehensive testing scenarios:

  • State transition verification
  • Timing constraint validation
  • Edge case handling
  • Safety requirement compliance

🀝 Contributing

Contributions are welcome! Please feel free to submit pull requests for:

  • Design optimizations
  • Additional timing modes
  • Enhanced safety features
  • Documentation improvements

πŸŽ“ Educational Context

This project is designed for digital logic and computer engineering coursework, demonstrating practical applications of:

  • Sequential logic design
  • State machine implementation
  • Real-world timing constraints
  • Safety-critical system design

πŸ“ž Contact

For questions or suggestions regarding this traffic light controller implementation, please contact me at: [email protected].


This project demonstrates the practical application of digital logic principles in traffic management systems, emphasizing both technical implementation and safety considerations.

About

🚦 Digital logic implementation of a 4-way intersection traffic light controller using D-flip flops and state machine design. Features timing-based transitions, safe traffic flow management, and complete cycle control for North-South/East-West directions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published