[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
相关推荐
ALINX技术博客2 小时前
【黑金云课堂】FPGA技术教程FPGA基础:流水灯实验
fpga开发·fpga
化屾为海6 小时前
FPGA制造与测试全流程
fpga开发·制造
Aaron15887 小时前
RFSOC+VU13P+RK3588的核心优势与应用场景分析
嵌入式硬件·算法·matlab·fpga开发·信息与通信·信号处理·基带工程
Aaron15889 小时前
8通道测向系统演示科研套件
人工智能·算法·fpga开发·硬件工程·信息与通信·信号处理·基带工程
数字芯片实验室13 小时前
当FPGA开始支持“自然语言编程“,芯片定制的门槛要变了
fpga开发
Kong_199415 小时前
芯片开发学习笔记·二十四——PCIe(PCI Express)
fpga开发·芯片开发
化屾为海16 小时前
FPGA CP测试
fpga开发
何如呢16 小时前
ROM查表法实现UW
fpga开发
碎碎思17 小时前
FPGA图像处理平台搭建:MIPI + VDMA + Ethernet全流程
图像处理·人工智能·fpga开发
希言自然也1 天前
赛灵思KU系列FPGA的EFUSE/BBRAM加密操作
fpga开发