惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Martin Fowler
Martin Fowler
Schneier on Security
Schneier on Security
S
Schneier on Security
A
Arctic Wolf
L
LangChain Blog
T
Threatpost
GbyAI
GbyAI
V2EX - 技术
V2EX - 技术
Jina AI
Jina AI
U
Unit 42
P
Proofpoint News Feed
M
MIT News - Artificial intelligence
G
GRAHAM CLULEY
T
The Exploit Database - CXSecurity.com
Spread Privacy
Spread Privacy
F
Fortinet All Blogs
Y
Y Combinator Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cybersecurity and Infrastructure Security Agency CISA
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
月光博客
月光博客
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
F
Full Disclosure
博客园 - 【当耐特】
S
Secure Thoughts
美团技术团队
N
News | PayPal Newsroom
爱范儿
爱范儿
Latest news
Latest news
Microsoft Azure Blog
Microsoft Azure Blog
I
InfoQ
S
Security @ Cisco Blogs
V
V2EX
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
腾讯CDC
The Hacker News
The Hacker News
V
Vulnerabilities – Threatpost
Cyberwarzone
Cyberwarzone
Google Online Security Blog
Google Online Security Blog
N
Netflix TechBlog - Medium
I
Intezer
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
The Last Watchdog
The Last Watchdog
N
News and Events Feed by Topic
T
Tor Project blog
博客园 - 三生石上(FineUI控件)
Security Archives - TechRepublic
Security Archives - TechRepublic
大猫的无限游戏
大猫的无限游戏
Security Latest
Security Latest

博客园 - 所长

频谱仪 N9020A 操作步骤记录 FPGA-CAN MAC 层 IP 核测试(二) 源码阅读 libero reg 编译时 占用 RAM 资源 而不是 LUT 资源 加扰和解扰 FPGA-CAN MAC 层 IP 核测试(一) 上板实测 Microchip SoftConsole v2022.2-RISC-V-747 polarfire soc 裸机例程中 链接文件 mpfs-envm-lma-scratchpad-vma.ld 分析 FlashPro5 导致 window11 蓝屏 libero verilog 模块例化时,信号不存在 默认是 不连接 A3P250 在线 debug 抓取信号 Identify 在线逻辑分析仪 MPFS250T MSS 引脚 上下拉配置 如何在 libero 中 写一个 axi4 slave 总线的 IP核 可以 和 CoreAXI4Interconnect 连接 (五) 官方参考 如何在 libero 中 写一个 axi4 slave 总线的 IP核 可以 和 CoreAXI4Interconnect 连接 (四) axi-lite 信号抓取 libero Active Probes 如何在 libero 中 写一个 axi4 slave 总线的 IP核 可以 和 CoreAXI4Interconnect 连接 (三) C代码测试 访问卡死 如何在 libero 中 写一个 axi4 slave 总线的 IP核 可以 和 CoreAXI4Interconnect 连接 (二) axi-lite 如何在 libero 中 写一个 axi4 slave 总线的 IP核 可以 和 CoreAXI4Interconnect 连接(一)libero 设置把模块信号变总线方式 libero 2025.2 Macro Library User Guide for SmartFusion 2 and IGLOO 2 FPGAs 如何在 libero 中 写一个 axi4 slave 总线的 IP核 可以 和 CoreAXI4Interconnect 连接 (零) MSS CFG MPFS250T FLASH 只有 128KB 调整代码优化 AD9361 SPI no-os 文件移植 SoftConsole MPFS250T 初学(七) 初始化日志记录 AD9361 SPI no-os 文件移植 SoftConsole MPFS250T 初学(六) 开启 日志打印 Calibration TIMEOUT (0x247, 0x2) AD9361 SPI no-os 文件移植 SoftConsole MPFS250T 初学(五) ad9361_check_cal_done 卡死 AD9361 SPI no-os 文件移植 SoftConsole MPFS250T 初学(四) ad9361_init 编译报错 和 读取 AD9361 ID AD9361 SPI no-os 文件移植 SoftConsole MPFS250T 初学(三) 接口适配到自己的板子 AD9361 SPI no-os 文件移植 SoftConsole MPFS250T 初学(二) AD9361 初始化流程 熟悉 AD9361 SPI no-os 文件移植 SoftConsole MPFS250T 初学(一) 驱动代码移植 RS422 差分 逻辑分析仪 抓包 libero Simulate - ModelSim ME 仿真 串口数据处理模块 vivado axi PS-PL 封装IP 创造自定义 外设 libero Simulate - ModelSim ME (三) 实战测试 双端口 RAM 读写 libero Simulate - ModelSim ME (二) 语法分析 libero Simulate - ModelSim ME (一) 新建工程 libero smartdebug Libero SoC CMP402 PolarFire SOC MSS 时钟源选择 polarfire Temperature and Voltage Sensor 温度和电压传感器 log2 PolarFire SoC Clock Conditioning Circuitry - CCC (PLL/DLL) 时钟源介绍(二) PolarFire SoC Clock Conditioning Circuitry - CCC (PLL/DLL) 初始化(三) PolarFire SoC Clock Conditioning Circuitry - CCC (PLL/DLL) 简单介绍(一) libero export flashpro express Job Libero MPFS250T PFSoC MSS Configurator 2025.2 DDR3 ECC 配置 Libero MPFS250T 如何使用 FPExpress 2025.2 烧录 MPFS250TS Direct C 编程后,使用 JTAG 读取的 DEVICE_INFO LOG Xilinx SDK 2019.1 使用 JTAG 将 10MB 文件 复制到 ZYNQ 的 DDR中 大约 20 秒 libero PolarFire soc SPI-DirectC 实战 dp_G5M_check_cycle_count libero PolarFire soc SPI-DirectC 实战 dp_G5M_do_program libero PolarFire soc SPI-DirectC 实战 dp_G5M_erase_action libero PolarFire soc SPI-DirectC 实战 dp_G5M_verify_digest_action
verilog 按键消抖模块
所长 · 2026-05-11 · via 博客园 - 所长

// Debounce.v
module DEBOUNCE
(
input CLK, RESET_N, SWITCH, // inputs
output reg INTERRUPT // output
);
//// ---------------- internal constants --------------
parameter N = 12 ;
////---------------- internal variables ---------------
reg [N-1 : 0] q_reg; // timing regs
reg [N-1 : 0] q_next;
reg DFF1, DFF2; // input flip-flops
wire q_add; // control flags
wire q_reset;
//// ------------------------------------------------------

////contenious assignment for counter control
assign q_reset = (DFF1 ^ DFF2); // xor input flip flops to look for level chage to reset counter
assign q_add = ~(q_reg[N-1]); // add to counter when q_reg msb is equal to 0

//// combo counter to manage q_next
always @ ( q_reset, q_add, q_reg)
begin
case( {q_reset , q_add})
2'b00 :
q_next <= q_reg;
2'b01 :
q_next <= q_reg + 1;
default :
q_next <= { N {1'b0} };
endcase
end

//// Flip flop inputs and q_reg update
always @ ( posedge CLK )
begin
if(RESET_N == 1'b0)
begin
DFF1 <= 1'b0;
DFF2 <= 1'b0;
q_reg <= { N {1'b0} };
end
else
begin
DFF1 <= SWITCH;
DFF2 <= DFF1;
q_reg <= q_next;
end
end

//// counter control
always @ ( posedge CLK )
begin
if(q_reg[N-1] == 1'b1)
INTERRUPT <= ~DFF2;
else
INTERRUPT <= INTERRUPT;
end

endmodule