中文字幕 另类精品,亚洲欧美一区二区蜜桃,日本在线精品视频免费,孩交精品乱子片免费

<sup id="3hn2b"></sup>

    1. <sub id="3hn2b"><ol id="3hn2b"></ol></sub><legend id="3hn2b"></legend>

      1. <xmp id="3hn2b"></xmp>

      2. 新聞中心

        EEPW首頁(yè) > EDA/PCB > 設(shè)計(jì)應(yīng)用 > 基于PLD的矩陣鍵盤(pán)狀態(tài)機(jī)控制

        基于PLD的矩陣鍵盤(pán)狀態(tài)機(jī)控制

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

        parameter SCAN_IDLE = 3'b000;

        parameter SCAN_JITTER= 3'b001;

        parameter SCAN_COL0 = 3'b011;

        parameter SCAN_COL1 = 3'b010;

        parameter SCAN_COL2 = 3'b110;

        parameter SCAN_COL3 = 3'b100;

        parameter SCAN_READ = 3'b101;

        parameter SCAN_JTTTER2= 3'b111;

        reg [2:0] current_state;

        reg [2:0] next_state;

        always@(posedge clk or negedge rst_n)

        begin

        if(!rst_n)

        current_state = SCAN_IDLE;

        else if(cnt == 20'hfffff)

        current_state = next_state;

        end

        always@*

        begin

        case(current_state)

        SCAN_IDLE : //init

        if(col_data != 4'b1111) next_state = SCAN_JITTER;

        else next_state = SCAN_IDLE;

        SCAN_JITTER: //escape the jitter

        if(col_data != 4'b1111) next_state = SCAN_COL0;

        else next_state = SCAN_IDLE;

        SCAN_COL0 : //1th row

        if(col_data != 4'b1111) next_state = SCAN_READ;

        else next_state = SCAN_COL1;

        SCAN_COL1 : //2th row

        if(col_data != 4'b1111) next_state = SCAN_READ;

        else next_state = SCAN_COL2;

        SCAN_COL2 : //3th row

        if(col_data != 4'b1111) next_state = SCAN_READ;

        else next_state = SCAN_COL3;

        SCAN_COL3 : //4th row

        if(col_data != 4'b1111) next_state = SCAN_READ;

        else next_state = SCAN_IDLE;

        SCAN_READ : //lock the vaule

        if(col_data != 4'b1111) next_state = SCAN_JTTTER2;

        else next_state = SCAN_IDLE;

        SCAN_JTTTER2: //when your hand is gone

        if(col_data != 4'b1111) next_state = SCAN_JTTTER2;

        else next_state = SCAN_IDLE;

        endcase

        end



        關(guān)鍵詞: PLD 矩陣鍵盤(pán)

        評(píng)論


        相關(guān)推薦

        技術(shù)專區(qū)

        關(guān)閉