[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
相关推荐
Shang1809893572621 小时前
T41NQ/T41N高性能低功耗SOC芯片 软硬件资料T41NQ适用于各种AIoT应用,适用于智能安防、智能家居,机器视觉等领域方案
驱动开发·嵌入式硬件·计算机视觉·fpga开发·信息与通信·t41nq
Punchline_c1 天前
单端口RAM IP核
fpga
ThreeYear_s1 天前
【FPGA+DSP系列】——MATLAB simulink仿真三相桥式全控整流电路
开发语言·matlab·fpga开发
Punchline_c1 天前
IP核之PLL
fpga开发
奋斗的牛马1 天前
硬件工程师-基础知识电阻(四)
单片机·嵌入式硬件·学习·fpga开发
amberman1 天前
解读 PCIe Gen6 RAS
驱动开发·fpga开发·硬件工程
9527华安2 天前
FPGA纯verilog实现 2.5G UDP协议栈,基于1G/2.5G Ethernet PCS/PMA or SGMII,提供14套工程源码和技术支持
5g·fpga开发·udp·ethernet·verilog·sgmii·2.5g udp
奋斗的牛马2 天前
硬件基础知识-电容(一)
单片机·嵌入式硬件·学习·fpga开发·信息与通信
li星野2 天前
打工人日报#20251110
fpga开发
0基础学习者3 天前
跨时钟域处理
fpga开发·verilog·数字ic