[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
相关推荐
嵌入式软硬件攻城狮7 小时前
9.读写DDR测试
fpga开发
幻智星科技12 小时前
多通道数据采集DMA设计详解
fpga开发·udp·硬件架构
泡泡糖的中文规格书17 小时前
HDLbits 1.4 学习笔记
fpga开发
智感子1 天前
FPGA触发采集:预触发、多通道同步与软硬件分工怎么落地
fpga开发
156082072192 天前
关于AGC性能测试
fpga开发
威嵌神州3 天前
国产化加固计算机项目选型笔记|板卡、整机、平板与定制模块评估要点
笔记·fpga开发·电脑
泡泡糖的中文规格书3 天前
HDLbits 1.2 学习笔记
fpga开发·学习笔记·verilog
樱木花道長3 天前
AMD Ross 深度系列 5:实战演示 —— MATLAB 到 FPGA,edge-detection 边缘检测全流程
fpga开发
吉他英雄一里4 天前
FPGA--RAM
fpga开发
szxinmai主板定制专家4 天前
储能 EMS、微网控制器选型:RK3588、RK3576、RK3568+FPGA 怎么选?多网、多 CAN、EMC 设计权衡
人工智能·深度学习·机器学习·fpga开发·工业网关·rk3576·电力网关