[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
相关推荐
花月mmc18 小时前
FPGA数字信号处理与深度学习
嵌入式硬件·深度学习·fpga开发·信号处理
FPGA小徐19 小时前
FPGA离散数列信源熵:原理、计算与硬件实现全解
fpga
幻智星科技19 小时前
UDP桥接IP产品简介
tcp/ip·fpga开发·udp·硬件架构
女神下凡19 小时前
芯参谋(76):电源监控复位芯片电路设计指南
arm开发·单片机·嵌入式硬件·fpga开发·设计规范
国科安芯19 小时前
LEO卫星里的IO脉冲事件通信,毛刺误触发解析及处理方案
单片机·嵌入式硬件·fpga开发·低轨卫星·商业航天·抗辐射
Riwuarua1 天前
从近似0基础开始FPGA开发——Part.25:GT 高速收发器架构与 KU5P 资源规划
fpga开发·架构
星夜离尘561 天前
FPGA 三点中值滤波:不补零、不丢背压样本的流式实现
fpga开发
t_niu_niu1 天前
bilateral_filter_paper
图像处理·verilog·双边滤波器
hexiaoyan8272 天前
互联卡设计方案:504-PCIE X16 金手指 FPGA Aurora协议互联卡
fpga开发·测试载板·互联卡·fpga aurora协议·夹板连接器·板卡互联
星夜离尘562 天前
FPGA 二进制数如何变成十进制显示:可背压的逐位 BCD 转换器
fpga开发