Improving Data Reliability: Parity and Error Correcting Codes, Slides of Microcontrollers

How parity and error correcting codes (ecc) are used to detect and correct errors in data transmission. It covers the concept of parity, its ability to detect one-bit errors, and the use of ecc to detect and correct multiple-bit errors. The document also includes examples and calculations of ecc for 4-bit data.

Typology: Slides

2012/2013

Uploaded on 04/24/2013

ballari
ballari 🇮🇳

4.6

(10)

117 documents

1 / 17

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Improving Reliability
We used parity to determine when a memory bit failed. We can protect
buses from transmission failures using parity/ECC.
Detected with parity: 1 bit errors
Corrected with ECC (Error correcting codes)
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Improving Data Reliability: Parity and Error Correcting Codes and more Slides Microcontrollers in PDF only on Docsity!

Improving Reliability

We used parity to determine when a memory bit failed. We can protect buses from transmission failures using parity/ECC.

Detected with parity: 1 bit errors

Corrected with ECC (Error correcting codes)

Parity

If any two different valid datum, in memory

or on a bus, differ by at least 2 bits:

It is easy to detect if one bit fails since a one bit failure will result in an invalid data value.

How can we make sure any good data differs

by at least two bits?

Example

  • Two number: 100110 and 101110
  • Add odd parity bits: 1001100 and 1011101
  • Now these numbers differ by 2 bits
  • What if they already differ by more than one bit?
    • No problem, a 1-bit error can’t turn one into the other

Error Correcting Codes

If any two different valid datum, in memory or on a bus, differ by at least 3 bits: It is easy to detect and correct if one bit fails since a one bit failure will result in an invalid data value and we know which valid data value is only one bit away.

How can we make sure any good data differs by at least three bits?

ECC on 4 bits of data

  • Data bit 0 is used by parity 0 and 1
  • Data bit 1 is used by parity 0 and 1 and 2
  • Data bit 2 is used by parity 0 and 2
  • Data bit 3 is used by parity 1 and 2
    • P0 = odd_parity (D0, D1, D2)
    • P1 = odd_parity (D0, D1, D3)
    • P2 = odd_parity (D1, D2, D3)

Calculating ECC (4 bits)

D 3 D 2 D 1 D 0 P 2 P 1 P 0 D 3 D 2 D 1 D 0 P 2 P 1 P 0

Calculating ECC (4 bits)

D 3 D 2 D 1 D 0 P 2 P 1 P 0 D 3 D 2 D 1 D 0 P 2 P 1 P 0

Calculating ECC (4 bits)

D 3 D 2 D 1 D 0 P 2 P 1 P 0 D 3 D 2 D 1 D 0 P 2 P 1 P 0

Test question Solution

  • The flipped bit is D 3 , which should be a 1.

D 3 is used by P 2 and P 1

D 3 D 2 D 1 D 0 P 2 P 1 P 0

How many ECC parity bits (P) do you need for N

bits of data?

  • You use 1 ECC parity bit pattern for each data bit error.
    • N bit patterns for fixing 1 bit errors
  • Plus 1 more pattern for each parity bit
    • P bit patterns
  • Plus 1 pattern for “correct value”

N + P + 1 = 2P

Question

  • Prove that ECC has at least 3 bits different in any two representations.
  • Answer:
    • if they are different, then they must differ by at least 1 data bit.
    • Each data bit is covered by at least 2 parity bits
      • Those parity bits must now differ since one must have an odd number of data 1’s and the other even.

Question

  • How do you decide which bit is wrong?
  • If only one parity bit is the wrong parity, then that parity bit has been corrupted
    • Because and data bit is checked by at least 2 parity bits a data bit failure will cause 2 or more parity bit errors.
  • If two or more parity bits are wrong, then the pattern of the parity bits that fail uniquely identify the corrupted data bit.