[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
相关推荐
科恒盛远15 小时前
KH919-基于FPGA实现的线性调频卡
fpga开发
FPGA小c鸡2 天前
PCIe接口详解:从协议原理到FPGA实现的完整指南
fpga开发
良许Linux2 天前
FPGA原理和应用
stm32·单片机·fpga开发·程序员·嵌入式·编程
Hello.Reader2 天前
Flink External Resource Framework让作业“原生”申请 GPU/FPGA 等外部资源
大数据·fpga开发·flink
嵌入式-老费2 天前
Linux Camera驱动开发(fpga vs soc)
驱动开发·fpga开发
太空1号3 天前
SystemVerilog小白入门3,UVM的uvm_object初体验
fpga开发
FakeOccupational3 天前
【电路笔记 元器件】存储设备:RAM 静态随机存取存储器(SRAM)芯片+异步 SRAM 的特性+异步 SRAM读写测试(HDL)
笔记·fpga开发
嵌入式×边缘AI:打怪升级日志3 天前
环境监测传感器从设备程序设计(ADC采集与输出控制)
单片机·嵌入式硬件·fpga开发
dadaobusi3 天前
verilog,generate语句
fpga开发
码不停蹄Zzz3 天前
GTX DRP动态重配置技术
fpga开发