Friday 25 November 2016

Parity bit

  • A parity bit, or check bit, is a bit added to a string of binary code that indicates whether the number of 1-bits in the string is even or odd.
  • Parity bits are used as the simplest form of error detecting code.
  • There are two variants of parity bits: even parity bit and odd parity bit.

    Even parity bit

    • In even parity bit, sending data consist must be even number of 1-bit count. In these case it will add parity bit zero other wise one.
    7 bits of data
    (count of 1-bits) 8 bits including parity
    0000000 0 00000000
    1010001 3 10100011
    1101001 4 11010010
    1111111 7 11111111

      Odd parity bit

      • In Odd parity bit, sending data consist must be odd number of 1-bit count. In these case it will add parity bit zero other wise one.
      7 bits of data
      (count of 1-bits) 8 bits including parity
      0000000 0 00000001
      1010001 3 10100010
      1101001 4 11010011
      1111111 7 11111110

        Error detection

        • The below table shows the successful transmission while sending data from A to B.
        Type of bit parity Successful transmission scenario
        Even parity

        A wants to transmit data: 1001

        A computes parity bit value: 1+0+0+1 (mod 2) = 0

        A adds parity bit and sends data: 10010

        B receives data: 10010

        B computes parity: 1+0+0+1+0 (mod 2) = 0

        B reports correct transmission after observing expected even result.

        Odd parity

        A wants to transmit data: 1001

        Acomputes parity bit value: 1+0+0+1 + 1 (mod 2) = 1

        A adds parity bit and sends data: 10011

        B receives data: 10011

        B computes overall parity: 1+0+0+1+1 (mod 2) = 1

        B reports correct transmission after observing expected odd result.

        • The below table shows the failed transmission scenario while sending data from A to B.
        Type of bit parity error Failed transmission scenario
        Even parity

        Error in the second bit

        A wants to transmit data: 1001

        A computes parity bit value: 1+0+0+1 = 0

        A adds parity bit and sends data: 10010

        ...TRANSMISSION ERROR...

        B receives data: 11010

        B computes overall parity: 1+1+0+1+0 = 1

        B reports incorrect transmission after observing unexpected odd result.

        Even parity

        Error in the parity bit

        A wants to transmit data: 1001

        A computes even parity value: 1+0+0+1 = 0

        A sends data: 10010

        ...TRANSMISSION ERROR...

        B receives data: 10011

        Bcomputes overall parity: 1+0+0+1+1 = 1

        B reports incorrect transmission after observing unexpected odd result.

        History

        • A "parity track" was present on the first magnetic tape data storage in 1951.
        • Parity in this form, applied across multiple parallel signals, is known as a transverse redundancy check.
        • This can be combined with parity computed over multiple bits sent on a single signal, a longitudinal redundancy check.

        0 comments:

        Post a Comment