[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
相关推荐
FPGA小徐7 分钟前
FPGA开发中的常用通信协议与通信接口区别与联系
fpga开发
Szime2 小时前
深智微40Gsps高速数据采集系统进入工程化阶段
科技·单片机·嵌入式硬件·fpga开发
2601_9618454219 小时前
2027考研数学大纲|数一数二数三
考研·fpga开发·ar·vr·mr·oneflow
X_xcccc1 天前
2026年嵌入式智能核心,从异构计算到敏捷开发的硬核指南
fpga开发·敏捷流程·zynq-7000·fpga板卡定制
9527华安1 天前
FPGA实现GTX Transceivers Wizard传输2路视频,基于aurora 8b10b编解码架构,提供4套工程源码和技术支持
fpga开发·aurora·gtx·高速接口·高速收发器·transceivers
泛联新安1 天前
VHawk-CDC:国内首款自主可控跨时钟域分析验证工具,破解FPGA设计CDC验证难题
fpga·跨时钟域·验证工具
ALINX技术博客1 天前
【黑金云课堂】FPGA技术教程Linux开发:摄像头GPU渲染显示/Qt OpenGLES使用
linux·qt·fpga开发·gpu
S&Z34631 天前
SZ901下载器烧写国产Flash指南
fpga开发
liuluyang5301 天前
Verilog-1995风格,reg变量声明两次
fpga开发
cjie2211 天前
安路好用的调试工具VPI
fpga开发