[HDLBits] Countslow

Build a decade counter that counts from 0 through 9, inclusive, with a period of 10. The reset input is synchronous, and should reset the counter to 0. We want to be able to pause the counter rather than always incrementing every clock cycle, so the slowena input indicates when the counter should increment.

复制代码
module top_module (
    input clk,
    input slowena,
    input reset,
    output [3:0] q);
	always@(posedge clk) begin
        if(reset||(slowena&&q>=9))
            q<=4'b0;
        else if(q<9&&slowena)
            q<=q+1;
        else;
    end
endmodule
相关推荐
海涛高软7 小时前
verlog中阻塞赋值和非阻塞赋值
fpga开发
tiantianuser9 小时前
RDMA设计29:RoCE v2 发送及接收模块设计2
服务器·fpga开发·rdma·fpga设计·高速传输
9527华安10 小时前
FPGA实现GTP光口视频转USB3.0 UVC,基于Aurora8B10B+FT602芯片架构,提供4套工程源码和技术支持
fpga开发·gtp·usb3.0·uvc·aurora8b10b·ft602
zy1353806757311 小时前
12V输入5V/2A输出升降压芯片AH4002
科技·单片机·物联网·fpga开发·硬件工程·智能电视
dadaobusi12 小时前
verilog的generate
fpga开发
从此不归路13 小时前
FPGA 结构与 CAD 设计(第2章)
ide·fpga开发
FPGA_小田老师13 小时前
FPGA例程(5):时钟(clock)分频倍频(PLL/MMCM)实验--vivado行为级仿真、综合后仿真和实现后仿真说明
fpga开发·pll·mmcm·run simulation·前仿真·后仿真
3有青年13 小时前
HPS cold reset pin和AVST configuration的功能和作用
fpga开发
3有青年1 天前
Altera FPGA操作系统支持的情况分析
fpga开发
国科安芯1 天前
卫星通讯导航FPGA供电单元DCDC芯片ASP4644S2B可靠性分析
单片机·嵌入式硬件·fpga开发·架构·安全性测试