───✱*.。:。✱*.:。✧*.。✰*.:。✧*.。:。*.。✱ ───

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
    • 𝑃1111=even𝑃2=1
  • 𝑃2 checks 2, 3, 6, 7 → 𝑃2𝐷1𝐷3𝐷4=even
    • 𝑃2111=even𝑃2=1
  • 𝑃3 checks 4, 5, 6, 7 → 𝑃4𝐷2𝐷3𝐷4=even
    • 𝑃4011=even𝑃4=0
  • Final value → 0110011

───✱*.。:。✱*.:。✧*.。✰*.:。✧*.。:。*.。✱ ───