Error Detection Topics : Parity Check

 


How can the simple parity bit detect a damaged data unit? 

The simple parity bit can detect a damaged data unit by ensuring that the total number of bits set to 1 (or sometimes 0, depending on the parity system) in the data unit, including the parity bit itself, is either even or odd. Here's how it works:

  1. Adding Parity Bit: Before transmission, a parity bit is added to the data unit. This parity bit is calculated based on the current state of the data unit. If using even parity, the parity bit is set so that the total number of 1-bits in the data unit (including the parity bit) is even. If using odd parity, the parity bit is set so that the total number of 1-bits in the data unit (including the parity bit) is odd.

  2. Transmission: The data unit, along with the parity bit, is transmitted.

  3. Reception: Upon reception, the receiving system recalculates the parity of the received data unit, including the received parity bit.

  4. Error Detection: If the recalculated parity doesn't match the expected parity (even or odd, depending on the chosen parity system), it indicates that an error has occurred in transmission. This error could be due to a single-bit flip in the data unit or in the parity bit itself.

  5. Error Handling: When an error is detected, the receiving system can request retransmission of the data unit to ensure accurate transmission.

So, if a single bit in the data unit (or in the parity bit) is flipped during transmission, it will result in an incorrect parity when received, allowing the receiving system to detect the error. However, it's important to note that simple parity checking can only detect single-bit errors and is not capable of correcting them.


What is the difference between even parity and odd parity?

The difference between even parity and odd parity lies in how the parity bit is set to ensure that the total number of bits (including the parity bit) is either even or odd.

  1. Even Parity: In even parity, the parity bit is set so that the total number of bits set to 1 (or 0) in the data unit, including the parity bit, is even. This means that if the data unit already has an even number of 1s (or 0s), the parity bit is set to 0 (or 1) to maintain the even count. If the data unit has an odd number of 1s (or 0s), the parity bit is set to 1 (or 0) to make the total count even.

  2. Odd Parity: In odd parity, the parity bit is set so that the total number of bits set to 1 (or 0) in the data unit, including the parity bit, is odd. This means that if the data unit already has an odd number of 1s (or 0s), the parity bit is set to 0 (or 1) to maintain the odd count. If the data unit has an even number of 1s (or 0s), the parity bit is set to 1 (or 0) to make the total count odd.

In both cases, the purpose of the parity bit is to provide a simple mechanism for detecting single-bit errors during data transmission or storage. The choice between even and odd parity depends on the specific requirements of the system and the desired error detection capabilities.


Discuss the two-dimensional parity check and the types of errors it can and cannot detect

Two-dimensional parity check is an extension of the simple parity check method, but instead of adding just one parity bit, it adds parity bits both horizontally and vertically to create a matrix-like structure. This method is particularly useful in detecting errors in two dimensions, such as in data stored on a disk or transmitted in blocks.

Here's how it works:

  • Horizontal Parity: Parity bits are added to each row of data. The parity bit for each row is calculated so that the total number of 1s in that row, including the parity bit, is either even or odd, depending on the chosen parity system (even or odd).

  • Vertical Parity: Parity bits are added to each column of data. Similar to horizontal parity, the parity bit for each column is calculated based on the total number of 1s in that column, including the parity bit.

This creates a matrix of parity bits alongside the original data. During transmission or storage, if any bit is flipped, it will cause a mismatch in the parity bits, allowing for error detection.

Types of Errors Detected:

  • Single-bit errors in data: Just like simple parity check, two-dimensional parity can detect single-bit errors in the data.
  • Single-bit errors in parity bits: It can also detect single-bit errors in the parity bits themselves.
  • Burst errors along a single row or column: If multiple bits are flipped within a single row or column, the parity checks for that row or column will fail, allowing the detection of these burst errors.

Types of Errors it Cannot Detect:

  • Burst errors spanning multiple rows and columns: Two-dimensional parity check is not effective at detecting burst errors that affect multiple rows and columns simultaneously. If the errors are spread out, they may not be caught by the parity checks.

Despite its effectiveness in detecting certain types of errors, two-dimensional parity check has limitations, especially in detecting burst errors that affect multiple rows and columns. It's often used in combination with other error detection and correction techniques for more robust data integrity assurance.

Ulasan

Catatan popular daripada blog ini

SISTEM PENGOPERASIAN KOMPUTER (OS)

JENIS-JENIS SISTEM PENGOPERASIAN KOMPUTER

JENIS - JENIS ARAHAN SQL