![]() Heres the simulation file I have, must be missing something. S0 : if (main = 0 & side = 1 ) begin if (count1 > 0 ) beginĬount2 = delay15 end default : state <= S0 endcase end always ( * ) begin case (state ) S3 : state <= S0 default : state <= S0 endcase end always ( * ) begin case (state ) In this clock and clear are two input signal and RED, GREEN & YELLOW are 2 bit output signal. Given below code is design code for Traffic Light Controller using Finite State Machine (FSM). You can design it for different designs and algorithms. ![]() ) reg state parameter S0 = 2'b00, S1 = 2'b01, S2 = 2'b10, S3 = 2'b11 always ( posedge clk ) begin case (state ) Traffic light controller using Verilog is very simple. Module Traffic_Signal ( input main, input side, input wire clk, output reg MG, //Mainstreet Green output reg MY, //Mainstreet Yellow output reg MR, //Mainstreet Red output reg SG, output reg SY, output reg SR
0 Comments
Leave a Reply. |