[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
相关推荐
凡亿卓达方案设计3 小时前
FPGA硬件开发怎么选靠谱方案商?
fpga开发
Eloudy6 小时前
QSFP28、RoCEv2、RFSoC-4x2 数据传输与器件链路
网络·fpga开发·rocev2
Echo_cy_7 小时前
基于ZYNQ-7000的Ethernet驱动配置
linux·驱动开发·嵌入式硬件·fpga开发·ethernet·zynq
現実君10 小时前
关于MCU下位替换FPGA的经验与方案
单片机·嵌入式硬件·fpga开发
Terasic友晶科技12 小时前
【教程】Agilex 5 SoC 的两种启动模式的开发演示(一)(FPGA Configuration First)
fpga开发·agilex 5 soc
ALINX技术博客12 小时前
【黑金云课堂】FPGA技术教程Vitis开发:SD卡WAV文件读取音频播放实验
fpga开发·音视频
神电测控1 天前
新品发布:国产新型三合一多功能PG-ZYNQ7100 sbRIO板卡(PCIe+USB3.0+Ethernet+FMC+4个40pin扩展口)
fpga·zynq·crio·神电测控·王电令·sbrio·linuxrt
ALINX技术博客2 天前
ALINX 亮相 2026 WAIC 世界人工智能大会,展示 AI 视觉 FPGA+GPU 异构计算与电子后视镜解决方案
人工智能·ai·fpga·世界人工智能大会·电子后视镜
仲南音2 天前
Xilinx FPGA——时钟IP核MMCM、PLL
fpga开发
I'm a winner3 天前
基于Xilinx FPGA的LVDS高速串行通信系统(三)--数据训练及握手机制【文末源码】
fpga开发