您的当前位置:首页正文

异步和同步数据通信的区别及特点

来源:华佗健康网


Asynchronous and Synchronous Data Transmission异步和同步数据通信

Over longer distances we use serial transmission either in an asynchronous or synchronous transmission mode. Serial transmission over long distance requires that the timing information for the receiver be transmitted together with the data so that a separate clock signal is not required.

在长距离,我们用异步或同步传输模式进行串行传输。由于接受者需要定时信息,长距离的串行传输为了避免单独传时钟信号需要把定时信息和数据一起传输。

In asynchronous transmission only a small number of bits are transmitted at a time, usually 8 bits that correspond to one ASCII character. In the beginning of each block of 8 bits of data, a start bit is sent to indicate to the receiver that it should prepare to receive 8 bits of data (see Figure 6.2). For synchronization the receiver has to know the data rate, which has to be set in advance, so that when it detects the start bit it is able to receive the few following bits. After these bits a

stop bit is sent that terminates the 8-bit data block. The next block of data is

synchronized independently with the help of a new start bit preceding the data bits.

在异步传输时,在同一时候只有一小数量二进制位被传输,通常8位对应着一个ASCII字符。在每个8位数据的前面,一个开始位被发送以暗示接收端要准备接收8位数据(如图6.2)。对于同步传输时,接收者必须要提前知道数据速率,然后当它发现开始位时,它才能接收接着的二进制位。最后会在8位数据后面加一个停止位来结束。接着下一个数据以新的开始位开始独立的同步传输。

In asynchronous transmission, a simple error-detecting scheme called parity can be used. We may use even or odd parity error checking. If even parity is used, the total number of “1” bits in the block, including data bits and the parity bit, is set to be even with the help of the parity bit. In the case of odd parity, the parity bit is set to “1” or “0” so that the total number of“1” bits in the block is odd. To detect possible transmission errors, the receiver determines whether the received number of “1” bits is even or odd depending on the parity agreed. We will see later that this parity check method is a simple example of a data link layer protocol.

在异步传输时,一个简单的错误发现原来叫做奇偶校验被运用。我们可以用奇或偶校验来对错误进行检查。假如用偶校验,1的总数包括数据位和奇偶校验位将放在这个块中,奇偶校验位的值决定要把其设置为偶数。假如是奇校验,奇偶校验位将被设置为1或0,使这个块的奇偶为奇。为了检查可能传输中出现的错误,接收端将检查接收到的1的位的奇偶是否符合奇偶校验。我们稍候将从一个简单得数据链路层协议中知道奇偶校验的方法。

Asynchronous transmission is used for the transmission of ASCII characters in conventional terminal–mainframe computer communications. For larger information blocks it is used in some file transfer protocols such as KERMIT and X-LINK. In these protocols special “start of block” characters are sent at the beginning. Then information follows as asynchronous words and at the end special “end of block” characters are sent.

Synchronous transmission is a more modern principle for transmitting a large amount of information in a frame (see Figure 6.2). Each frame starts with a special start-of-frame bit sequence and the frame may contain more than 1,000 bytes of

information. Each frame also contains error control words and an end-of-frame sequence. The receiver uses the error control section of the frame to detect if errors have occurred in transmission. The most common detection method for error detection is a cyclic redundancy check (CRC). It is much more reliable than the parity check method discussed previously. In the case of errors the transmitter retransmits the frame in error. In the most common protocols the receiver sends an acknowledgment to the transmitter in the other transmission direction for received error-free frame or frames. If errors have occurred, the frame is not acknowledged in a predefined period of time and the transmitter sends it again.

In asynchronous transmission the start bit provided the required timing information for each byte of data. Most synchronous transmission methods are so-called “bit-oriented” protocols in which data blocks are not divided into separate bytes because many types of information, such as graphics, is not presented as a set of bytes. Unique start-of-frame and endof-frame sequences or flags are used to provide frame synchronization. These flags should be unique and actual data must not include similar data sequences. One common method used to avoid frame misalignment is to use bit stuffing or zero insertion, as shown in Figure 6.3. Consider a flag (01111110) used in the popular high-level data link control (HDLC) protocol. After the start-of-frame flag the sequence of six

subsequent 1’s is not allowed in the data section of the frame. To avoid that, a 0 is inserted in the end of each sequence of five subsequent 1’s. In the receiver each 0 following five subsequent 1’s is discarded. If binary 1 follows five subsequent 1’s, the frame is declared to be finished (end-of-frame flag).

因篇幅问题不能全部显示,请点此查看更多更全内容