[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
相关推荐
全栈开发圈4 小时前
干货分享|深度学习计算的FPGA优化思路
人工智能·深度学习·fpga开发
尤老师FPGA12 小时前
LVDS系列40:Xilinx Ultrascale系 ADC LVDS接口参考方法(二)
fpga开发
松涛和鸣13 小时前
60、嵌入式定时器深度解析:EPIT与GPT
c语言·arm开发·单片机·嵌入式硬件·gpt·fpga开发
天骄t14 小时前
ARM时钟初始化与GPT定时器深度解析
stm32·单片机·fpga开发
乌恩大侠16 小时前
【AI-RAN 调研】软银株式会社通过全新 Transformer AI 将 5G AI-RAN 吞吐量提升 30%
人工智能·深度学习·5g·fpga开发·transformer·usrp·mimo
Terasic友晶科技1 天前
DE25-Nano开发板在Programmer的 Auto Detect 下检测出来的器件和友晶官方提供的工程里器件不一样有没有关系?
fpga开发·auto detect·de25-nano·jtag id
ShiMetaPi2 天前
GM-3568JHF丨ARM+FPGA异构开发板应用开发教程:04 MIPI屏幕检测案例
arm开发·fpga开发·rk3568
最遥远的瞬间2 天前
四、呼吸灯实战
fpga开发
FPGA小c鸡2 天前
FPGA高速收发器GTH完全指南:从零基础到10Gbps高速设计实战
fpga开发
乌恩大侠2 天前
【AI-RAN 调研】软银株式会社的 “AITRAS” 基于 Arm 架构的 NVIDIA 平台 实现 集中式与分布式 AI-RAN 架构
人工智能·分布式·fpga开发·架构·usrp·mimo