[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
相关推荐
xgbing3 小时前
在ubuntu中安装modelsim
fpga开发·modelsim
碎碎思8 小时前
SURF:SLAC 开源 FPGA 与 ASIC 通用 RTL 框架详解
fpga开发
FPGA小迷弟10 小时前
FPGA在工业控制行业的应用,行业研究文章
fpga开发·制造·数据采集·fpga·工业控制
洋洋Young11 小时前
【Xilinx FPGA】CLB SliceL 与 SliceM
fpga开发·xilinx·clb
集芯微电科技有限公司11 小时前
PC1001超高频率(50HMZ)单通单低侧GaN FET驱动器支持正负相位配置
数据结构·人工智能·单片机·嵌入式硬件·神经网络·生成对抗网络·fpga开发
stars-he13 小时前
FPGA学习笔记(8)以太网UDP数据报文发送电路设计(二)
网络·笔记·学习·fpga开发
FPGA_小田老师14 小时前
FPGA例程(3):按键检测实验
fpga开发·verilog·vivado·led灯·按键测试
博览鸿蒙15 小时前
想考研到电子类,未来从事 FPGA/IC方向,目前该怎么准备?
考研·fpga开发
m0_5557629015 小时前
FPGA + AD7768-4 实现数据采集的可能方案
fpga开发
whik119415 小时前
Xilinx ZYNQ-7000系列FPGA选型指南
fpga·xilinx·zynq·选型·高速接口·资源