Asynchronous And Synchronous Transmission
Asynchronous and Synchronous Transmission (RS-232 Example)
Serial communication is a method of transmitting data one bit at a time over a single data line. It can be done asynchronously or synchronously, each with its own characteristics and use cases.
Asynchronous Transmission (RS-232)
Asynchronous transmission, often used in RS-232 communication, involves sending data without using a continuous clock signal. Each data byte is framed with start and stop bits for synchronization. Key components include:
- Start Bit: A low-level start bit indicates the beginning of a data byte.
- Data Bits: The actual data bits being transmitted (typically 7 or 8 bits per byte).
- Parity Bit: An optional bit for error checking.
- Stop Bit(s): One or two high-level stop bits indicate the end of the data byte.
Synchronous Transmission
Synchronous transmission uses a continuous clock signal to keep sender and receiver synchronized. This eliminates the need for start and stop bits. Key components include:
- Clock Signal: A continuous clock signal synchronizes the data transmission.
- Data Frame: The data is sent in continuous frames without start or stop bits.
- Less Overhead: Without start and stop bits, synchronous transmission can be more efficient.
RS-232 Communication
RS-232 is a standard for serial communication between devices. It uses voltage levels to represent binary data. In RS-232 communication, asynchronous transmission involves the following:
- Start Bit: A low-level start bit indicates the beginning of a data byte.
- Data Bits: The actual data bits being transmitted (typically 7 or 8 bits per byte).
- Parity Bit: An optional bit for error checking.
- Stop Bit(s): One or two high-level stop bits indicate the end of the data byte.
Parity Bit
The parity bit is used for error detection in asynchronous communication. It's set to ensure that the total number of bits set to 1 in the data byte (including the parity bit) is either even (even parity) or odd (odd parity). If the actual count doesn't match the expected count, an error is detected.
Parity Bit Example (Even and Odd Parity)
In asynchronous serial communication, a parity bit is used for error detection. The parity bit is set to ensure that the total number of bits set to 1 in the data byte (including the parity bit) is either even (even parity) or odd (odd parity).
Let's consider a simple example using 8-bit data and even/odd parity.
Even Parity Example:
Suppose we want to send the data 0110011
with even parity.
- Count the number of ones in the data: There are 4 ones.
- Since even parity is desired, we need to make the total number of ones (data bits + parity bit) even. Since there are 4 ones, we need to add 1 more bit to make it even.
- Add the parity bit at the end:
01100111
(even parity)
Odd Parity Example:
Now let's consider sending the same data 0110011
with odd parity.
- Count the number of ones in the data: There are 4 ones.
- Since odd parity is desired, we need to make the total number of ones (data bits + parity bit) odd. Since there are 4 ones, we don't need to add an extra bit.
- Add the parity bit at the end:
01100110
(odd parity)
In both examples, the parity bit is used to adjust the total number of ones to match the desired parity (even or odd). If the received data does not have the expected number of ones based on the parity bit, an error is detected.
Keep in mind that while parity can help detect some errors, it's not foolproof and is not widely used in modern communication systems. More advanced error detection and correction methods are typically employed for greater reliability.
Transmission Rate (Baud Rate)
The transmission rate, also known as the baud rate, indicates how many signal changes (bits) occur per second. It's often expressed in bits per second (bps).
Bit Rate vs. Useful Bit Rate vs. Efficiency
- Bit Rate (bps): The number of bits transmitted per second, including start, data, parity, and stop bits.
- Useful Bit Rate (bit/s): The number of actual data bits transmitted per second (data bits only).
- Efficiency (%): The ratio of useful bit rate to bit rate, expressed as a percentage.
For example:
- Bit Rate: 9600 bps (including all bits)
- Data Bits: 8 bits per byte
- Parity Bit: None
- Stop Bits: 1 bit
- Useful Bit Rate: 9600 * 8 / 10 = 7680 bit/s
- Efficiency: (7680 / 9600) * 100% = 80%
Remember that RS-232 is just one example of asynchronous serial communication. Other standards and protocols exist for serial communication, each with its own characteristics and use cases.
Synchronous serial communication offers advantages in certain applications due to its continuous clock signal and reduced overhead. Asynchronous and synchronous transmission each have their own strengths and trade-offs, making them suitable for different scenarios.