[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
相关推荐
szxinmai主板定制专家7 小时前
基于 PC 的控制技术+ethercat+linux实时系统,助力追踪标签规模化生产,支持国产化
arm开发·人工智能·嵌入式硬件·yolo·fpga开发
坏孩子的诺亚方舟14 小时前
modelsim基础2_modelsim仿真分析
fpga·modelsim·仿真分析
tiger11915 小时前
FPGA 在大模型推理中的应用
人工智能·llm·fpga·大模型推理
博览鸿蒙18 小时前
如何为春招的金三银四做好准备
fpga开发
FPGA小迷弟19 小时前
FPGA处理图像需要用到的主流接口详解
学习·fpga开发·verilog·fpga·modelsim
LeoZY_20 小时前
CH347 USB转JTAG功能使用笔记:CH347根据SVF文件实现任意FPGA下载
笔记·stm32·嵌入式硬件·fpga开发·硬件架构·硬件工程
博览鸿蒙20 小时前
FPGA在高性能计算中的应用:数据流加速与优化
fpga开发
maverick_11120 小时前
【数字图像处理与FPGA实现】00 绪,建立“算法思维“与“硬件思维“的桥梁
图像处理·fpga开发
乌恩大侠2 天前
【OAI】 USRP 在conf文件中的配置,RU选项
fpga开发
qq_小单车3 天前
xilinx-DNA
fpga开发·xilinx