[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
相关推荐
9527华安8 小时前
紫光同创FPGA实现AD7606数据采集转UDP网络传输,提供PDS工程源码和技术支持和QT上位机
网络·qt·fpga开发·udp·紫光同创·ad7606
szxinmai主板定制专家8 小时前
基于TI AM6442+FPGA解决方案,支持6网口,4路CAN,8个串口
arm开发·人工智能·fpga开发
7yewh9 小时前
FPGA前瞻篇-计数器设计与实现实例
arm开发·驱动开发·嵌入式硬件·fpga开发·硬件架构·硬件工程·精益工程
爱学习的张哥10 小时前
UDP--DDR--SFP,FPGA实现之指令监测模块实现
fpga开发·udp·指令
碎碎思13 小时前
FPGA+ESP32 = GameBoy 是你的童年吗?
fpga开发
搬砖的小码农_Sky14 小时前
FPGA:XILINX FPGA产品线以及器件选型建议
嵌入式硬件·fpga开发·硬件架构·硬件工程
YprgDay14 小时前
【Lattice FPGA 开发】Diamond在线调试Reveal逻辑乱跳的解决
fpga开发·diamond·reveal
MVP-curry-萌神14 小时前
FPGA图像处理(六)------ 图像腐蚀and图像膨胀
图像处理·人工智能·fpga开发
&Cheems16 小时前
ZYNQ笔记(二十):Clocking Wizard 动态配置
笔记·fpga开发
怪小庄吖16 小时前
7系列 之 I/O标准和终端技术
经验分享·笔记·fpga开发·硬件架构·硬件工程·xilinx 7系列 fpga·i/o标准和终端技术