β”€β”€β”€βœ±*.q:q✱*.:q✧*.q✰*.:q✧*.q:q*.q✱ ───

Parity

  • Parity is a simple error detection technique. It helps identify whether a single-bit error has occurred during data transmission or processing.
  • Parity can only detect single-bit errorsβ€”it cannot correct them.
  • It fails to detect if two are more bits are changed since the parity may remain the same

Even vs Odd

  • Even β†’ number of 1s in a byte (including parity bit) is even
  • Odd β†’ number of 1s is odd

Detection and Correction

  • Detection β†’ did bits flip?
  • Correction β†’ flip the bits back

SEC & DED

  • Improves parity by detecting 2 bit errors and correct 1 bit errors
  • SEC β†’ single error correction
  • DED β†’ double error detection

Hamming Code

  • Place multiple parity bits at certain positions in the number
    • Positions are powers of 2
  • Formatted as Hamming(𝑇,𝐷), where 𝑇 is the total bits and 𝐷 is the number of data bits

Example

  • Hamming(7,4) β†’ transfer 4 data bits, 1011

Set Positions

  • The data bits can be placed at the positions that are not powers of two
  • The data would be ??1?011

Parity Bits

  • XOR is used to ensure each group has even parity
  • 𝑃1 checks 1, 3, 5, 7 β†’ 𝑃1βŠ•π·1βŠ•π·2βŠ•π·4=even
    • 𝑃1βŠ•1βŠ•1βŠ•1=even→𝑃2=1
  • 𝑃2 checks 2, 3, 6, 7 β†’ 𝑃2βŠ•π·1βŠ•π·3βŠ•π·4=even
    • 𝑃2βŠ•1βŠ•1βŠ•1=even→𝑃2=1
  • 𝑃3 checks 4, 5, 6, 7 β†’ 𝑃4βŠ•π·2βŠ•π·3βŠ•π·4=even
    • 𝑃4βŠ•0βŠ•1βŠ•1=even→𝑃4=0
  • Final value β†’ 0110011

β”€β”€β”€βœ±*.q:q✱*.:q✧*.q✰*.:q✧*.q:q*.q✱ ───