Traffic Lights Discussion D8.3a
Recall Divide-by-8 Counter Use Q2, Q1, Q0 as inputs to a combinational circuit to produce an arbitrary waveform. s s s s s s s s State Q2 Q1 Q0 D2 D1 D0 Present state Next state Q0 Q1 Q2 D0 D1 D2
s s s s s s s s State Q2 Q1 Q0 D2 D1 D0 y Blink
module lights ( clr,RYG,clk ); input clr ;// pushbutton switch S4 - pin 69 wire clr ; input clk ;// 1 Hz clock - pin 12 wire clk ; output [5:0] RYG ;// RYGRYG reg [5:0] RYG ; reg [3:0] Q; // 4-bit counter clk or posedge clr) if(clr == 1) Q <= 0; else Q <= Q + 1; lights.v
// Traffic lights case(Q[3:1]) // RYGRYG 0: RYG = 6'b001100; 1: RYG = 6'b001100; 2: RYG = 6'b010100; 3: RYG = 6'b100100; 4: RYG = 6'b100001; 5: RYG = 6'b100001; 6: RYG = 6'b100010; 7: RYG = 6'b100100; default: RYG = 6'b001100; endcase endmodule lights.v
#PACE: Start of PACE I/O Pin Assignments NET "clk" LOC = "p12" ; NET "clr" LOC = "p69" ; NET "RYG " LOC = "p32" ; NET "RYG " LOC = "p31" ; NET "RYG " LOC = "p26" ; NET "RYG " LOC = "p25" ; NET "RYG " LOC = "p20" ; NET "RYG " LOC = "p13" ; lights.ucf
G3VM-61A1MOS FET Relay
Silicon-Controlled Rectifier (SCR) Text: Section 11-12, pages
Triac
Using an AC Relay