// 4 Button Door Lock // ------------------------------------------------------ // Your Name // E-Mail module debounce(CLK,SWITCH,OUT); input CLK; input SWITCH; output OUT; reg OUT; always @(posedge CLK) begin // ... end endmodule module main(CLK,SW2,SW3,SW4,SW5,LEDS); input CLK; // Input clock input SW2,SW3,SW4,SW5; // Switches, 1=on, 0=off output [9:0] LEDS; // LED Bar Graph. 0=on, 1=off wire swa,swb,swc,swd; // wires for debounced switches // debounce switches debounce(CLK,SW2,swa); debounce(CLK,SW3,swb); debounce(CLK,SW4,swc); debounce(CLK,SW5,swd); reg [3:0]state; // the current state of the state machine always @(posedge CLK) begin // ... case (state) 4'd0 : ; 4'd1 : ; // ... default : ; endcase end endmodule