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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 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 頁
字號:
//-----------------------------------------------------------------------------
// Auto Baud with tracking core
//
// This file is part of the "auto_baud" project.
// http://www.opencores.org/
// 
//
// Description: See description below (which suffices for IP core
//                                     specification document.)
//
// Copyright (C) 2002 John Clayton and OPENCORES.ORG
//
// This source file may be used and distributed without restriction provided
// that this copyright statement is not removed from the file and that any
// derivative work contains the original copyright notice and the associated
// disclaimer.
//
// This source file is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation;  either version 2.1 of the License, or
// (at your option) any later version.
//
// This source is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
// License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this source.
// If not, download it from http://www.opencores.org/lgpl.shtml
//
//-----------------------------------------------------------------------------
//
// Author: John Clayton
// Date  : Aug. 20, 2002 Began project
// Update: Sep.  5, 2002 copied this file from "autobaud.v"
//                       Added tracking functions, and debugged them.
// Update: Sep. 13, 2002 Added test data.  Module complete, it works well.
//
// Description
//-----------------------------------------------------------------------------
// This is a state-machine driven core that measures transition intervals
// in a particular character arriving via rs232 transmission (i.e. PC serial 
// port.)  Measurements of time intervals between transitions in the received
// character are then used to generate a baud rate clock for use in serial
// communications back and forth with the device that originally transmitted
// the measured character.  The clock which is generated is in reality a
// clock enable pulse, one single clock wide, occurring at a rate suitable
// for use in serial communications.  (This means that it will be generated
// at 4x or 8x or 16x the actual measured baud rate of the received character.
// The multiplication factor is called "CLOCK_FACTOR_PP" and is a settable
// parameter within this module.  The parameter "CLOCK_FACTOR_PP" need not
// be a power of two, but it should be a number between 2 and 16 inclusive.)
//
// The particular character which is targeted for measurement and verification
// in this module is: carriage return (CR) = 0x0d = 13.
// This particular character was chosen because it is frequently used at the
// end of a command line, as entered at a keyboard by a human user interacting
// with a command interpreter.  It is anticipated that the user would press
// the "enter" key once upon initializing communications with the electronic
// device, and the resulting carriage return character would be used for 
// determining BAUD rate, thus allowing the device to respond at the correct
// rate, and to carry on further communications.  The electronic device using
// this "auto_baud" module adjusts its baud rate to match the baud rate of
// the received data.  This works for all baud rates, within certain limits,
// and for all system clock rates, within certain limits.
//
// Received serially, the carriage return appears as the following waveform:
// ________    __    ____          _______________
//         |__|d0|__|d2d3|________|stop
//        start   d1      d4d5d6d7
//
// The waveform is shown with an identical "high" time and "low" time for
// each bit.  However, actual measurements taken using a logic analyzer
// on characters received from a PC show that the times are not equal.
// The "high" times turned out shorter, and the "low" times longer...
// Therefore, this module attempts to average out this discrepancy by
// measuring one low time and one high time.
//
// Since the transition measurements must unavoidably contain small amounts
// of error, the measurements are made during the beginning 2 bits of
// the received character, (that is, start bit and data bit zero).
// Then the measurement is immediately transformed into a baud rate clock,
// used to verify correct reception of the remaining 8 bits of the character.
// If the entire character is not received correctly using the generated
// baud rate, then the measurement is scrapped, and the unit goes into an
// idle scanning mode waiting for another character to test.
//
// This effectively filters out characters that the unit is not interested in
// receiving (anything that is not a carriage return.)  There is a slight
// possibility that a group of other characters could appear by random
// chance in a configuration that resembles a carriage return closely enough
// that the unit might accept the measurement and produce a baud clock too
// low.  But the probability of this happening is remote enough that the
// unit is considered highly "robust" in normal use, especially when used
// for command entry by humans.  It would take a very clever user indeed, to
// enter the correct series of characters with the correct intercharacter
// timing needed to possibly "fool" the unit!
//
// (Also, the baud rate produced falls within certain limits imposed by
//  the hardware of the unit, which prevents the auto_baud unit from mistaking
//  a series of short glitches on the serial data line for a really
//  fast CR character.)
//
// This method of operation implies that each carriage return character
// received will produce a correctly generated baud rate clock.  Therefore,
// each and every carriage return actually causes a new baud rate clock to
// be produced.  However, updates occur smoothly, and there should be no
// apparent effect as an old BAUD clock is stopped and a new one started.
// The transition is done smoothly.
//
// For users who desire a single measurement at the beginning of a session
// to produce a steady baud clock during the entire session, there is a
// slightly smaller module called "auto_baud.v" which performs a single
// measurement, but which requires a reset pulse in order to begin measuring
// for a new BAUD rate.
//
// NOTES:
// - This module uses a counter to divide down the clk_i signal to produce the
//   baud_clk_o signal.  Since the frequency of baud_clk_o is nominally
//   CLOCK_FACTOR_PP * rx_baud_rate, where "rx_baud_rate" is the baud rate
//   of the received character, then the higher you make CLOCK_FACTOR_PP, the
//   higher the generated baud_clk_o signal frequency, and hence the lower the
//   resolution of the divider.  Therefore, using a lower value for the
//   CLOCK_FACTOR_PP will allow you to use a lower clk_i with this module.
// - To set LOG2_MAX_COUNT_PP, remember (max_count*CLOCK_FACTOR_PP)/Fclk_i
//   is the maximum measurement time that can be accomodated by the circuit.
//   (where Fclk_i is the frequency of clk_i, and 1/Fclk_i is the period.)
//   Therefore, set LOG2_MAX_COUNT_PP so that the maximum measurement time
//   is at least as long as 2x the baud interval of the slowest received
//   serial data (2x because there are two bits involved in the measurement!)
//   For example, for Fclk_i = 20MHz, CLOCK_FACTOR_PP = 4 and a minimum
//   baud rate of 115,200, you would calculate:
//
//   (max_count * CLOCK_FACTOR_PP)*1/Fclk_i >= 2/Fbaud_max
//
//   Solving for the bit width of the max_count counter...
//
//   LOG2_MAX_COUNT_PP >= ceil(log_base_2(max_count))
//
//                 >= ceil(log_base_2(2*Fclk_i/(Fbaud_max*CLOCK_FACTOR_PP)))
//
//                 >= ceil(log_base_2(2*20E6/(115200*4)))
//
//                 >= ceil(log_base_2(86.8))
//
//                 >= 7 bits.
//
// - In the above example, the maximum count would approach 87, which means
//   that a measurement error of 1 count is about (1/87)=approx. 1.15%.  This
//   is an acceptable level of error for a baud rate clock.  Notice that the
//   lower baud rates have an even smaller error percentage (Yes!) but that
//   they require a much larger measurement counter...  For instance,
//   to lock onto 300 baud using the same example above, would require:
//
//   LOG2_MAX_COUNT_PP >= ceil(log_base_2(40000000/1200))
//
//                     >= ceil(log_base_2(33333.3))
//
//                     >= ceil(15.024678)
//
//                     >= 16 bits.
//
// - If the percentage error for your highest desired baud rate is greater
//   than a few percent, you might want to use a higher Fclk_i or else a 
//   lower CLOCK_FACTOR_PP.
//
// - Using the default settings:  CLK_FACTOR_PP = 8, LOG2_MAX_COUNT_PP = 16
//   The following test results were obtained, using an actual session in
//   hyperterm, looking for correct readable character transmission both
//   directions.  (Note: These tests were performed at "human interface"
//   speeds.  High speed or "back-to-back" character transmission might
//   exhibit worse performance than these results.)
//
//   Clk_i
//   Freq.
//   (MHz)    110    300    1200   2400   4800   9600   19200  57600  115200
//   ------  ---------------------------------------------------------------
//   98       FAIL   pass   pass   pass   pass   pass   pass   pass   pass
//   55       FAIL   pass   pass   pass   pass   pass   pass   pass   pass
//   49       pass   pass   pass   pass   pass   pass   pass   pass   pass
//   24.5     pass   pass   pass   pass   pass   pass   pass   pass   FAIL
//   12       pass   pass   pass   pass   pass   pass   pass   pass   FAIL
//    6       pass   pass   pass   pass   pass   pass   pass   FAIL   FAIL
//    3       pass   pass   pass   pass   pass   FAIL   FAIL   FAIL   FAIL
//    1.5     pass   pass   pass   pass   FAIL   FAIL   FAIL   FAIL   FAIL
//
//
//-------------------------------------------------------------------------------------

`define LOG2_MAX_CLOCK_FACTOR 4  // Sets the size of the CLOCK_FACTOR
                                 // prescaler.
`define BITS_PER_CHAR         8  // Include parity, if used, but not
                                 // start and stop bits...

// Note: Simply changing the template bits does not reconfigure the
//       module to look for a different character (because a new measurement
//       window would have to be defined for a different character...)
//       The template bits are the exact bits used during verify, against
//       which the incoming character is checked.
//       The LSB of the character is discarded, and the stop bit is appended
//       since it is the last bit used during verify.
//
// so, for N:8:1 (no parity, 8 data bits, 1 stop bit) it is:
//                         = {1,(character>>1)} = 9'h086
// or, with parity included it is:
//                         = {1,parity_bit,(character>>1)} = 9'h106
//
`define TEMPLATE_BITS     9'h086  // Carriage return && termination flag


module auto_baud_with_tracking
  (
  clk_i,
  reset_i,
  serial_dat_i,
  auto_baud_locked_o,
  baud_clk_o
  );


// Parameters

// CLOCK_FACTOR_PP can be from [2..16] inclusive.
parameter CLOCK_FACTOR_PP = 8;     // Baud clock multiplier
parameter LOG2_MAX_COUNT_PP = 16;  // Bit width of measurement counter

// State encodings, provided as parameters
// for flexibility to the one instantiating the module.
// In general, the default values need not be changed.

// There is one state machines: m1.
// "default" state upon power-up and configuration is:
//    "m1_idle" because that is the all zero state.

parameter m1_idle          = 4'h0;  // Initial state (scanning)
parameter m1_measure_0     = 4'h1;  // start bit     (measuring)
parameter m1_measure_1     = 4'h2;  // debounce      (measuring)
parameter m1_measure_2     = 4'h3;  // data bit 0    (measuring)
parameter m1_measure_3     = 4'h4;  // debounce      (measuring)
parameter m1_measure_4     = 4'h5;  // measurement done (headed to verify)
parameter m1_verify_0      = 4'h8;  // data bit 1    (verifying)
parameter m1_verify_1      = 4'h9;  // data bit 2    (verifying)
parameter m1_run           = 4'h6;  // running
parameter m1_verify_failed = 4'h7;  // resetting   (headed back to idle)

// I/O declarations
input clk_i;                 // System clock input
input reset_i;               // Reset signal for this module
input serial_dat_i;          // TTL level serial data signal

output auto_baud_locked_o;   // Indicates BAUD clock is being generated
output baud_clk_o;           // BAUD clock output (actually a clock enable)


// Internal signal declarations
wire mid_bit_count;       // During measurement, advances measurement counter
                          // (Using the mid bit time to advance the
                          //  measurement timer accomplishes a timing "round"
                          //  so that the timing measurement is as accurate
                          //  as possible.)
                          // During verify, pulses at mid bit time are used
                          // to signal the state machine to check a data bit.
wire main_count_rollover;       // Causes main_count to reset
wire baud_count_rollover;       // Causes baud_count to reset
wire clock_count_rollover;      // Causes clock_count to reset
                                // (when clock_count is used as a 
                                //  clock_factor prescaler)
wire enable_clock_count;        // Logic that determines when clock_count
                                // should be counting
wire verify_done;               // Indicates finish of verification time

reg idle;                 // Indicates state
reg measure;              // Indicates state
reg clear_counters;       // Pulses once when measurement is done.
reg verify;               // Indicates state
reg verify_good;          // Indicates successful verify (pulse)
reg character_miscompare; // Indicates character did not verify
reg run;                  // flip-flop that indicates a valid output
                          // is being generated.
reg [`LOG2_MAX_CLOCK_FACTOR-1:0] clock_count; // Clock_factor prescaler,
                                              // and mid_bit counter.
reg [LOG2_MAX_COUNT_PP-1:0] main_count;       // Main counter register
reg [LOG2_MAX_COUNT_PP-1:0] baud_count;       // BAUD counter register
reg [LOG2_MAX_COUNT_PP-1:0] measurement;      // measurement for verify
reg [LOG2_MAX_COUNT_PP-1:0] baud;             // measurement for running
reg [`BITS_PER_CHAR:0] target_bits;           // Character bits to compare
// (lsb is not needed, since it is used up during measurement time,
//  but the stop bit and possible parity bit are needed.)

    // For the state machine
reg [3:0] m1_state;
reg [3:0] m1_next_state;



//--------------------------------------------------------------------------
// Instantiations
//--------------------------------------------------------------------------


//--------------------------------------------------------------------------
// Module code
//--------------------------------------------------------------------------

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产综合久久久久| 欧美精品一区二区三区久久久| 欧美日韩在线免费视频| 欧美变态tickling挠脚心| 国产精品嫩草99a| 奇米色一区二区| 成av人片一区二区| 欧美不卡在线视频| 亚洲一区二区精品3399| 国产精品18久久久久久久久| 日本丶国产丶欧美色综合| 久久精品这里都是精品| 亚洲va欧美va天堂v国产综合| 国产精品影音先锋| 日韩一区二区三区在线| 亚洲精品视频一区| av在线综合网| 精品va天堂亚洲国产| 视频一区欧美精品| 色偷偷成人一区二区三区91 | 久久久久久久久久久久久女国产乱 | 26uuu成人网一区二区三区| 一区二区三区丝袜| 成人久久视频在线观看| 久久久综合激的五月天| 久久电影网电视剧免费观看| 国产婷婷一区二区| 欧美aaaaa成人免费观看视频| 欧美在线观看禁18| 亚洲色图19p| 91美女精品福利| 亚洲欧洲性图库| 成人国产精品免费观看视频| 久久精品欧美一区二区三区不卡 | 欧美另类变人与禽xxxxx| 亚洲免费av观看| 99久久er热在这里只有精品15| 久久久噜噜噜久久人人看 | 樱花影视一区二区| 99久久99久久免费精品蜜臀| 国产精品动漫网站| 波多野结衣中文一区| 国产日韩亚洲欧美综合| 国产福利视频一区二区三区| 久久午夜电影网| 懂色av一区二区在线播放| 中文字幕av在线一区二区三区| 成人性视频网站| 1区2区3区国产精品| 色综合久久中文字幕| 一区二区三区高清| 欧美日韩亚州综合| 日韩国产欧美视频| 2021国产精品久久精品| 国产成人免费视频一区| 亚洲欧洲日韩在线| 欧美丝袜自拍制服另类| 日本视频在线一区| 久久综合九色综合97婷婷 | 处破女av一区二区| 伊人色综合久久天天人手人婷| 亚洲国产精品99久久久久久久久| 国产在线不卡视频| 国产精品成人免费在线| 在线视频欧美区| 玖玖九九国产精品| 中文字幕在线不卡一区二区三区| 日本乱码高清不卡字幕| 免费不卡在线视频| 中文字幕av免费专区久久| 91久久一区二区| 蜜桃av一区二区在线观看| 欧美经典一区二区| 欧美在线免费视屏| 韩国一区二区在线观看| |精品福利一区二区三区| 欧美巨大另类极品videosbest | 制服.丝袜.亚洲.另类.中文| 国产麻豆欧美日韩一区| 一卡二卡三卡日韩欧美| 精品国偷自产国产一区| 色欧美88888久久久久久影院| 麻豆精品视频在线| 亚洲免费伊人电影| 日韩精品一区二区三区视频在线观看 | 久久尤物电影视频在线观看| 色婷婷亚洲婷婷| 国产九色sp调教91| 日韩精品免费视频人成| 国产精品你懂的在线欣赏| 日韩一区国产二区欧美三区| 99re热视频精品| 国产一区二区看久久| 亚洲va欧美va人人爽| 亚洲欧美综合另类在线卡通| 欧美精品一区二区三区很污很色的 | 欧美在线视频日韩| 高清日韩电视剧大全免费| 日本美女视频一区二区| 亚洲激情在线激情| 国产片一区二区三区| 日韩欧美在线1卡| 欧美三区在线观看| eeuss鲁一区二区三区| 国产在线看一区| 美女网站视频久久| 日韩**一区毛片| 一区二区三区四区视频精品免费| 国产精品天美传媒| 久久综合视频网| 欧美变态tickling挠脚心| 欧美福利视频导航| 欧美三级日本三级少妇99| 91猫先生在线| 97久久超碰精品国产| 成人av在线网站| 高清在线不卡av| 成人白浆超碰人人人人| 国产成人av电影在线播放| 国模大尺度一区二区三区| 精品一区二区三区在线观看国产| 婷婷国产在线综合| 日精品一区二区三区| 天天影视网天天综合色在线播放| 亚洲一区二区三区在线| 亚洲一区二区四区蜜桃| 香蕉成人伊视频在线观看| 亚洲电影中文字幕在线观看| 亚洲国产另类av| 亚洲18色成人| 蜜桃视频一区二区| 国产乱子轮精品视频| 国产精品中文字幕日韩精品| 国产毛片精品视频| 国产福利精品一区二区| 不卡在线视频中文字幕| 91视频.com| 欧美视频在线不卡| 91麻豆精品国产91久久久更新时间| 91精品在线一区二区| 久久影院午夜片一区| 国产日韩欧美精品一区| 成人免费在线观看入口| 一区二区三区电影在线播| 日韩精品成人一区二区三区 | 日韩av午夜在线观看| 国产精品亚洲午夜一区二区三区| 风间由美性色一区二区三区| 一本一道久久a久久精品综合蜜臀| 欧美四级电影网| 精品久久久久一区| 中文字幕av一区 二区| 亚洲成人一区二区在线观看| 久久国产精品一区二区| 成人av资源下载| 欧美精品在线观看一区二区| 精品国产成人在线影院| 亚洲三级视频在线观看| 日韩va欧美va亚洲va久久| 国产凹凸在线观看一区二区| 日本韩国欧美在线| 精品久久久久久久久久久久包黑料 | 91首页免费视频| 欧美一区二区三区白人| 国产精品久久久久久久久免费樱桃 | 五月天网站亚洲| 岛国一区二区三区| 在线电影院国产精品| 欧美韩国日本一区| 婷婷六月综合亚洲| 99国产麻豆精品| 2023国产精品自拍| 亚洲va欧美va国产va天堂影院| 国产伦理精品不卡| 欧美一区二区成人| 亚洲精品国产第一综合99久久| 激情欧美一区二区三区在线观看| 欧美在线观看你懂的| 亚洲国产岛国毛片在线| 蜜桃传媒麻豆第一区在线观看| 色综合天天性综合| 国产拍欧美日韩视频二区| 青草av.久久免费一区| 99视频有精品| 久久久国产一区二区三区四区小说| 亚洲高清免费在线| 91蝌蚪porny成人天涯| 久久久久国产精品人| 热久久一区二区| 欧美日韩国产成人在线免费| 亚洲欧美在线视频观看| 国产91精品露脸国语对白| 精品久久久久av影院 | 久久99最新地址| 69堂精品视频| 午夜日韩在线电影| 欧美中文字幕亚洲一区二区va在线| 国产精品久久久久久久久快鸭 | 国产一区二区三区在线观看免费| 欧美日韩一区在线观看|