EDA初学 求大神具体解释一下代码
时间:10-02
整理:3721RD
点击:
module LED( clk,rst,led);
input clk;
input rst;
output[7:0] led;
reg [7:0] led;
reg [25:0] count;
always @ (posedge clk or negedge rst)
begin
if(!rst)
begin
led<=8'h80;
count<=26'h0;
end
else
begin
count<=count+1;
if(count==26'ffffff)
begin
led<=led>>1;
count<=0;
if(led==8'h0)
led<=8'h80;
end
end
end
endmodule
// LED.v
input clk;
input rst;
output[7:0] led;
reg [7:0] led;
reg [25:0] count;
always @ (posedge clk or negedge rst)
begin
if(!rst)
begin
led<=8'h80;
count<=26'h0;
end
else
begin
count<=count+1;
if(count==26'ffffff)
begin
led<=led>>1;
count<=0;
if(led==8'h0)
led<=8'h80;
end
end
end
endmodule
// LED.v
Altium.Designer.14.0.9.build.30380
就是一个LED流水灯