多彩编程 多彩编程MZPH · CODE BLOG
ARTICLE DETAIL

文章详情

深耕前端与后端开发技术的一线实战笔记与踩坑复盘。

verilog HDLBits刷题[Building Larger Circuits]“Exams/review2015 count1k”---Counter with period 1000

verilog HDLBits刷题[Building Larger Circuits]“Exams/review2015 count1k”---Counter with period 1000 1、题目Build a counter that counts from 0 to 999, inclusive, with a period of 1000 cycles. The reset input is synchronous, and should reset the counter to 0.2、代码module top_module ( input clk, input reset, output [9:0] q); reg [9:0]cnt; always(posedge clk)begin if(reset) cnt10d0; else if(cnt999) cnt10d0; else cntcnt1; end assign qcnt; endmodule
返回列表