久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 1120|回復: 0
打印 上一主題 下一主題
收起左側

基于fpga的輸入信號邊沿濾波(上升沿/下降沿)微秒 veilog

[復制鏈接]
跳轉到指定樓層
樓主
濾波效果如圖所示


直接上代碼

veilog源碼
module my_filter_us(
        input clk,//200Mhz
        input rst,
        input pulse_in,
        input[7:0] pulse_delay,//濾波數值輸入,單位us  1-100
        output reg pulse_out=1



);
reg[19:0] cnt_delay=0;
reg[3:0] filter_satae=3;

wire[19:0] data;
assign data=pulse_delay*200;
reg[19:0] cnt_rst=0;
reg rst_n=0;

always @(posedge clk)
        begin
                if(cnt_rst<100000)
                        begin
                                cnt_rst<=cnt_rst+1;
                        end
                else
                        begin
                                rst_n<=1;
                        end
        end

always @(posedge clk or negedge rst_n)
        begin
                if(!rst_n)
                        begin

                        end
                else
                        begin
                                case(filter_satae)
                                        0:        begin
                                                        if(pulse_out==0)
                                                                begin
                                                                        filter_satae<=filter_satae+1;
                                                                end
                                                        else if(cnt_delay<data)
                                                                        begin
                                                                                if(pulse_in==0)
                                                                                        begin
                                                                                                cnt_delay<=cnt_delay+1;
                                                                                        end
                                                                                else
                                                                                        begin
                                                                                                cnt_delay<=0;
                                                                                                //data<=pulse_delay*200;
                                                                                        end
                                                                        end
                                                        else if(pulse_in==0)
                                                                begin
                                                                        pulse_out<=0;
                                                                        cnt_delay<=0;
                                                                end
                                                end
                                        1:        begin
                                                        filter_satae<=filter_satae+1;
                                                end
                                        2:        begin
                                                        if(pulse_out==1)
                                                                begin
                                                                        filter_satae<=filter_satae+1;
                                                                end
                                                        else if(cnt_delay<data)
                                                                        begin
                                                                                if(pulse_in==1)
                                                                                        begin
                                                                                                cnt_delay<=cnt_delay+1;
                                                                                        end
                                                                                else
                                                                                        begin
                                                                                                cnt_delay<=0;
                                                                                                //data<=pulse_delay*200;
                                                                                        end
                                                                        end
                                                        else if(pulse_in==1)
                                                                begin
                                                                        pulse_out<=1;
                                                                        cnt_delay<=0;
                                                                end

                                                end
                                        3:        begin
                                                        filter_satae<=0;
                                                        //data<=pulse_delay*200;
                                                end

                                endcase
                        end
        end


endmodule


仿真
`timescale 1ns/1ps
module my_filter_us_tb(
);
reg clk=0;
reg pulse_in=0;
reg [7:0]pulse_delay=10;
wire pulse_out;

my_filter_us u1(
        .clk(clk),
        .pulse_in(pulse_in),
        .pulse_delay(pulse_delay),
        .pulse_out(pulse_out)
);

initial begin
forever
        begin
                clk=0; #2 clk=1; #3;//200Mhz      

        end
end

initial begin
forever
        begin



                pulse_in=0; #60000;
                pulse_in=0; #3000 pulse_in=1; #3000;
                pulse_in=0; #3000 pulse_in=1; #3000;
                pulse_in=0; #3000 pulse_in=1; #3000;
                pulse_in=0; #3000 pulse_in=1; #3000;

                pulse_in=1; #60000;
                pulse_in=0; #3000 pulse_in=1; #3000;
                pulse_in=0; #3000 pulse_in=1; #3000;
                pulse_in=0; #3000; pulse_in=1; #3000;
                pulse_in=0; #3000; pulse_in=1; #3000;

        end
end
endmodule

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 欧美一级片a | 亚洲精久 | 久久精品久久久久久 | 国产一级视频在线播放 | 欧美 日韩 视频 | 国产99视频精品免费播放照片 | 91在线色视频 | 国产精品高 | 日日干夜夜操 | 免费在线观看av网站 | 天天操人人干 | 一区二区中文 | 91精品国产一区二区 | 一级黄色毛片免费 | 超碰免费在线观看 | 久久免费精彩视频 | 欧美在线一区二区三区 | 久久99国产精品久久99果冻传媒 | 亚洲精品欧美一区二区三区 | 精品99久久久久久 | av日韩精品 | 91免费在线视频 | 可以免费观看的av片 | 久久成人国产精品 | 日本三级电影在线看 | 91天堂 | 亚洲欧美综合精品久久成人 | 拍真实国产伦偷精品 | 免费在线观看黄色av | 成人亚洲综合 | 亚洲综合日韩精品欧美综合区 | 国产精品成人一区二区 | 国产精品久久久久久久久久三级 | 日韩在线观看一区二区三区 | 亚洲精选一区二区 | 国产综合久久 | 午夜久久久| 日韩中文字幕视频在线 | 91免费福利在线 | 日本精品视频 | 日本黄色短片 |