Module 2
Module 2
1. Single-bit Error: A single bit in the data frame is altered from its original value (e.g., from 0
to 1 or vice versa). This is one of the simplest forms of error and is typically easy to detect.
2. Burst Error: A group of bits in a data frame is altered in such a way that multiple bits are
affected. This often occurs due to noise or other interference over a short period of time.
Burst errors are more complex to detect and require advanced techniques.
3. Drop/Deletion Error: Entire data packets or frames are lost during transmission, leading to
gaps in the data.
4. Insertion Error: Extra bits are inserted into the data stream during transmission. These bits
could be random or artificially introduced by noise or system errors.
Redundancy in Data Communication
Redundancy is the inclusion of extra bits or information to protect against errors in data
transmission. The main goal of redundancy is to ensure that if an error occurs during
transmission, it can be detected and potentially corrected.
Types of Redundancy:
a. Temporal Redundancy: This involves retransmitting the same data multiple times to
reduce the chances of data loss due to errors. Protocols like ARQ (Automatic Repeat
reQuest) utilize temporal redundancy to ensure reliability.
b. Spatial Redundancy: Multiple copies of the data are transmitted over different
channels. This is often used in error-prone environments (e.g., wireless
communication).
Error Detection vs. Error Correction
When errors occur, two strategies can be employed to ensure data integrity: Error Detection and
Error Correction.
Error Detection: Error detection involves identifying that an error has occurred in the received data.
Once an error is detected, the system may request a retransmission of the data. Some common
methods of error detection include:
a. Parity Check: A parity bit is added to the data, making the number of 1s either odd (odd
parity) or even (even parity). It’s a simple form of error detection.
b. Checksums: A checksum is a value derived from the sum of the data's bits. If the
checksum calculated on the received data doesn’t match the transmitted checksum, an
error is detected.
c. Cyclic Redundancy Check (CRC): A more sophisticated error detection technique that
treats the data as a large polynomial and divides it by a predetermined "generator"
polynomial. CRCs are widely used in protocols like Ethernet and Wifi.
● Error detection doesn’t fix the error, but it identifies its occurrence so that corrective action (like
retransmission) can be taken.
Error Correction: Error correction involves not only detecting the error but also fixing the
erroneous data. Some well-known error correction methods include:
1. Hamming Code: A type of linear block code that adds redundancy bits to the data, allowing
both detection and correction of single-bit errors.
2. Reed-Solomon Codes: Used widely in CDs, DVDs, QR codes, and wireless communication.
They are capable of correcting multiple errors within a block of data by adding sufficient
redundancy.
3. Turbo Codes: These are advanced error correction codes used in modern wireless
communications, including cellular networks, to provide very high error correction capabilities
with minimal overhead.
● Error correction is generally more complex and resource-intensive than error detection but
can be crucial in scenarios where retransmissions are not feasible or would incur significant
delay (e.g., satellite communication).
Coding Techniques
Coding refers to the method of adding redundancy to data in a way that enables error detection
and correction. Some common coding techniques include:
1. Block Codes: These are codes where a block of data (typically a fixed number of bits) is
encoded into a larger block of data that includes both the original data and the redundant
bits. The most common types of block codes are:
a. Hamming Code: It is a class of error-correcting codes that can correct single-bit errors
and detect two-bit errors. It adds parity bits to a block of data to enable error correction.
For example, for a 4-bit data word, a 7-bit code word is created with 3 parity bits.
b. Reed-Solomon Code: This is a type of block code that adds a number of extra parity
symbols to a block of data, allowing multiple errors to be corrected. It’s widely used in
systems like CDs, DVDs, and QR codes.
2. Convolutional Codes: Unlike block codes, convolutional codes process data in a continuous stream.
Convolutional coding involves encoding each bit of data with the previous bits, generating a sequence of
output symbols. This type of coding is commonly used in real-time applications like satellite and mobile
communications, as it offers both error detection and correction.
3. Turbo Codes: Turbo codes are used in advanced communication systems for error correction. They
combine two or more convolutional codes and interleave them, improving error-correction performance.
Turbo codes are commonly used in 3G and 4G wireless technologies.
4. LDPC (Low-Density Parity-Check) Codes: These are a class of error-correcting codes that are
known for their excellent performance, especially in high-speed networks. LDPC codes are used in
modern communication standards like Wi-Fi (802.11n/ac/ax) and satellite communication.
5. FEC (Forward Error Correction): Forward Error Correction is a technique where the sender encodes
the data with redundancy before transmission. The receiver uses this redundant data to detect and
correct errors without needing a retransmission. It is highly beneficial in situations where retransmissions
are costly or time-sensitive, such as in video streaming, satellite communication, or VoIP.
Error Detection Using Block Coding
Divide the message into blocks: The original message is divided into blocks of data of size k bits (called
datawords). Then, r redundant bits are added to each block to form n-bit codewords (where n=k+r).
Construct valid codewords: Each block of data (the dataword) is encoded with the redundant bits, forming a
codeword. A codeword is a valid sequence of bits (n bits) according to a specific error-detection or error-
correction scheme. These valid codewords are part of a codebook, which the receiver can reference to check if
the received data is valid.
Error detection: When the receiver receives a block of data (a codeword), they can perform the following checks:
1) Check if the codeword is valid: The receiver compares the received codeword to the list of valid
codewords (the codebook). If the received codeword is part of the codebook, it is considered valid, and no
error is assumed. However, if the received codeword is not in the codebook, it means an error has occurred
during transmission, as the original codeword has likely changed.
2) Use of redundancy: The redundancy (extra bits added during encoding) helps in the error detection
process. If an error has flipped one or more bits in the received codeword, the codeword will no longer match
any valid codewords in the codebook, thereby signaling an error. For example, in a (7,4) block code, the
receiver can detect whether a transmitted codeword differs from any valid codeword in the list. If it does, an
error has occurred.
Error Detection Conditions:
1. The receiver has (or can find) a list of valid codewords:
● The receiver needs to know the set of valid codewords for the specific block code being used.
This set of valid codewords is typically pre-defined and could be known in advance, or the
receiver could calculate the valid codewords using a generator matrix (for linear block codes).
● The receiver can use the list of valid codewords to compare the received codeword and
determine whether it is a valid codeword or not.
Codebook Example:
Suppose we use a (7,4) block code where each 4-bit dataword is encoded into a 7-bit codeword. Here are some examples of valid
codewords in the codebook:
● 0000000
● 1110000
● 0001111
● 1111111
Let's assume that the receiver receives a codeword 0001000. To detect if this is an error:
1. Receiver checks the list of valid codewords: The receiver compares the received codeword 0001000 with the valid
codewords:
○ 0000000
○ 1110000
○ 0001111
○ 1111111
2. Since 0001000 is not part of the valid codewords, the receiver concludes that an error has occurred.
3. Detection process: The error could be due to a bit flip or transmission issue, but the key point is that the receiver is able to
detect the error because the received codeword is invalid.
Conditions for Error Detection:
● Valid Codewords List: The receiver must have access to or be able to derive the list of valid codewords. Without this list, the
receiver cannot verify the correctness of the received codeword.
● Change to Invalid Codeword: If the original codeword changes due to errors in transmission, it will no longer match any valid
codewords. The receiver uses this to detect that an error has occurred. For instance, if the codeword 0000000 is transmitted
and one of its bits changes, such as 0001000, the receiver can tell it’s no longer a valid codeword and flag an error.
Process of Error Detection in Block Coding
Error detection in block coding involves verifying whether a transmitted codeword has been altered during
transmission. Block coding works by dividing the message into fixed-size blocks (called datawords), then
encoding each block by adding redundant bits to form a longer codeword. This added redundancy allows
for the detection of errors that may have occurred during transmission.
Here’s a detailed step-by-step explanation of how error detection works in block coding:
● Step 1: The original message is divided into blocks of k bits. Each of these blocks is known as a
dataword.
○ Example: Suppose the message is 101101, which is 6 bits long. We might divide this into two
3-bit datawords:
■ Dataword 1: 101
■ Dataword 2: 101
● Step 2: Redundant bits (also known as parity bits or check bits) are added to each block of data to create the
corresponding codeword. The number of redundant bits is r, and the total length of the codeword will be n=k+r.
○ The redundancy is added to enable the receiver to detect errors.
○ For instance, using a simple parity check or more sophisticated error-detecting codes like Hamming Code,
Cyclic Redundancy Check (CRC), etc., we ensure the codeword will have a predefined structure that can be
checked.
○ Example: In a (7,4) block code:
■ Original 4-bit dataword: 1010
■ After adding 3 redundant bits (to make it a 7-bit codeword): 1010110
○ The codeword now contains the original 4 data bits and 3 redundant bits that help detect errors during
transmission.
2. Transmission of Codewords
● The encoded codewords are transmitted over a communication channel. During transmission, the codeword may
suffer from errors like bit flips (where 0 becomes 1 or vice versa) due to noise, interference, or other transmission
issues.
● Example: The codeword 1010110 might be corrupted during transmission and received as 1010010.
3. Receiving the Codeword
● The receiver gets the transmitted codeword and needs to determine whether it is the same as the original
transmitted codeword or if it has been altered by noise or interference.
● The received codeword will be checked against the list of valid codewords (or through a check calculation) to
determine if it has been corrupted.
4. Error Detection
Error detection involves checking the received codeword for validity. The receiver uses the redundancy (parity or other error-
checking mechanisms) to identify errors. If any bit of the codeword has been flipped or altered, the receiver will detect it based on the
following methods:
The receiver can compare the received codeword to a list of valid codewords (which were generated in the encoding process). If the
received codeword matches one of the valid codewords, it is considered error-free. If it does not match, an error is detected.
● Example:
○ Valid codewords: 1010110, 1100110, 0110110
○ Received codeword: 1010010
○ Since 1010010 does not match any valid codewords in the list, an error is detected.
b) Parity Check (or Similar Check)
● A parity bit is added to ensure the number of 1's in the codeword is even or odd (depending on the scheme used).
● The receiver counts the number of 1's in the received codeword and checks whether it satisfies the required parity condition. If the parity is
incorrect, an error has occurred.
● Example (Even Parity):
○ Suppose the codeword 1010110 is transmitted with even parity.
○ The number of 1's in 1010110 is 4 (even).
○ If the codeword is received as 1010010, the number of 1's is 3 (odd), meaning the received codeword does not satisfy the even
parity check.
○ Therefore, an error is detected.
● In more advanced error-detection techniques like CRC, a checksum or CRC value is calculated based on the bits in the codeword before
transmission. This value is included with the transmitted data. When the receiver receives the data, it recalculates the checksum or CRC
based on the received codeword. If the calculated checksum/CRC matches the transmitted value, the codeword is considered valid.
Otherwise, an error is detected.
● After performing the error detection procedure, the receiver makes a decision:
1. Valid codeword: If the received codeword is valid (matches the list of valid codewords or passes the parity/checksum test), it is
accepted as the correct codeword, and the message is decoded.
2. Invalid codeword: If the received codeword does not match any valid codewords (or fails the parity/checksum test), an error is
detected, and the receiver may request a retransmission of the codeword (depending on the protocol used).
Hamming Distance
Hamming distance is a measure of the difference between two strings of equal length. Specifically, it
counts the number of positions at which the corresponding symbols (or bits) are different. In the context
of error detection and correction, Hamming distance is used to determine how different two codewords
are from each other. It plays a crucial role in assessing how many bit errors can be detected or corrected.
Formula:
For two binary codewords, C1 and C2, the Hamming distance, denoted as d(C1,C2) is defined as the
number of positions where the corresponding bits are different.
● Codeword 1: 1010101
● Codeword 2: 1001001
● Even Parity: The total number of 1s in the codeword (including the parity bit) is made even.
● Odd Parity: The total number of 1s in the codeword (including the parity bit) is made odd.
The main purpose of a parity check code is to detect single-bit errors. If a single bit is flipped during
transmission, the receiver can detect it because the parity condition (even or odd) will no longer be
satisfied.
Encoder for Simple Parity Check Code
Let’s start with a simple example using even parity. We'll encode a 4-bit dataword (which could be any 4-bit number) by adding one
parity bit.
1101 1 11011
1010 0 10100
0111 1 01111
0000 0 00000
Decoder for Simple Parity Check Code
The decoder’s job is to check whether the received codeword has an even number of 1s (if using even
parity) or an odd number of 1s (if using odd parity). If the parity condition is violated, the receiver knows
that an error has occurred.