请问我这个代码为什么上板子,打开rst开关,灯不亮呀!
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 2023/04/09 17:24:08
// Design Name:
// Module Name: FlowingWaterLamp
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module FlowingWaterLamp(
input CLK100MHZ,
input rst,
input [3:1] SW,
output reg[7:0] LED
);
//dir1确定单灯左右的方向,dir2确定双灯方向
wire clk_N100;
reg[7:0] state;
reg[7:0] nextstate;
parameter start=8'b0000_0000,
s00=8'b1000_0000,
s01=8'b0100_0000,
s02=8'b0010_0000,
s03=8'b0001_0000,
s04=8'b0000_1000,
s05=8'b0000_0100,
s06=8'b0000_0010,
s07=8'b0000_0001;
divider u_DIV(.clk(clk100MHZ),.clk_N100(clk_N100));
always @(posedge clk_N100) begin
if(!rst)
state<=8'b0000_0000;
else
state<=nextstate;
end
always @(posedge clk_N100) begin
case(state)
start:begin
if(SW==3'b000) nextstate<=s00;
end
s00:begin
if(SW==3'b000) nextstate<=s01;
end
s01:begin
if(SW==3'b000) nextstate<=s02;
end
s02:begin
if(SW==3'b000) nextstate<=s03;
end
s03:begin
if(SW==3'b000) nextstate<=s04;
end
s04:begin
if(SW==3'b000) nextstate<=s05;
end
s05:begin
if(SW==3'b000) nextstate<=s06;
end
s06:begin
if(SW==3'b000) nextstate<=s07;
end
s07:begin
if(SW==3'b000) nextstate<=s00;
end
default:;
endcase
end
always @(posedge clk_N100) begin
LED<=state;
end
endmodule