[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
相关推荐
乌恩大侠39 分钟前
从 USRP 到 NVIDIA Aerial:Colosseum 2.0 背后的无线通信科研范式革命
fpga开发
s090713615 小时前
Zynq AXI4 突发实战:跨 4 KiB 的连续传输怎样正确拆分?
fpga开发·dma·zynq·axi·硬件设计·突发传输
s090713616 小时前
FPGA FFT 频谱峰值错位排查:怎样把位反转输出映射回真实频点
fpga开发·数字信号处理·vivado·fft·axi4-stream
好家伙VCC19 小时前
XCZU47DR + AGX Orin GPU开发板 AMD Zynq + RFSoC ZU47DR FPGA异构AI射频开发板
fpga开发
unicrom_深圳市由你创科技20 小时前
测控方案选型:FPGA、嵌入式、上位机,该怎么选?
fpga开发
ALINX技术博客1 天前
16路GMSL摄像头显示:从 FPGA 采集到 Linux 显示的完整实现
fpga开发
SYHC_CSDN2 天前
FPGA研发,HDL缺陷前置检测方案
fpga开发
凯云-金山HIL2 天前
从 Simulink 模型到实时仿真:HIL 系统搭建的 5 个关键点
fpga开发·航空航天·#simurts·#hil·#etest·#实时仿真
SYHC_CSDN2 天前
HDLHorse:自动生成测试用例,全自动完成数字仿真与报告输出
fpga开发
ALINX技术博客3 天前
FPGA ADC 采集 + PCIe DMA 传输 + 上位机实时波形显示实战【黑金云课堂】
fpga开发·fpga