[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
相关推荐
jiushun_suanli8 小时前
FPGA(现场可编程门阵列)详解
经验分享·学习·fpga开发
Terasic友晶科技11 小时前
1-串行通信基础知识
fpga开发·串口通信·异步通信·串行通信·同步通信·并行通信·单工
FPGA_小田老师13 小时前
Xilinx Aurora 8B/10B IP核(2):Shared Logic的选择
fpga开发·aurora 8b/10b·share logic·aurora接口
嵌入式软硬件攻城狮16 小时前
4.FPGA字符格式
fpga开发
Terasic友晶科技16 小时前
2-基于FPGA开发板DE23-Lite的串口通信设计 (FT2232H)
fpga开发·串口·uart·de23-lite
第二层皮-合肥18 小时前
FPGA工程师12实战项目-基于PCIe的高速ADC采集项目
fpga开发
第二层皮-合肥1 天前
USB3.0PHY介绍
fpga开发
czhaii1 天前
51的DSP来了, 100MHz, STC32G144K246
stm32·单片机·fpga开发
FPGA_ADDA2 天前
全国产复旦微FMQL100TAI 核心板
fpga开发·信号处理·全国产·fmql100tai·zynq7国产化
Terasic友晶科技2 天前
5-基于C5G 开发板的FPGA 串口通信设计 (FT232R, Altera UART IP和Nios II系统串口收发命令)
fpga开发·串口·uart·c5g