[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
相关推荐
ChipCamp21 小时前
Chisel芯片开发入门系列 -- 14. CPU芯片开发和解释4(Load/Store指令再探)
arm开发·青少年编程·fpga开发·scala·dsp开发·risc-v·chisel
霖001 天前
深入讲讲异步FIFO
笔记·vscode·单片机·嵌入式硬件·学习·fpga开发
水果里面有苹果1 天前
3-verilog的使用-1
fpga开发
嵌入式-老费1 天前
再谈fpga开发(总结篇)
fpga开发
minglie11 天前
基于 AXI-Lite 实现可扩展的硬件函数 RPC 框架(附完整源码)
fpga开发
朱古力(音视频开发)1 天前
NDI开发指南
fpga开发·音视频·实时音视频·视频编解码·流媒体
9527华安2 天前
FPGA实现AD9361采集转SRIO与DSP交互,FPGA+DSP多核异构信号处理架构,提供2套工程源码和技术支持
fpga开发·架构·信号处理·dsp·ad9361·多核异构
小眼睛FPGA2 天前
【盘古100Pro+开发板实验例程】FPGA学习 | 基于紫光 FPGA 的键控 LED 流水灯
科技·学习·ai·fpga开发·fpga
最好有梦想~3 天前
分享一个FPGA寄存器接口自动化工具
fpga开发
hahaha60163 天前
FPGA(或者数字电路)中组合逻辑和时序逻辑是怎么划分的
fpga开发