FPGA之流水灯
2015-10-29 22:06
351 查看
module move_led ( clk, rst, led ); input clk; input rst; output [5:0]led; reg [23:0]count; always @(posedge clk or negedge rst) begin if(!rst) count <= 24'd0; else if(count == 24'hffffff) count <= 24'd0; else count <= count + 1'd1; end reg [5:0]led_r; always @(posedge clk or negedge rst) begin if(!rst) led_r <= 6'b111_110; else if (count == 24'hfffffe) led_r <= {led_r[4:0],led_r[5]}; else led_r <= led_r; end assign led = led_r; endmodule
相关文章推荐
- PuTTY使用
- cmd取UTF-8编码的数据显示乱码
- 52. PHP 伪静态
- iOS开发网络篇—HTTP协议
- CAlayer的使用
- 我所认识的BIM&Revit
- TOj 3070. Encryption【水题】
- 驱动开发学习资料
- POJ 2752 Seek the Name, Seek the Fame
- Swing创建带图标的右键弹出菜单
- 深入理解C语言的函数调用过程
- 排序算法 之 快速排序
- 在jQuery与Node之间创建跨域请求(Cross-Origin Resource Sharing (CORS) )
- poj 2349 Arctic Network 最小生成树第k大边-kruskal
- Java中常用字符串方法总结
- 1058. A+B in Hogwarts
- CUDA之内存
- hdoj1042(N!,大数乘)
- myeclipse的jre与安装的jre不同之处
- 保龄球计分算法