Parity Checking

To check parity in the data link layer, the receiver needs to count the number of bits with a value of 1 in the received message, including the parity bit. If the count is an odd number for an even parity scheme or an even number for an odd parity scheme, it indicates that an error has occurred.

Even parity and odd parity are error detection techniques used in data communication.

Table of Contents

Even parity:

In even parity, the number of 1s in the data being transmitted is counted and a 0 or 1 bit is added at the end to ensure that the total number of 1s (including the parity bit) is even. For example, if the data being transmitted is 1100110, the parity bit would be 0 because there is already an even number of 1s. So the entire transmitted data would be 11001100.

Odd parity:

In odd parity, the number of 1s in the data being transmitted is counted and a 0 or 1 bit is added at the end to ensure that the total number of 1s (including the parity bit) is odd. For example, if the data being transmitted is 1100110, the parity bit would be 1 because there are an even number of 1s. So the entire transmitted data would be 11001101.

Even parity

For example, let’s say we have an even parity scheme, where the transmitter adds a parity bit to the message so that the total number of 1s in the message (including the parity bit) is even. The transmitter sends the following message: 1100101

To calculate the parity bit, the transmitter counts the number of 1s in the message:

1 1 0 0 1 0 1
————-
1 0 0 1 0 1 1 -> There are four 1s, so the parity bit is 0 (to make the total number of 1s even)

The transmitter sends the message with the parity bit.

1 1 0 0 1 0 1 0
—————
1 0 0 1 0 1 0 0 -> There are three 1s, which is an odd number in an even parity scheme, indicating an error.

Based on the odd count, the receiver knows that an error occurred during transmission and can request the sender to retransmit the message.

2 thoughts on “Parity Checking”

  1. Pingback: Hamming code

  2. Fantastic beat ! I would like to apprentice whilst you amend your website, how
    can i subscribe for a weblog site? The account helped me
    a applicable deal. I have been a little bit acquainted of this your broadcast offered vibrant clear concept

Leave a Comment

Your email address will not be published. Required fields are marked *