这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界» 论坛首页» DIY与开源设计» 电子DIY» haohaolinux的进程帖之LED流水灯

共3条 1/1 1 跳转至

haohaolinux的进程帖之LED流水灯

菜鸟
2012-11-03 14:57:42 打赏
module LED3(clk,rst_n,LED);
//programmed by haohaolinux
input clk,rst_n;
output [7:0] LED;

reg [7:0] LED;
reg [23:0] cnt;

//24 bit counter
always@(posedgeclk or negedge rst_n)
if(!rst_n)
cnt <= 24'h0;
else if(cnt == 24'hffffff)
cnt <= 24'h0;
else
cnt <= cnt+1;

always@(posedgeclk or negedge rst_n)
if(!rst_n)
LED <= 8'hff;
else if(cnt == 24'hffffff)
begin
LED <= {LED[6:0],~LED[7]};
if(LED == 8'h00)
LED <= 8'hff;
end
else
LED <= LED;

endmodule



关键词: haohaolinux 进程 帖之 流水

院士
2012-11-03 16:34:32 打赏
2楼
楼主,把所有的进程都放在一个帖子里面,请参考: http://forum.eepw.com.cn/thread/221214/1

再有,咱不能只贴这些代码吧?

高工
2012-11-03 20:25:52 打赏
3楼

把作业整理到一个进程里面吧,最好上传视频或者图像!


共3条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册]