[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
相关推荐
雨洛lhw1 小时前
基于 FPGA 的主机 IP 自动配置方案设计
udp·mac·ip·fpga·dhcp
Flamingˢ1 小时前
基于ARM的裸机程序设计和开发(一):Zynq SoC FPGA的诞生
arm开发·fpga开发
迎风打盹儿1 小时前
FPGA实现AGC自动增益控制:原理详解与Verilog实战
fpga·vivado·verilog hdl·agc·数字自动增益控制
CWNULT2 小时前
SystemVerilog——always_xx过程块使用方法
fpga开发
ZPC821013 天前
docker 镜像备份
人工智能·算法·fpga开发·机器人
ZPC821013 天前
docker 使用GUI ROS2
人工智能·算法·fpga开发·机器人
tiantianuser13 天前
RDMA设计53:构建RoCE v2 高速数据传输系统板级测试平台2
fpga开发·rdma·高速传输·cmac·roce v2
博览鸿蒙13 天前
FPGA 和 IC,哪个前景更好?怎么选?
fpga开发
FPGA_小田老师13 天前
xilinx原语:ISERDESE2原语详解(串并转换器)
fpga开发·iserdese2·原语·串并转换
tiantianuser14 天前
RDMA设计50: 如何验证网络嗅探功能?
网络·fpga开发·rdma·高速传输·cmac·roce v2