Traffic-Controller 10281
Traffic-Controller 10281
This experiment focuses on designing and simulating a basic traffic light controller using
Verilog HDL. The controller manages the timing and sequencing of traffic light states—
Red, Green, and Yellow—to emulate a standard traffic light pattern.
Traffic light controllers are sequential circuits often used as examples to illustrate finite state machine
(FSM) design. In this experiment, the controller will operate through three states (Red, Green,
and Yellow), each with a specific timing interval. This state transition process is managed via a
Verilog implementation, which will be verified through simulation on EDA Playground.
4. Tools Required
EDA playground online tool
5. Experimental Procedure
• Go to EDA Playground.
• Select the SystemVerilog or Verilog simulator (e.g., Icarus Verilog, ModelSim).
• Write the traffic_light_controller module and tb_traffic_light testbench in the
editor.
• Set up the clk and reset in the waveform configuration to observe state transitions
in real-time.
• Run the simulation and observe the output waveform to verify the traffic light
sequence.
6. OUTPUT
7. Conclusions
This experiment successfully implemented a traffic light controller using Verilog HDL,
demonstrating FSM design principles and sequential logic control. The setup on EDA Playground
verified the functionality, allowing observation of state transitions and timing through simulated
waveforms.
Post Lab Questions:
1. Differentiate between synchronous reset and asynchronous reset
2. Write a Verilog code to swap contents of two registers with and without a temporary
register?
Answer 1:
Reset Activation Takes effect only at the active Takes effect immediately when
clock edge asserted
Design Complexity Easier for synthesis tools to Can be prone to glitches due to
handle; cleaner design asynchronous behavior
Clock Requirement Requires clock to reset, so won’t Works even if clock is stopped
work if clock is off
Answer 2:
module swap_without_temp (
);
end
endmodule