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

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

?? auto_baud_with_tracking.v

?? This build is for developing a "binary-to-BCD" converter for use in // displaying numerals in base-
?? V
?? 第 1 頁 / 共 2 頁
字號:


// This is the CLOCK_FACTOR_PP prescaler and also mid_bit_count counter
assign enable_clock_count = measure || (verify && main_count_rollover);
always @(posedge clk_i or posedge reset_i)
begin
  if (reset_i) clock_count <= 0;
  else if (clear_counters) clock_count <= 0;
  else if (enable_clock_count)
  begin  // Must have been clk_i edge
    if (clock_count_rollover) clock_count <= 0;
    else clock_count <= clock_count + 1;
  end
end
// Counter rollover condition
assign clock_count_rollover = (clock_count == (CLOCK_FACTOR_PP-1));
// This condition signals the middle of a bit time, for use during the
// verify stage.  Also, this signal is used to advance the main count,
// instead of "clock_count_rollover."  This produces an effective "rounding"
// operation for the measurement (which would otherwise "truncate" any
// fraction of time contained in this counter at the instant the measurement
// is finished.
// (The "enable_clock_count" is included in order to make the pulse narrow,
//  only one clock wide...)
assign mid_bit_count = (
                        (clock_count == ((CLOCK_FACTOR_PP>>1)-1))
                        && enable_clock_count
                        );

// This is the main counter.  During measurement, it advances once for
// each CLOCK_FACTOR_PP cycles of clk_i.  This accumulated measurement
// is then latched into "measurement" when the state machine determines that
// the measurement interval is finished.
// During verify time (when the new candidate baud rate clock is being tested)
// this counter is allowed to run freely, advancing once each clk_i, but being
// reset when it reaches a total count of "measurement" clock cycles.
always @(posedge clk_i or posedge reset_i)
begin
  if (reset_i) main_count <= 0;
  else // must have been clk_i edge
  begin
    // Clear main count when measurement is done
    if (clear_counters) main_count <= 0;
    // If measuring, advance once per CLOCK_FACTOR_PP clk_i pulses.
    else if (measure && mid_bit_count) main_count <= main_count + 1;
    // If verifying or running, check reset conditions, 
    // otherwise advance always.
    else if (verify)
    begin
      if (main_count_rollover) main_count <= 0;
      else main_count <= main_count + 1;
    end
  end
end
// This is the "verify" baud clock signal... not the final output one.
assign main_count_rollover = (main_count == measurement);


// This is the BAUD counter.  Once a measurement has been verified, it is
// stored in "baud" and the signal "run" goes high.  From then on, this
// counter is allowed to run freely, advancing once each clk_i, but being
// reset when it reaches a total count of "baud" clock cycles.  This
// counter's reset signal is the output baud rate clock.
always @(posedge clk_i or posedge reset_i)
begin
  if (reset_i) baud_count <= 0;
  else // must have been clk_i edge
  begin
    // If running, advance freely
    if (run)
    begin
      if (baud_count_rollover) baud_count <= 0;
      else baud_count <= baud_count + 1;
    end
  end
end
assign baud_count_rollover = (baud_count == baud);

// This is a shift register used to provide "target" character bits one at
// a time for verification as they are "received" (sampled) using the
// candidate baud clock.
always @(posedge clk_i or posedge reset_i)
begin
  if (reset_i) target_bits <= `TEMPLATE_BITS;
  else // must have been a clock edge
  begin
    if (~verify) target_bits <= `TEMPLATE_BITS;
    if (verify && mid_bit_count) target_bits <= {0,(target_bits>>1)};
  end
end
// It is done when only the stop bit is left in the shift register.
assign verify_done = (
                       (target_bits == 1)
                       && verify
                       && mid_bit_count
                      );

// This is a flip-flop used to keep track of whether the verify operation
// is succeeding or not.  Any target bits that do not match the received
// data at the sampling edge, will cause the verify_failed bit to go high.
// This is what the state machine looks at to determine whether it passed
// or not.
always @(posedge clk_i or posedge reset_i)
begin
  if (reset_i) character_miscompare <= 0;
  else  // Must have been a clock edge
  begin
    if (idle) character_miscompare <= 0;
    if (verify && mid_bit_count
        && (target_bits[0] ^ serial_dat_i)) character_miscompare <= 1;
  end
end


// This is the measurement storage latch.  The final measured time count
// from main_count is stored in this latch upon completion of the measurement
// interval.  The value stored in this latch is used for the baud clock
// generated during verify, but a different register holds the actual value
// being used to generate output.
always @(posedge clk_i or posedge idle)
begin
  // Set to all ones during idle (asynchronous).
  if (idle) measurement <= -1;
  // Otherwise, there must have been a clk_i edge
  // When the measurement is done, the counters are cleared, and the time
  // interval must be stored before it is cleared away...
  // This also causes a store following a failed verify state on the way back
  // into idle, but the idle state clears out the false measurement anyway.
  else if (clear_counters) measurement <= (main_count>>1);
end

// This is the BAUD storage latch.  The final verified time count
// from the "measurement" register is stored in this register after a good
// verify.  The value stored in this latch is used in conjunction with
// baud_count to produce the baud clock which is sent to the output.
always @(posedge clk_i or posedge reset_i)
begin
  // Set to all ones during reset (asynchronous).
  if (reset_i) baud <= -1;
  // Otherwise, there must have been a clk_i edge
  // When the measurement is done, the counters are cleared, and the time
  // interval must be stored before it is cleared away...
  // This also causes a store following a failed verify state on the way back
  // into idle, but the idle state clears out the false measurement anyway.
  else if (verify_good) baud <= measurement;
end

// This is a flip-flop used to keep track of whether the unit is producing
// a baud clock or not.  Initially following reset, there is no baud clock
// being produced.  But, once a single measurement is verified, then the
// clock is produced and tracking changes are made over time.  Thus, this
// bit goes high as a result of the first "verify_good" pulse, and it remains
// high forever, until the unit is reset.
always @(posedge clk_i or posedge reset_i)
begin
  if (reset_i) run <= 0;
  else  // Must have been a clock edge
  begin
    if (verify_good) run <= 1;
  end
end

assign baud_clk_o = baud_count_rollover;


// This is state machine m1.  It checks the status of the serial_dat_i line
// and coordinates the measurement of the time interval of the first two
// bits of the received character, which is the "measurement interval."
// Following the measurement interval, the state machine enters a new
// phase of bit verification.  If the measured time interval is accurate
// enough to measure the remaining 8 bits of the character correctly, then
// the measurement is accepted, and the baud rate clock is driven onto
// the baud_clk_o output pin.  Incidentally, the process of verification
// effectively filters out all characters which are not the desired target
// character for measurement.  In this case, the target character is the
// carriage return.


// State register
always @(posedge clk_i or posedge reset_i)
begin : m1_state_register
  if (reset_i) m1_state <= m1_idle;          // asynchronous reset
  else m1_state <= m1_next_state;
end

// State transition logic
always @(m1_state
         or mid_bit_count
         or serial_dat_i
         or verify_done
         or character_miscompare
         )
begin : m1_state_logic

  // Default values for outputs.  The individual states can override these.
  idle <= 1'b0;
  verify_good <= 1'b0;
  measure <= 1'b0;
  clear_counters <= 1'b0;
  verify <= 1'b0;

  case (m1_state) // synthesis parallel_case

    m1_idle :
      begin
        idle <= 1'b1;
        if (serial_dat_i == 0) m1_next_state <= m1_measure_0;
        else m1_next_state <= m1_idle;
      end

    m1_measure_0 :
      begin
        measure <= 1'b1;
        // Check at mid bit time, to make sure serial line is still low...
        // (At this time, "mid_bit_count" is simply CLOCK_FACTOR_PP>>1 clk_i's.)
        if (mid_bit_count && ~serial_dat_i) m1_next_state <= m1_measure_1;
        // If it is not low, then it must have been a "glitch"...
        else if (mid_bit_count && serial_dat_i) m1_next_state <= m1_idle;
        else m1_next_state <= m1_measure_0;
      end

    m1_measure_1 :
      begin
        measure <= 1'b1;
        // Look for first data bit (high).
        if (serial_dat_i) m1_next_state <= m1_measure_2;
        // If it is not high keep waiting...
        // (Put detection of measurement overflow in here if necessary...)
        else m1_next_state <= m1_measure_1;
      end

    m1_measure_2 :
      begin
        measure <= 1'b1;
        // Check using mid bit time, to make sure serial line is still high...
        // (At this time, "mid_bit_count" is simply CLOCK_FACTOR_PP>>1 clk_i's.)
        if (mid_bit_count && serial_dat_i) m1_next_state <= m1_measure_3;
        // If it is not high, then it must have been a "glitch"...
        else if (mid_bit_count && ~serial_dat_i) m1_next_state <= m1_idle;
        else m1_next_state <= m1_measure_2;
      end

    m1_measure_3 :
      begin
        measure <= 1'b1;
        // Look for end of measurement interval (low)
        if (!serial_dat_i) m1_next_state <= m1_measure_4;
        // If it is not high keep waiting...
        // (Put detection of measurement overflow in here if necessary...)
        else m1_next_state <= m1_measure_3;
      end

    // This state outputs a reset pulse, to clear counters and store the
    // measurement from main_count.
    m1_measure_4 :
      begin
        clear_counters <= 1'b1; // Clears counters, stores measurement
        m1_next_state <= m1_verify_0;
      end

    m1_verify_0 :  // Wait for verify operations to finish
      begin
        verify <= 1'b1;
        if (verify_done) m1_next_state <= m1_verify_1;
        else m1_next_state <= m1_verify_0;
      end

    // NOTE: This "extra" state is needed because the character_miscompare
    //       information is not valid until 1 cycle after verify_done is
    //       active.
    m1_verify_1 :  // Checks for character miscompare
      begin
        if (character_miscompare) m1_next_state <= m1_verify_failed;
        else m1_next_state <= m1_run;
      end

    m1_verify_failed : // Resets counters on the way back to idle
      begin
        clear_counters <= 1'b1;
        m1_next_state <= m1_idle;
      end

    // This state is for successful verification results!
    // Since this is a tracking unit, the "run" output is used as a pulse
    // to store the now verified rate.
    m1_run :       
      begin
        verify_good <= 1'b1;
        m1_next_state <= m1_idle;
      end

    default : m1_next_state <= m1_idle;
  endcase
end


assign auto_baud_locked_o = run;


endmodule

//`undef LOG2_MAX_CLOCK_FACTOR

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品综合一本久道在线视频| 一个色综合av| 亚洲免费在线看| 久久精品国产99国产精品| 99国产一区二区三精品乱码| 日韩欧美的一区二区| 亚洲超碰精品一区二区| www.久久久久久久久| 久久综合国产精品| 免费av成人在线| 欧美日韩激情在线| 亚洲六月丁香色婷婷综合久久 | 久久久www成人免费无遮挡大片| 亚洲精品久久嫩草网站秘色| 成人蜜臀av电影| 欧美v亚洲v综合ⅴ国产v| 亚洲成av人片在www色猫咪| 91久久一区二区| 亚洲精品乱码久久久久久黑人| 粗大黑人巨茎大战欧美成人| 精品国产三级电影在线观看| 免费一级欧美片在线观看| 欧美日韩小视频| 亚洲一区二区高清| 欧美最猛黑人xxxxx猛交| 亚洲精品videosex极品| 91麻豆国产福利在线观看| 中文字幕五月欧美| 不卡av在线免费观看| 欧美激情一区二区三区全黄| 国产成人免费视频精品含羞草妖精| 日韩精品一区二区三区在线| 美脚の诱脚舐め脚责91 | 成人午夜av影视| 国产婷婷色一区二区三区在线| 韩国v欧美v亚洲v日本v| 精品国产成人系列| 国产精品综合二区| 国产日韩欧美高清在线| 成人动漫一区二区在线| 日韩美女啊v在线免费观看| 99精品久久只有精品| 一区二区三区在线免费视频| 欧美在线不卡视频| 日本网站在线观看一区二区三区| 51久久夜色精品国产麻豆| 免费成人深夜小野草| 欧美成人aa大片| 丁香激情综合五月| 夜夜揉揉日日人人青青一国产精品| 欧美主播一区二区三区| 亚洲高清免费视频| 精品欧美久久久| 暴力调教一区二区三区| 亚洲一二三四区不卡| 欧美一区二区三区日韩| 懂色一区二区三区免费观看| 中文欧美字幕免费| 色88888久久久久久影院野外| 天堂资源在线中文精品| www久久久久| 在线亚洲免费视频| 激情av综合网| 一区二区三区在线视频播放| 欧美大胆一级视频| 97久久精品人人做人人爽50路| 日日夜夜免费精品视频| 亚洲国产成人午夜在线一区| 欧美色视频在线观看| 国产精品综合一区二区| 亚洲一区二区3| 中文av一区二区| 日韩午夜av一区| 色偷偷久久人人79超碰人人澡| 久久av中文字幕片| 一区二区三区欧美| 精品欧美一区二区久久| 欧美伊人精品成人久久综合97| 国产综合色视频| 亚洲国产成人va在线观看天堂| 久久奇米777| 欧美肥妇毛茸茸| 色综合久久久久综合体桃花网| 免费精品视频在线| 亚洲永久免费视频| 国产精品国产成人国产三级| 精品国精品国产| 欧美日韩一区视频| 色综合天天在线| 成人午夜激情影院| 国产成人精品www牛牛影视| 秋霞电影一区二区| 亚洲成人动漫av| 亚洲综合免费观看高清完整版| 国产网红主播福利一区二区| 精品美女在线播放| 91麻豆精品国产自产在线 | 亚洲精品中文在线观看| 亚洲精品一区二区三区99| 欧美人与禽zozo性伦| 色成人在线视频| 99精品久久只有精品| 成人高清视频在线观看| 国产99久久久久久免费看农村| 久久99精品久久只有精品| 三级不卡在线观看| 天天影视网天天综合色在线播放 | 九九久久精品视频| 久久精品国产99国产| 日本特黄久久久高潮| 日韩成人一区二区三区在线观看| 亚洲国产精品久久久久秋霞影院| 《视频一区视频二区| 综合久久久久综合| 亚洲欧美另类久久久精品| 亚洲日本va午夜在线电影| 国产精品毛片无遮挡高清| 最新成人av在线| 一区二区三区精品视频| 一区二区三区在线视频观看58 | 亚洲成在线观看| 婷婷成人综合网| 美腿丝袜在线亚洲一区| 另类小说图片综合网| 极品少妇一区二区三区精品视频 | 日韩成人伦理电影在线观看| 日本视频在线一区| 国产综合色在线| 波多野洁衣一区| 欧美日韩激情一区二区三区| 5566中文字幕一区二区电影| 久久综合久久综合亚洲| 国产精品沙发午睡系列990531| 国产精品第13页| 亚洲h在线观看| 国产在线国偷精品免费看| 国产成人小视频| 91首页免费视频| 91精品国产91热久久久做人人| 久久视频一区二区| 日韩理论电影院| 日本女人一区二区三区| 懂色av一区二区三区蜜臀| 91久久香蕉国产日韩欧美9色| 91麻豆精品久久久久蜜臀| 欧美激情资源网| 亚洲国产精品视频| 国模套图日韩精品一区二区| 成人免费高清在线| 777久久久精品| 国产精品激情偷乱一区二区∴| 亚洲bt欧美bt精品| 国产91精品精华液一区二区三区| 91久久久免费一区二区| 久久久精品2019中文字幕之3| 亚洲精品欧美二区三区中文字幕| 美女www一区二区| 91成人在线精品| 久久精品男人的天堂| 午夜久久久久久久久久一区二区| 国产.欧美.日韩| 日韩亚洲欧美综合| 一区二区三区在线看| 国产黑丝在线一区二区三区| 欧美精品久久99| 亚洲欧洲三级电影| 精品一区二区三区日韩| 在线视频中文字幕一区二区| 国产女人18毛片水真多成人如厕 | 99亚偷拍自图区亚洲| 日韩欧美电影在线| 亚洲最大的成人av| 风间由美中文字幕在线看视频国产欧美 | 国产精品久久国产精麻豆99网站| 日本欧美加勒比视频| 欧美伊人精品成人久久综合97| 日韩免费性生活视频播放| 亚洲午夜精品久久久久久久久| 成人av综合在线| 久久看人人爽人人| 麻豆91免费观看| 91精品婷婷国产综合久久竹菊| 日韩一区欧美小说| 国产成+人+日韩+欧美+亚洲| 日韩免费高清视频| 日本不卡一区二区| 欧美美女黄视频| 亚洲国产精品久久人人爱| 日本高清视频一区二区| 国产精品水嫩水嫩| 国产成人8x视频一区二区| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 国产麻豆午夜三级精品| 欧美一级黄色录像| 欧美aaaaa成人免费观看视频| 欧美日韩和欧美的一区二区| 亚洲午夜三级在线| 欧美日韩国产首页| 偷拍一区二区三区四区| 欧美人与z0zoxxxx视频|