[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技术博客4 小时前
AMD MoP 封装策略解读 | HBM 大热,为何 AMD Versal 系列反选 LPDDR5X?
fpga开发·fpga·amd·versal
zlinear数据采集卡7 小时前
从万用表的6步调零到硅片级微秒自校准:硬核拆解LHAMP188的宽压轨到轨与零漂移实战
arm开发·stm32·单片机·嵌入式硬件·fpga开发
Rambo.xia7 小时前
AXI-Stream反压与背靠背传输——TREADY反压丢帧、TDEST路由错误、反压死锁,流式数据一反压就出事
fpga开发
repokey-Yao7 小时前
AI 如何看懂 FPGA 大工程?RepoKey Starter 使用记录
人工智能·chatgpt·fpga
国科安芯9 小时前
ASC8T245S 8通道电平转换设计实战:从系统架构到QFN24 Layout再到量产测试
网络·单片机·物联网·安全·fpga开发·系统架构
传感器与混合集成电路1 天前
基于FPGA与ADC协同架构的高密度数据采集模块设计原理与应用场景分析
fpga开发·架构
Rambo.xia1 天前
10Gbps实时图像重采样:一个FPGA项目的完整交付复盘
fpga开发
zlinear数据采集卡1 天前
2mV纹波的代价:硬核拆解ZLinear模拟前端放大器与正负可调电源设计
arm开发·单片机·嵌入式硬件·fpga开发·架构·开源
小麦嵌入式1 天前
FPGA入门(八):一篇讲透跑马灯、闪烁灯、呼吸灯的原理与模拟波形分析
fpga开发
Rambo.xia1 天前
AXI4-Full突发传输掉数据——突发长度算错、WRAP边界、窄传输字节错位,调试一周才发现是协议理解错了
fpga开发