[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
相关推荐
ooo-p5 小时前
FPGA学习篇——Verilog学习之“呼吸灯”
学习·fpga开发
雨洛lhw9 小时前
STFT性能测试记录笔记(verilog )
fpga开发
runningshark11 小时前
【FPGA】频率计(等精度测量法)
fpga开发
坏孩子的诺亚方舟12 小时前
FPGA设计基于团队的最佳实践0
fpga开发·团队设计
FPGA_小田老师13 小时前
FPGA例程(7):UART串口接收程序--状态机的编写
fpga开发·uart·状态机·串口接收·uart_rx·串口程序·115200bps
FPGA小c鸡14 小时前
FPGA做AI:从入门到实战 | 边缘智能时代的硬件加速秘密
人工智能·fpga开发
思尔芯S2C14 小时前
思尔芯、MachineWare与Andes晶心科技联合推出RISC-V协同仿真方案,加速芯片开发
人工智能·科技·fpga开发·risc-v·prototyping
松涛和鸣17 小时前
63、IMX6ULL ADC驱动开发
c语言·arm开发·驱动开发·单片机·gpt·fpga开发
扣脑壳的FPGAer18 小时前
Xilinx Dual Quad Flash SPI加载方式下的文件处理
fpga开发
ShiMetaPi20 小时前
GM-3568JHF丨ARM+FPGA异构开发板应用开发教程:07 FPGA FSPI 通信案例
arm开发·fpga开发·rk3568