[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
相关推荐
明德扬1 天前
Quartus Prime Pro 26.1 更新了什么?Arria 10 FPGA 工程升级与迁移注意事项
fpga开发
9527华安1 天前
Xilinx Zynq7000系列FPGA纯verilog图像缩放,串口上位机动态调整缩放分辨率,提供4套工程源码和技术支持
fpga开发·图像缩放·zynq7000
Riwuarua1 天前
从近似0基础开始FPGA开发 -- part.3 ila与debug
fpga开发
pingping_TEL2 天前
FIFO_IP核使用说明文档
fpga
松小白song2 天前
FPGA架构解密:为何要用750kHz低频时钟驱动二级缓存?
fpga开发
Riwuarua2 天前
从近似0基础开始FPGA开发 -- part.2 仿真
fpga开发
unicrom_深圳市由你创科技2 天前
国产FPGA的芯片选型应该考虑哪些因素?
fpga开发
明德扬2 天前
高速采集选 Direct RF 还是外置 ADC/FMC?从采样率、JESD204B 和开发周期对比
fpga开发·fpga
明德扬2 天前
机器人为什么需要“感知—控制—计算”一体化?FPGA 多传感器底板设计要点
fpga开发·机器人·fpga
zlinear数据采集卡2 天前
数据采集卡从入门到精通(46):趋势展望——软件定义硬件、AI分析与开源生态
arm开发·stm32·单片机·嵌入式硬件·fpga开发·开源