+/EE316
digital logic
git clone https://git.julia.blue/+/EE316
91885ad
master
1`timescale1 ns/ 1 ps 2 3module call_system ( 4input wire clk , 5input wire call_button , 6input wire cancel_button , 7output reg light_state 8); 9 10reg next_state ; 11 12always @( * ) begin 13case ({ call_button , cancel_button , light_state }) 143'b000 : next_state = 1'b0 ; 153'b001 : next_state = 1'b1 ; 163'b010 : next_state = 1'b0 ; 173'b011 : next_state = 1'b0 ; 183'b100 : next_state = 1'b1 ; 193'b101 : next_state = 1'b1 ; 203'b110 : next_state = 1'b1 ; 213'b111 : next_state = 1'b1 ; 22default : next_state = 1'b0 ; 23endcase 24end 25 26always @( posedge clk ) begin 27light_state <= next_state ; 28end 29 30endmodule