用下面这段代码闪亮板子上3个led,这段代码在altera的板子上执行后led会闪烁,但是在xilinx的板子上没有得到相同的效果。在xilinx的板子上只是这3个led亮了,但是不闪(板子上共有8个led)
module led(sys_clk,
sys_rstn,
led
);
input sys_clk;
input sys_rstn;
output [2:0] led;
reg [2:0] led;
reg [24:0] delay_cnt;
always@(posedge sys_clk or negedge sys_rstn)
begin
if(!sys_rstn)
delay_cnt <= 25'd0;
else
begin
if(delay_cnt == 25'd24999999)
delay_cnt <= 25'd0;
else
delay_cnt<=delay_cnt+1'b1;
end
end
always@(posedge sys_clk or negedge sys_rstn)
begin
if(!sys_rstn)
led<=3'b111;
else
begin
if(delay_cnt==25'd24999999)
led<=~led;
else
led<=led;
end
end |