看了别人的作业,发现得养成良好的注释习惯,下次得加上!
(我的开发板是8个LED,12M输入的,貌似管脚与蜂鸣器复用了)
module LEDSHAN(Clk,Rset,Led);
input Clk;
input Rset;
output [7:0] Led;
reg [7:0] Led ;
reg [24:0] Delay;
always@(posedge Clk ,negedge Rset)
begin
if (!Rset)
Delay<=25'd0;
else if(Delay==25'd11999999)
Delay<=25'd0;
else
Delay<=Delay+1'b1;
end
always@(posedge Clk,negedge Rset)
begin
if(!Rset)
Led<=8'b11111111;
else if (Delay==25'd11999999)
Led<=~Led;
else
Led<=Led;
end
endmodule
这是实验现象http://v.youku.com/v_show/id_XNzIxMjA4NDky.html