[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
相关推荐
FPGA_ADDA1 天前
全国产复旦微FMQL100TAI 核心板
fpga开发·信号处理·全国产·fmql100tai·zynq7国产化
Terasic友晶科技1 天前
5-基于C5G 开发板的FPGA 串口通信设计 (FT232R, Altera UART IP和Nios II系统串口收发命令)
fpga开发·串口·uart·c5g
爱敲代码的loopy1 天前
verilog-正弦波生成器
fpga开发
尤老师FPGA1 天前
DDR4系列之ECC功能(六)
fpga开发·ddr4
Terasic友晶科技1 天前
3-基于FPGA开发板OSK/TSP/C5P的串口通信设计 (CP2102N)
fpga开发·串口·uart·tsp·c5p·osk
gouqu51561 天前
FPGA开发编译
fpga开发
GilgameshJSS1 天前
STM32H743-ARM例程43-SD_IAP_FPGA
arm开发·stm32·fpga开发
FPGA_小田老师1 天前
FPGA语法基础(三):Verilog 位选择语法详解
fpga开发·verilog语法·verilog位选择
坏孩子的诺亚方舟1 天前
FPGA系统架构设计实践5_IP的封装优化
fpga·vivado·rqs·工程质量
坏孩子的诺亚方舟1 天前
FPGA系统架构设计实践4_SelectIO
fpga·xilinx·selectio