[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
相关推荐
bnsarocket3 小时前
Verilog和FPGA的自学笔记6——计数器(D触发器同步+异步方案)
笔记·fpga开发·verilog·自学·硬件编程
博览鸿蒙3 小时前
FPGA职位经典笔/面试题(附答案与解析)
fpga开发
li星野4 小时前
打工人日报#20251011
笔记·程序人生·fpga开发·学习方法
尤老师FPGA4 小时前
LVDS系列31:Xilinx 7系 ADC LVDS接口参考设计(二)
fpga开发
ARM+FPGA+AI工业主板定制专家5 小时前
基于Jetson+GMSL AI相机的工业高动态视觉感知方案
人工智能·机器学习·fpga开发·自动驾驶
易享电子12 小时前
基于单片机大棚浇水灌溉控制系统Proteus仿真(含全部资料)
单片机·嵌入式硬件·fpga开发·51单片机·proteus
cmc102814 小时前
127.XIlinx fpga端的pcie(XDMA)与驱动是如何交换数据的
笔记·fpga开发
荆白雪1 天前
触摸按键控制LED
fpga开发
sz66cm1 天前
FPGA基础 -- cocotb仿真之任务调度cocotb.start_soon与asyncio的使用注意事项
fpga开发
霖001 天前
ZYNQ裸机开发指南笔记
人工智能·经验分享·笔记·matlab·fpga开发·信号处理