Cyclic codes - PowerPoint PPT Presentation

1 / 51
About This Presentation
Title:

Cyclic codes

Description:

Cyclic codes – PowerPoint PPT presentation

Number of Views:1491
Avg rating:3.0/5.0
Slides: 52
Provided by: guofe
Category:
Tags: codes | cyclic | yawl

less

Transcript and Presenter's Notes

Title: Cyclic codes


1
332437 Lecture 21 Cyclic and Hamming Codes
  • Cyclic codes
  • Berger codes
  • Hamming codes
  • Summary

Material from Design and Analysis of Fault
Tolerant Digital Systems, by Barry Johnson,
Addison Wesley
2
Cyclic Codes
  • Used on current disk systems
  • Designed so that any end-around shift of code
    word produces another code word.
  • Has a Boolean generator polynomial G (x) of
    degree n-k or greater
  • n -- number bits in completed code word
  • k -- number bits in original information to be
    encoded
  • G (x) coefficients are 0 or 1

3
Cyclic Codes (contd.)
  • Called an (n, k) cyclic code
  • Able to detect all single errors and all
    multiple, adjacent errors
  • Very important for communications applications -
    have burst errors
  • Transient fault that causes several adjacent
    errors in a data item
  • Represent data as a Boolean polynomial

4
Example
  • 10112 is
  • r2, is modulo 2 addition
  • Is decimal multiplication
  • Code word is the coefficients of a polynomial

5
Cyclic Code
  • Represents n-bit code word by polynomial of
    degree (n-1) or less
  • V (x) called the code polynomial of the code word
    v
  • Generate code polynomials by multiplying
    polynomial (representing data to be encoded) by
    generator polynomial

6
Example
  • Want to encode binary word
  • Code polynomial
  • Code is the coefficients (1010001)

7
Another Example
  • V(1001011)

8
Cyclic Code Words for 4-bit Information Words
9
Polynomial Interpretation
10
Distance 3 Code
  • Any 2-bit errors can be detected
  • Find Hamming distance
  • Compare all code words
  • See that all possible pairs differ in at least 3
    bit positions

11
Circuit Example for Generating a Cyclic Code Word
12
Circuit Example
  • For generating
  • Performs polynomial multiplication
  • Implement in digital logic using storage gates
    (flip-flops) and XORs
  • Storage elements provide a time delay
  • Data appears serially on D (x)
  • Bits of code word appear serially on V (x)
  • Registers initialized to 0

13
Circuit Example for Generating a Cyclic Code Word
14
Encoding Process for the Circuit
15
Decoding Procedure
  • Non-separable code
  • Determine if code word (r0, r1,
    r2, , rn-1) is valid
  • Represents polynomial r0 r1 x
    r2 x2 rn-1 xn-1
  • Obtained supposedly as
  • R (x) D (x) G (x) S (x)

Should be 0 --If not 0, invalid code
16
Decoding Procedure (contd.)
  • Divide R (x) by G (x) - see if remainder is 0
  • S (x) is syndrome polynomial

17
Division Circuit
18
Circuit Analysis
  • B (x) (x3 x) D (x)
  • V (x) -- coded data
  • D (x) decoded data
  • Modulo 2 arithmetic -- and - same

19
Proof that Circuit Divides
20
Polynomial Division
  • Initialize register to 0
  • Circuit implements polynomial division
  • After division, registers have value of syndrome
    or remainder of division
  • 0 syndrome - V (x) was a valid code, otherwise,
    V (x) is invalid

21
Decoding
22
Example
  • Code word should be 1010001
  • Error caused it to be 1011001

23
Decoding Circuit With Generator Polynomial G(x)
24
Decoding Process With Erroneous Information
25
Main Disadvantage of Cyclic Codes
  • Not separable
  • Possible to create a separable cyclic code
    (Nelson Carrole)
  • n -- bits in complete code
  • k -- original data bits
  • Generate an (n,k) code
  • Multiply D (x) by xn-k, divide result by G (x)
    to give R (x)

26
Berger Codes
  • Append check bits to each information word -
    separable
  • Berger code of length n has
  • I information bits
  • k check bits

27
Berger Code Creation
  • Create binary having ones in I bits
  • Complement and append to I bits

28
Number of Required Check Bits in a Berger Code
29
Berger Code Words for 4-bit Information Words
30
Horizontal Vertical Parity
  • 0001 0
  • 1001 1
  • 1010 1
  • 1111 1
  • 0010 0 Extra Vertical Parity
  • Extra Horizontal Parity Bit

31
Detects Any Single Error
  • Can correct it too, because you know the location
    of the error
  • Cannot help for multiple errors - can detect
    them but not correct them. If rows (i j) and
    columns (k m) have incorrect parity, error
    could be in bit positions (i,k), (i,m), (j,k), or
    (j,m)

32
Hamming Error Correcting Codes (ECCs)
  • Most common extension to Parity
  • Inexpensive
  • Only 10-40 redundancy
  • Efficient - correction is fast
  • Small time delays for encoding and decoding
  • ECC circuit available on cheap chips
  • Memory constitutes 60-70 of digital system
    faults transient faults more common as memories
    get denser

33
Overlapping Parity
  • Use c parity check bits to protect k bits of
    information
  • 2c gt ck1
  • Code word length nck
  • Partition information into parity groups - set a
    parity bit for each group

34
Example
  • Information bits (d3,d2,d1,d0)
  • Check bits (c1,c2,c3)
  • Parity Groups (d3,d1,d0,c1),
  • (d3,d2,d0,c2), (d3,d2,d1,c3)
  • Each check bit set for parity (even or odd) of
    its group

35
Check Bits Affected by Single Data Bit Errors
36
Check Bits Are Syndrome
  • Check bits affected for each possible erroneous
    bit
  • Each bit error effect is unique -
  • Erroneous bit can be located

37
Process
  • Encode original data - generate Cg parity check
    bits
  • Transmit information and Cg bits
  • Regenerate encoding Cc of received information
    bits
  • If CcCg, information is correct

38
Process (contd.)
  • Otherwise
  • Obtain syndrome S Cg Cc
  • Number bits right to left and place information
    /check bits so that syndrome gives erroneous bit
    position number
  • Feed syndrome to controlled complementation unit
    - complements erroneous bit to correct word

39
Syndromes for Each Possible Single-Bit Error
40
Syndrome Generator Hardware
41
Controlled Complementer (Corrects Wrong Bits)
  • Syndrome determines which bit (if an error
    occurs) is complemented

Corrected bits
42
Hamming Single-error Correcting Code Memory
43
Practical Hamming Code Systems
  • Keep a log of correction quantities so that
    defective memory chips can be replaced
  • Hamming code - erroneously corrects double-bit
    errors
  • If both d0 and c2 are wrong, syndrome is 100
    which says that c1 should be corrected (not right)

44
Modified Hamming Code
  • Need to modify code to both correct single-bit
    errors and detect double-bit errors
  • Add another parity bit over the entire Hamming
    Code word (including check bits)

45
Modified Code Double-error Detection
Correction
46
Single-bit and Double-bit Errors
  • Single-bit error - syndrome says how to correct
    it, overall parity is wrong
  • Double-bit error - overall parity is correct but
    non-zero syndrome occurs. Treat as an error but
    avoid erroneous correction

47
Commercial ECC IC
48
Time Overheads of Hamming Codes
  • Extra write time - time to generate check bits
  • Extra error detection time - 52 ns
  • Correction detection time - 67 ns

49
Code Selection Issues
  • Must it be separable?
  • How much extra time, storage, circuitry can be
    tolerated?
  • How many bit errors can be detected/corrected?
  • Can encoding/decoding occur in parallel with
    transmission/reception (yes for cyclic codes)

50
Code Selection Issues (contd.)
  • Do we need error detection, error correction, or
    both?
  • bit errors that need to be detected/corrected?
  • Determines Hamming distance Hd

51
Summary
  • Hamming code error detection/correction now
    necessary on present-day semiconductor memory
  • Memory contributes 60-70 of digital system
    faults
  • Transient faults more common as memories get
    denser
  • Lack of EEC on memory in cheap PCs is a major
    source of their unreliability
Write a Comment
User Comments (0)
About PowerShow.com