[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 分钟前
Altium Designer 6.0 初学教程-如何生成一个集成库并且实现对库的管理
linux·服务器·前端·fpga开发·硬件架构·基带工程·pcb工艺
IC_Brother7 小时前
数字IC经典电路(6)—Ring Oscillator(环形振荡器)与工艺角监控
verilog·数字ic·dc综合
FPGA_无线通信16 小时前
xilinx FPGA 原语介绍
fpga开发
brave and determined17 小时前
可编程逻辑器件学习(day30):数字电路设计中的流水线技术:原理、实现与优化
学习·fpga开发·verilog·fpga·数字电路·硬件设计·嵌入式设计
步达硬件20 小时前
【FPGA】FPGA初学者开发板选择及学习路线
学习·fpga开发
贝塔实验室20 小时前
Altium Designer 6.0 初学教程-如何从原理图及PCB 中生成网表并且实现网表的加载
fpga开发·硬件架构·硬件工程·学习方法·射频工程·基带工程·pcb工艺
云空20 小时前
《从芯片到系统:解码FPGA如何重塑数字世界的硬件逻辑》
fpga开发
brave and determined1 天前
可编程逻辑器件学习(day29):Verilog HDL可综合代码设计规范与实践指南
深度学习·fpga开发·verilog·fpga·设计规范·硬件编程·嵌入式设计
碎碎思3 天前
不用 JTAG 也能刷 FPGA:TinyFPGA-Bootloader 让比特流加载更简单
fpga开发
贝塔实验室3 天前
Altium Designer 6.0 初学教程-在Altium Designer 中对PCB 进行板层设置及内电层进行分割
嵌入式硬件·fpga开发·编辑器·硬件工程·信息与通信·信号处理·pcb工艺