<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>

新聞中心

EEPW首頁(yè) > EDA/PCB > 設計應用 > 基于FPGA的按鍵彈跳消除模塊的研究與應用

基于FPGA的按鍵彈跳消除模塊的研究與應用

作者: 時(shí)間:2012-10-17 來(lái)源:網(wǎng)絡(luò ) 收藏

2.2 程序設計

設計一個(gè)高脈沖計數器count1和一個(gè)低脈沖計數器conut0。引入一個(gè)采樣脈沖信號clk,對輸入信號button_in進(jìn)行采樣,并對clk進(jìn)行計數。若button_in為高電平,count1做加法計數,直到count1各位全為1,停止計數,歸零,使消抖后的輸出信號button_out輸出1。若button_in為低電平,count0做加法計數,直到count0各位全為1,停止計數歸零,并使消抖后的輸出信號button_out輸出0。

部分程序如下:

module filter(clk,

reset,

button_in,

button_out);

input clk;

input reset;

input button_in;

output button_out;

wire buttong_out1;

reg [20:0] count0;

reg [20:0] count1;

reg button_out1_reg;

……

assign button_out=button_out1_reg;

//對輸入進(jìn)行采樣,計數

always@(posedge clk or negedge reset)

begin

if(!reset) count1=21'h000000;

else if(button_out1==1'b1) count1=count1+1;//對高電平計數

else count1=21'h000000;

end

always@(posedge clk or negedge reset)

begin

if(!reset) count0=21'h000000;

else if(button_out1==1'b0) count0=count0+1;//對低電平計數

else count0=21’h000000;

end

//輸出

always@(posedge clk or negedge reset

begin

if(!reset) button_out1_reg=1'b1;

else if(count0==21'h1312D0) //判斷低電平信號是否符合輸出條件

button_out1_reg=1'b0; //如果符合條件,則輸出低電平

else if(count1==21'h1312D0) //判斷低電平信號是否符合輸出條件

button_out1_reg=1'b1; //如果符合條件,則輸出高電平

else button_out1_reg=button_out1_reg;

end

endmodule

基于FPGA的按鍵彈跳消除電路的研究與應用



關(guān)鍵詞: FPGA 按鍵 彈跳消除 模塊

評論


相關(guān)推薦

技術(shù)專(zhuān)區

關(guān)閉
国产精品自在自线亚洲|国产精品无圣光一区二区|国产日产欧洲无码视频|久久久一本精品99久久K精品66|欧美人与动牲交片免费播放
<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>