1. Gyanastra
  2. Digital Logic
  3. Error Detection and Correction
  4. Placing Parity Bits at Power-of-2 Positions and Assigning Message Bits
Free lesson, no account needed 4 min read 2 practice questions after it
Asked in past papers2 times
  • UGC NET20222010

Digital Logic · Error Detection and Correction

Placing Parity Bits at Power-of-2 Positions and Assigning Message Bits

Overview

Parity bits are extra bits added to a message so that a single-bit error can be detected and corrected.
For 4 message bits, 3 parity bits are required, giving a total of 7 transmitted bits, with the parity bits placed at every power-of-2 position and the message bits filling all remaining positions.

Key concepts

  • Parity bits: extra bits added to a message so that a single-bit error can be detected and corrected.
  • Bit count: 4 message bits require 3 parity bits, giving a total of 7 bits transmitted.
  • Placement rule: parity bits go at every power-of-2 position (20=12^0 = 1, 21=22^1 = 2, 22=42^2 = 4, ...); all remaining positions carry the message bits.
  • Coverage: each parity bit later covers a selected subset of the message bits, chosen so that the parity bit together with its covered bits gives the required parity (even parity by default).
    The selection rule is developed in the next step.

How it works

  1. For 4 message bits, send 3 parity bits along with them, giving 7 bits total.
  2. Choose the message to send; the example uses the BCD number 0101 (decimal 5). (1100 is also mentioned as an arbitrary example.)
  3. Number the 7 positions 1 to 7:
    • Positions that are powers of 2 hold parity bits: position 1 = 202^0 → P1, position 2 = 212^1 → P2, position 4 = 222^2 → P3.
    • All other positions hold message bits: M1, M2, M3, M4.
  4. Fill the message positions with the given message bits, left to right: M1 = 0, M2 = 1, M3 = 0, M4 = 1. The parity positions P1, P2, P3 are still to be computed.
  5. Each parity bit covers a selected subset of the message bits, chosen so that the parity bit together with its covered bits gives the required parity (even parity by default).

Formulas

  • 20=12^0 = 1 → position 1 holds P1
  • 21=22^1 = 2 → position 2 holds P2
  • 22=42^2 = 4 → position 4 holds P3
  • Total bits = message bits + parity bits = 4+3=74 + 3 = 7

Worked examples

Transmitting BCD 0101 (decimal 5) with 3 parity bits

Position layout (7 bits total):

Position1234567
Bit typeP1P2M1P3M2M3M4
Value??0?101
  • Position 1 = 202^0 → P1
  • Position 2 = 212^1 → P2
  • Position 4 = 222^2 → P3
  • Positions 3, 5, 6, 7 → M1 = 0, M2 = 1, M3 = 0, M4 = 1

P1, P2, P3 are left blank at this stage; they are computed from the message bits they cover.

Revision summary

  • 4 message bits → 3 parity bits → 7 bits total.
  • Parity bits occupy positions 1, 2, 4 (powers of 2); message bits occupy positions 3, 5, 6, 7.
  • Message bits are filled in order M1, M2, M3, M4 into the non-power-of-2 positions from left to right.
  • Each parity bit covers a specific subset of message bits; the covered bits plus the parity bit must satisfy the chosen parity (even parity is the default).
  • The parity bit values are not known at placement time; they are computed after the message bits are placed.

Previous-year exam insights

  • The number of parity bits r for m message bits must satisfy 2r≥m+r+12^{r} \ge m + r + 1 (the Hamming condition);
    the total transmitted length is n = m + r.
  • Parity bit at position 2k2^{k} covers all positions whose binary index has bit k set (e.g. P1 covers positions 1,3,5,7; P2 covers 2,3,6,7; P4 covers 4,5,6,7), including the parity position itself.
  • For even parity each parity bit is set so that the XOR (mod-2 sum) of all positions it covers, including itself, is 0; for odd parity the XOR is 1.
  • At the receiver the syndrome is formed by recomputing each parity check; the binary number formed by the failing checks (check at 2k2^{k} giving bit k) equals the position of the single-bit error, and a zero syndrome means no error.
  • Hamming code with minimum distance 3 corrects any single-bit error but cannot detect (reliably) double-bit errors; an extra overall parity bit (extended Hamming code, distance 4) is needed for SEC-DED.
  • The minimum Hamming distance needed to detect d errors is d+1 and to correct t errors is 2t+1;
    a code with distance 3 corrects t = 1 error.
Pages 1–2 of 2