[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
相关推荐
Terasic友晶科技1 小时前
【教程】Agilex 5 SOC FPGA的HPS端如何响应FPGA端中断(三)——设备树Overlay
fpga开发·设备树·agilex 5·设备树overlay
ARM|X86+FPGA工业主板厂家2 小时前
基于嵌入式 GPU 的智能服务机器人
linux·运维·arm开发·fpga开发·机器人
Freak嵌入式3 小时前
Pico PIO 汇编语法深度详解:标识符、指令、伪指令全解析
汇编·stm32·单片机·嵌入式硬件·fpga开发·硬件架构
Riwuarua5 小时前
从近似0基础开始FPGA开发 -- part.7 FPGA的网络通信设计
fpga开发
pingping_TEL8 小时前
JESD204B_IP核使用教程
fpga开发
cmc10281 天前
292.三段式状态机第三段时序逻辑用state_c与_n的差异分析
fpga开发
qq_150841991 天前
用verilog语言在Quartus Prime Lite 18中对CPLD EPM570T100C5进行编程
verilog·quartus·cpld
智塑未来3 天前
FPGA开发板怎么选?先看资质、案例与研发底盘
fpga开发
minglie13 天前
黑金AX301的SDRAM
fpga开发
hahaha60163 天前
HLS高层次综合设计技巧--高层次综合设计探讨
fpga开发