FSM with Output Logic in Verilog
📖 Scenario: You are designing a simple traffic light controller using a finite state machine (FSM). The traffic light cycles through three states: Green, Yellow, and Red. Each state lasts one clock cycle for simplicity.
🎯 Goal: Build a Verilog FSM that changes states on each clock cycle and outputs the correct light signal for each state.
📋 What You'll Learn
Create a state encoding using parameters
Use a register to hold the current state
Implement a synchronous state transition on the clock's rising edge
Add output logic that sets the traffic light signals based on the current state
Print the current state and output signals
💡 Why This Matters
🌍 Real World
Traffic light controllers use FSMs to manage light changes safely and predictably.
💼 Career
Understanding FSMs and output logic is essential for hardware design and embedded systems engineering.
Progress0 / 4 steps