[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
相关推荐
HIZYUAN15 小时前
FPGA/CPLD漫谈:2K LUT的功能定位与典型方案(一)
stm32·单片机·嵌入式硬件·fpga开发·国产mcu+fpga
FPGA_Linuxer16 小时前
FPGA开发板 KU5P开发板 图像处理,硬件加速 PCIE3.0 100G光口
fpga开发
szxinmai主板定制专家16 小时前
基于ZYNQ MPSOC多通道声音振动采集方案,替代NI9234和B&K
arm开发·人工智能·嵌入式硬件·fpga开发
ZYNQRFSOC2 天前
基于安路PH2A系列FPGA的JESD204B接口测试
嵌入式硬件·fpga开发
szxinmai主板定制专家2 天前
基于RK3588超小体积,轻巧,长续航的无人机AI模块,支持视频跟踪
arm开发·人工智能·嵌入式硬件·fpga开发·无人机
unicrom_深圳市由你创科技2 天前
多 FPGA 之间如何同步与通信?
fpga开发
LCMICRO-133108477462 天前
长芯微LCMDC7616完全P2P替代AD7616,16通道16位模数转换器(ADC)
stm32·嵌入式硬件·fpga开发·硬件工程·模数转换器adc·电力线监测
又菜又爱玩的东哥3 天前
【Verilog 3-8译码器设计与仿真:深入理解case语句与组合逻辑】
fpga开发
Risehuxyc3 天前
<= 是Verilog中的非阻塞赋值操作符
fpga开发
扣脑壳的FPGAer3 天前
傅里叶级数、傅里叶变换、Z变换、数字滤波器
fpga开发·信号处理