亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? rs232_syscon.v

?? 用VHDL語言實現(xiàn)的pic16f84
?? V
?? 第 1 頁 / 共 3 頁
字號:
          m1_next_state <= m1_scan_adr_whitespace;
          incr_cmd_ptr <= 1;
          cmd_w <= 1;
        end
        else if (char_is_i) begin
          m1_next_state <= m1_start_execution;
          cmd_i <= 1;
        end
        else m1_next_state <= m1_cmd_error_indicator;
      end

    // The only way to determine the end of a valid field is to find
    // whitespace.  Therefore, char_is_whitespace must be used as an exit
    // condition from the "get_xxx_field" states.  So, this state is used to
    // scan through any leading whitespace prior to it.
    m1_scan_adr_whitespace :
      begin
        rs232_echo <= 1;          // Don't send message characters
        if (char_is_whitespace) begin
          m1_next_state <= m1_scan_adr_whitespace;
          incr_cmd_ptr <= 1;
        end
        else if (char_is_enter) m1_next_state <= m1_start_execution;
        else begin
          m1_next_state <= m1_get_adr_field;
          reset_adr <= 1;
        end
      end

    m1_get_adr_field :
      begin
        rs232_echo <= 1;          // Don't send message characters
        if (char_is_hex) begin
          m1_next_state <= m1_get_adr_field;
          store_adr <= 1;
          incr_cmd_ptr <= 1;
        end
        else if (char_is_whitespace) begin            // Normal exit
          m1_next_state <= m1_scan_dat_whitespace;
        end
        else if (char_is_enter) m1_next_state <= m1_start_execution;
        else m1_next_state <= m1_adr_error_indicator;
      end

    m1_scan_dat_whitespace :
      begin
        rs232_echo <= 1;          // Don't send message characters
        // There is no DAT field for reads, so skip it.
        if (command == `CMD_R) m1_next_state <= m1_scan_qty_whitespace;
        else if (char_is_whitespace) begin
          m1_next_state <= m1_scan_dat_whitespace;
          incr_cmd_ptr <= 1;
        end
        else if (char_is_enter) m1_next_state <= m1_start_execution;
        else begin
          m1_next_state <= m1_get_dat_field;
          reset_dat <= 1;
        end
      end

    m1_get_dat_field :
      begin
        rs232_echo <= 1;          // Don't send message characters
        if (char_is_hex) begin
          m1_next_state <= m1_get_dat_field;
          store_dat <= 1;
          incr_cmd_ptr <= 1;
        end
        else if (char_is_whitespace) begin            // Normal exit
          m1_next_state <= m1_scan_qty_whitespace;
        end
        else if (char_is_enter) m1_next_state <= m1_start_execution;
        else m1_next_state <= m1_dat_error_indicator;
      end

    m1_scan_qty_whitespace :
      begin
        rs232_echo <= 1;          // Don't send message characters
        if (char_is_whitespace) begin
          m1_next_state <= m1_scan_qty_whitespace;
          incr_cmd_ptr <= 1;
        end
        else if (char_is_enter) m1_next_state <= m1_start_execution;
        else begin
          m1_next_state <= m1_get_qty_field;
          reset_qty <= 1;
        end
      end

    m1_get_qty_field :
      begin
        rs232_echo <= 1;          // Don't send message characters
        if (char_is_hex) begin
          m1_next_state <= m1_get_qty_field;
          store_qty <= 1;
          incr_cmd_ptr <= 1;
        end
        else if (char_is_whitespace || char_is_enter) begin  // Normal exit
          m1_next_state <= m1_start_execution;
        end
        else m1_next_state <= m1_qty_error_indicator;
      end

    // This state seeks to obtain master_bg_i, which grants the bus to
    // rs232_syscon.
    m1_start_execution :
      begin
        rs232_echo <= 1;           // Don't send message characters
        reset_watchdog <= 1;       // Reset the timer.
        reset_adr_offset <= 1;     // Reset the address offset.
        reset_rd_field_count <= 1; // Reset the rd_field_count.
        m1_next_state <= m1_request_bus;
      end

    m1_request_bus :
      begin
        rs232_echo <= 1;          // Don't send message characters
        master_br_o <= 1;         // Request the bus.
        if (master_bg_i) m1_next_state <= m1_bus_granted;
        else if (watchdog_timer_done) begin
          m1_next_state <= m1_bg_error_indicator;
        end
        else m1_next_state <= m1_request_bus;
      end

    m1_bus_granted :
      begin
        rs232_echo <= 1;          // Don't send message characters
        master_br_o <= 1;         // Keep holding the bus
        reset_watchdog <= 1;      // Reset the timer.
        if (adr_offset != qty_sr) m1_next_state <= m1_execute;
        else m1_next_state <= m1_send_ok;
      end

    // This single state does reset/write/read depending upon the value
    // contained in "command"!
    m1_execute :
      begin
        rs232_echo <= 1;          // Don't send message characters
        master_br_o <= 1;         // Keep holding the bus
        stb_l <= 1'b1;            // Show that a bus cycle is happening
        case (command)            // Assert the appropriate signals
          `CMD_I : rst_o <= 1;
          `CMD_R : capture_dat <= ack_i;
          `CMD_W : we_l <= 1;
          default: ;
        endcase
        if (watchdog_timer_done || err_i) begin
          m1_next_state <= m1_ack_error_indicator;
        end
        else if (ack_i
                 && (command == `CMD_R)
                 && (rd_field_count == 0)
                 )
        begin
          m1_next_state <= m1_rd_send_adr_sr; // Leads to a new address line.
          reset_rd_digit_count <= 1;
          incr_adr_offset <= 1;               // move to the next address
        end
        else if (ack_i && (command == `CMD_R)) begin
          m1_next_state <= m1_rd_send_dat_sr; // Leads to a new data field.
          reset_rd_digit_count <= 1;
          reset_msg_offset <= 1;
          incr_adr_offset <= 1;             // move to the next address
        end
        else if (ack_i) begin
          m1_next_state <= m1_bus_granted;  // continue to the next cycle
          incr_adr_offset <= 1;             // move to the next address
        end
        else m1_next_state <= m1_execute;
      end

    m1_rd_send_adr_sr :
      begin
        msg_base <= {1'b0,rd_adr_sr[`NIBBLE_SIZE*ADR_DIGITS_PP-1:
                                    `NIBBLE_SIZE*(ADR_DIGITS_PP-1)]};
        if ((rd_digit_count == ADR_DIGITS_PP-1) && rs232_tx_load) begin
          m1_next_state <= m1_rd_send_separator;
          reset_msg_offset <= 1;
        end
        else if (rs232_tx_load) begin
          shift_rd_adr <= 1;
          incr_rd_digit_count <= 1;
          m1_next_state <= m1_rd_send_adr_sr;
        end
        else m1_next_state <= m1_rd_send_adr_sr;
      end

    m1_rd_send_separator :
      begin
        msg_base <= 5'b10000;    // Address of the separator message
        incr_msg_offset <= rs232_tx_load;
        if ((msg_offset == 2) && rs232_tx_load)
        begin
          m1_next_state <= m1_rd_send_dat_sr;
          reset_rd_digit_count <= 1;
          reset_msg_offset <= 1;
        end
        else m1_next_state <= m1_rd_send_separator;
      end

    m1_rd_send_dat_sr :
      begin
        msg_base <= {1'b0,dat_sr[`NIBBLE_SIZE*DAT_DIGITS_PP-1:
                                 `NIBBLE_SIZE*(DAT_DIGITS_PP-1)]};
        if (
            (rd_digit_count == DAT_DIGITS_PP-1)
            && (rd_field_count == RD_FIELDS_PP-1)
            && rs232_tx_load
            )
        begin
          m1_next_state <= m1_rd_send_crlf;
          reset_rd_field_count <= 1;
        end
        else if ((rd_digit_count == DAT_DIGITS_PP-1) && rs232_tx_load) begin
          m1_next_state <= m1_rd_send_space;
          incr_rd_field_count <= 1;
        end
        else if (rs232_tx_load) begin
            store_dat <= 1;
            incr_rd_digit_count <= 1;
            m1_next_state <= m1_rd_send_dat_sr;
        end
        else m1_next_state <= m1_rd_send_dat_sr;
      end

    m1_rd_send_space :
      begin
        msg_base <= 5'b10000;    // Address of the space
        incr_msg_offset <= rs232_tx_load;
        if ((msg_offset == 0) && rs232_tx_load) begin
          m1_next_state <= m1_bus_granted;
          reset_msg_offset <= 1;
        end
        else m1_next_state <= m1_rd_send_space;
      end

    m1_rd_send_crlf :
      begin
        msg_base <= 5'b10111;     // Address of the cr/lf message
        incr_msg_offset <= rs232_tx_load;
        if ((msg_offset == 1) && rs232_tx_load) begin
          m1_next_state <= m1_bus_granted;
          reset_msg_offset <= 1;
        end
        else m1_next_state <= m1_rd_send_crlf;
      end

    default : m1_next_state <= m1_initial_state;
  endcase
end


// This is the counter for incrementing or loading the cmd_ptr
always @(posedge clk_i)
begin
  if (reset_i || reset_cmd_ptr) cmd_ptr <= 0;
  else if (decr_cmd_ptr) cmd_ptr <= cmd_ptr - 1;
  else if (incr_cmd_ptr) cmd_ptr <= cmd_ptr + 1;
end


// This is the command buffer writing section
always @(posedge clk_i)
begin
  if (rs232_echo && cmd_buffer_write) cmd_buffer[cmd_ptr] <= rs232_rx_char;
end
// This is the command buffer reading section
assign cmd_char = cmd_buffer[cmd_ptr];
assign lc_cmd_char = (cmd_buffer[cmd_ptr] | 8'h20); // lowercase



// These assigments are for detecting whether the cmd_char is
// anything of special interest.
assign char_is_enter = (cmd_char == 8'h0d);          // enter
assign char_is_whitespace = (
                                (cmd_char == " ")    // space
                             || (cmd_char == 8'h09)  // tab
                             );
assign char_is_num = ((cmd_char>=8'h30)&&(cmd_char<=8'h39));
assign char_is_a_f = ((lc_cmd_char>=8'h61)&&(lc_cmd_char<=8'h66));
assign char_is_hex = ( char_is_num || char_is_a_f );
assign char_is_r = (lc_cmd_char == "r");
assign char_is_w = (lc_cmd_char == "w");
assign char_is_i = (lc_cmd_char == "i");

assign hex_digit = char_is_num?cmd_char[3:0]:(cmd_char[3:0]+9);

// This is the command register.  It stores the type of command to execute.
// This is so that the m2 state machine can parse address, data and qty
// into "generic" storage locations, and then when it executes the command,
// it refers back to this register in order to determine what type of
// operation to perform.

always @(posedge clk_i)
begin
  if (reset_i) command <= `CMD_0;
  else if (cmd_i) command <= `CMD_I;
  else if (cmd_r) command <= `CMD_R;
  else if (cmd_w) command <= `CMD_W;
end

// This is the "nibble" shift register for the address which is sent character
// by character to the user.  It is loaded each time the adr_offset is
// incremented, in order to save the previous address for use in printing
// to the user.
always @(posedge clk_i)
begin
  if (reset_i || reset_adr) rd_adr_sr <= 0;
  else if (incr_adr_offset) rd_adr_sr <= adr_ptr;
  else if (shift_rd_adr) begin
    rd_adr_sr[`NIBBLE_SIZE*ADR_DIGITS_PP-1:`NIBBLE_SIZE] <=
      rd_adr_sr[`NIBBLE_SIZE*(ADR_DIGITS_PP-1)-1:0];
    rd_adr_sr[`NIBBLE_SIZE-1:0] <= {`NIBBLE_SIZE{1'b0}};
  end
end

// These are the "nibble" shift registers.  They handle loading the
// hexadecimal digits from the command line.
always @(posedge clk_i)
begin
  if (reset_i || reset_adr) adr_sr <= 0;
  else if (store_adr) begin
    adr_sr[`NIBBLE_SIZE*ADR_DIGITS_PP-1:`NIBBLE_SIZE] <=
      adr_sr[`NIBBLE_SIZE*(ADR_DIGITS_PP-1)-1:0];
    adr_sr[`NIBBLE_SIZE-1:0] <= hex_digit;
  end
end

always @(posedge clk_i)
begin
  if (reset_i || reset_dat) dat_sr <= 0;
  else if (capture_dat) dat_sr <= dat_io;
  else if (store_dat) begin
    dat_sr[`NIBBLE_SIZE*DAT_DIGITS_PP-1:`NIBBLE_SIZE] <=
      dat_sr[`NIBBLE_SIZE*(DAT_DIGITS_PP-1)-1:0];
    dat_sr[`NIBBLE_SIZE-1:0] <= hex_digit;
  end
end

always @(posedge clk_i)
begin
  if (reset_i || reset_qty) qty_sr <= 0;
  else if (init_qty) qty_sr <= 1;
  else if (store_qty) begin
    qty_sr[`NIBBLE_SIZE*QTY_DIGITS_PP-1:`NIBBLE_SIZE] <=
      qty_sr[`NIBBLE_SIZE*(QTY_DIGITS_PP-1)-1:0];
    qty_sr[`NIBBLE_SIZE-1:0] <= hex_digit;
  end
end

// This is the rd_digit_count counter.  It is used for counting digits
// displayed of both the adr_sr and dat_sr, so it must be able to count up
// to the extent of the larger of the two...
always @(posedge clk_i)
begin
  if (reset_i || reset_rd_digit_count) rd_digit_count <= 0;
  else if (incr_rd_digit_count) rd_digit_count <= rd_digit_count + 1;
end

// This is the rd_field_count counter.  It is used for counting dat_sr fields
// displayed per line.
always @(posedge clk_i)
begin
  if (reset_i || reset_rd_field_count) rd_field_count <= 0;
  else if (incr_rd_field_count) rd_field_count <= rd_field_count + 1;
end


// This is the watchdog timer counter
// The watchdog timer is always "enabled" to operate.
always @(posedge clk_i)
begin
  if (reset_i || reset_watchdog) watchdog_timer_count <= 0;
  else if (~watchdog_timer_done)
    watchdog_timer_count <= watchdog_timer_count + 1;
end
assign watchdog_timer_done = (watchdog_timer_count==WATCHDOG_TIMER_VALUE_PP);


endmodule


?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美三级欧美一级| 亚洲精品乱码久久久久久久久| 精品国产成人系列| 国产精品久久午夜夜伦鲁鲁| 亚洲一区成人在线| 精品一二线国产| 丁香婷婷综合网| 国产精品免费网站在线观看| 亚洲激情图片小说视频| 久久国产乱子精品免费女| av电影一区二区| 日韩欧美一二三| 亚洲婷婷在线视频| 国内外成人在线| 欧洲一区在线电影| 国产欧美日韩亚州综合 | 欧美电视剧在线观看完整版| 日韩毛片在线免费观看| 久久国产日韩欧美精品| 91在线观看下载| 精品国产91乱码一区二区三区 | 91精品国产综合久久福利 | 国产成人亚洲综合色影视| 欧美在线一区二区三区| 国产精品丝袜在线| 精品一区中文字幕| 欧美私人免费视频| 亚洲美女区一区| 91亚洲精品久久久蜜桃| 久久久久99精品国产片| 久久精品免费观看| 日韩视频一区二区在线观看| 一区二区三区四区av| 国产精品99久久久久久久vr | 视频一区二区三区中文字幕| 91在线视频免费91| 欧美激情综合在线| 高清不卡在线观看| 国产日韩欧美不卡在线| 精品在线免费观看| 精品久久久久久久一区二区蜜臀| 日韩精品91亚洲二区在线观看| 色狠狠av一区二区三区| 亚洲色图视频网| 成人三级伦理片| 亚洲视频在线观看一区| 一本一道久久a久久精品| 亚洲黄网站在线观看| 欧美在线观看一二区| 午夜免费欧美电影| 欧美不卡一二三| 福利视频网站一区二区三区| 国产精品成人在线观看| av一二三不卡影片| 国产精品成人一区二区艾草| av午夜精品一区二区三区| 亚洲精品乱码久久久久久黑人 | 亚洲三级电影全部在线观看高清| 国产精品亚洲第一区在线暖暖韩国| 一区二区三区小说| 欧美日韩精品一区视频| 毛片av中文字幕一区二区| 欧美r级在线观看| aaa国产一区| 日韩国产欧美视频| 欧美高清在线一区二区| 91啪亚洲精品| 蜜桃视频在线一区| 日韩毛片一二三区| 精品剧情v国产在线观看在线| jvid福利写真一区二区三区| 日日摸夜夜添夜夜添国产精品| 日本一区二区视频在线观看| 欧美高清激情brazzers| 91玉足脚交白嫩脚丫在线播放| 捆绑变态av一区二区三区| 国产精品色婷婷久久58| 欧美一区在线视频| 在线精品亚洲一区二区不卡| 精品一区二区在线看| 亚洲一区在线观看视频| 国产精品国产三级国产a| 欧美成人免费网站| 欧美日韩一卡二卡| proumb性欧美在线观看| 国产精品系列在线播放| 日本不卡高清视频| 日韩av一区二区三区四区| 亚洲另类在线一区| 亚洲美腿欧美偷拍| 亚洲欧美激情小说另类| 国产精品国产三级国产普通话蜜臀| 精品国产一区二区三区av性色| 欧美色欧美亚洲另类二区| 欧美va亚洲va国产综合| 538在线一区二区精品国产| 欧美日韩国产综合久久| 欧美乱熟臀69xxxxxx| 精品视频在线视频| 欧美另类videos死尸| 欧美日韩三级视频| 色综合久久中文字幕综合网| 91一区二区在线观看| 色婷婷av一区二区三区软件| 99久久久精品| 色八戒一区二区三区| 欧美日韩精品免费| 欧美三级资源在线| 欧美视频你懂的| 91精品国产综合久久香蕉的特点| 一区二区三区资源| 亚洲线精品一区二区三区| 婷婷久久综合九色国产成人| 麻豆91免费看| 国产成人午夜视频| 91久久精品一区二区二区| 欧美亚洲综合在线| 精品久久国产97色综合| 欧美国产精品一区| 亚洲成人动漫精品| 国产精品18久久久久久久久| 97se亚洲国产综合自在线观| 在线观看免费一区| 久久久久88色偷偷免费| 亚洲精品国产精品乱码不99| 久久精品二区亚洲w码| 99精品视频免费在线观看| 欧美日韩精品欧美日韩精品一 | 亚洲午夜羞羞片| 国产成人精品亚洲午夜麻豆| 欧美在线观看视频在线| 精品国产91洋老外米糕| 一道本成人在线| 精品久久久久久久久久久久久久久久久| 最新高清无码专区| 国模套图日韩精品一区二区| 欧美视频一区二区三区在线观看| 久久网站最新地址| 日本成人在线看| 91精品一区二区三区在线观看| 亚洲精品高清在线观看| 国产精品一区专区| 久久网站最新地址| 精品综合免费视频观看| 欧美男人的天堂一二区| 一区二区在线看| 91国偷自产一区二区三区观看 | 亚洲高清在线精品| 欧美三级三级三级爽爽爽| 亚洲一区二区三区视频在线| 在线观看亚洲精品| 亚洲国产日产av| 欧美日本高清视频在线观看| 亚洲精品v日韩精品| 91亚洲国产成人精品一区二区三| 一区在线中文字幕| av在线播放成人| 亚洲最大色网站| 欧美精品在线观看一区二区| 亚洲成av人影院| 在线91免费看| 国产精品亚洲第一区在线暖暖韩国 | 久久亚洲一区二区三区四区| 国产成人午夜片在线观看高清观看| 国产精品视频一二三区| 在线观看成人小视频| 在线看国产一区二区| 天堂av在线一区| 欧美精品一区二区精品网| 99久久精品国产一区| 男女激情视频一区| www国产精品av| www.色精品| 亚洲一二三专区| 亚洲精品免费在线| **网站欧美大片在线观看| 亚洲精品一区二区在线观看| 色婷婷久久综合| 国产成人综合亚洲网站| 亚洲一区二区精品3399| 久久精品亚洲麻豆av一区二区 | 久久成人免费网| 一区二区三区日韩欧美精品| 欧美大片一区二区| 欧美人与z0zoxxxx视频| 91麻豆蜜桃一区二区三区| 国产成人亚洲综合a∨婷婷图片| 亚洲综合另类小说| 亚洲人快播电影网| 日韩毛片视频在线看| 亚洲黄色免费网站| 亚洲精品视频免费看| 亚洲精品水蜜桃| 亚洲精选在线视频| 中文字幕亚洲成人| 中文字幕一区二区在线观看| 久久久精品黄色| 久久久www免费人成精品| 久久久国产精品不卡| 国产网站一区二区|