[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
相关推荐
Terasic友晶科技4 小时前
答疑解惑 | DE25-Nano开发板串口在访问FPGA端外设LED时卡死,无任何反应
fpga开发·串口·led·de25-nano
尤老师FPGA8 小时前
LVDS系列46:Xilinx Ultrascale系 ADC LVDS接口参考方法(八)
fpga开发
何如呢13 小时前
uw_inserter
fpga开发
何如呢14 小时前
SC-FDE_tx_comb_part
fpga开发
LCMICRO-1331084774615 小时前
长芯微LCMDC8588完全P2P替代ADS8588,是一款16位、8通道同步采样的逐次逼近型(SAR)模数转换器
stm32·单片机·嵌入式硬件·fpga开发·硬件工程·模数转换器
云端码字人18 小时前
007、PCIE数据链路层:可靠传输的保障
fpga开发
nuoxin1141 天前
CH6001FN/BW-富利威
网络·人工智能·嵌入式硬件·fpga开发·dsp开发
LCMICRO-133108477462 天前
长芯微LCMDC8685完全P2P替代ADS8685,16位模数转换器(ADC)
单片机·嵌入式硬件·fpga开发·硬件工程·dsp开发·模数转换器adc
szxinmai主板定制专家2 天前
基于ARM+FPGA高性能MPSOC 多轴伺服设计方案
arm开发·人工智能·嵌入式硬件·fpga开发·架构
nuoxin1142 天前
CYUSB4024-FCAXI 是一款USB 20Gbps 控制器-富利威
网络·人工智能·嵌入式硬件·fpga开发·dsp开发