[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
相关推荐
s09071368 小时前
【Agent】Claude code辅助verilog编程
fpga开发
3有青年9 小时前
altera fpga agilex 5 连接到HVIO BANK上的参考时钟,是否可以作为HSIO BANK内部IOPLL的输入时钟
fpga开发
FPGA_ADDA10 小时前
基于ZU47DR 的高性能射频卡
fpga开发
ooo-p11 小时前
FPGA学习篇——Verilog学习之“流水灯”
学习·fpga开发
坏孩子的诺亚方舟11 小时前
FPGA系统架构设计实践14_OTA升级
fpga·加载
FPGA小c鸡12 小时前
【FPGA视频处理】帧缓冲设计完全指南:从单缓冲到三缓冲的深度解析与实战应用
fpga开发·音视频
hexiaoyan82715 小时前
【无标题】高速信号处理设计原理图:413-基于双XCVU9P+C6678的100G光纤加速卡
fpga开发·高速信号处理·光纤加速·xcvu9p芯片·硬件加速卡
search716 小时前
数字电子技术基础
fpga开发
ooo-p16 小时前
FPGA学习篇——Verilog学习之“触摸按键控制LED灯”
学习·fpga开发
全栈开发圈1 天前
干货分享|深度学习计算的FPGA优化思路
人工智能·深度学习·fpga开发