cs252-comerr - Error Detection Correction Add extra bits to...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Copyright M. Baltrush (CS252- comerr) 1 Error Detection & Correction Add extra bits to the data bits for the sole purpose of detecting when errors have been introduced and correcting the errors if possible Detect single error: Parity bit 8 data bits + 1 parity bit in PC written at memory write (data transmission) check at memory read (data reception) Copyright M. Baltrush (CS252- comerr) 2 Hamming Codes ( Richard W. Hamming, 1915-1998) (4,7) Hamming Code detects all one- and two-bit errors Corrects all 1-bit errors Magic : Any two different code words differ in at least 3 places! 1111111 1110100 1101000 1100011 1011001 1010010 1001110 1000101 0111010 0110001 0101101 0100110 0011100 0010111 0001011 0000000 Copyright M. Baltrush (CS252- comerr) 3 Hamming Distance as Geometry 1000101 1000100 1100101 1001101 1001111 1100111 1010100 1100100 1001110 1101110 Yellow is code word Blue is one error Green is two errors
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 Copyright M. Baltrush (CS252- comerr) 4 Hamming Code Detect and correct single error, parity spread in codeword Bit Position 1 2 3 4 5 6 7 8 9 10 11 12 P 1 P 2 D 3 P 4 D 5 D 6 D 7 P 8 D 9 D 10 D 11 D 12 P: parity bit D: data bit Notice numbering is different: no zero bit, numbering opposite book Copyright M. Baltrush (CS252- comerr) 5 Hamming Code Parity Generation n bits of data, k bits of parity P 1 = XOR( 3, 5, 7, 9, 11 ) Parity generation equations P 2 = XOR( 3, 6, 7, 10, 11 ) P 4 = XOR( 5, 6, 7, 12 ) P 8 = XOR( 9, 10, 11, 12 ) C = (C 8 C 4 C 2 C 1 ) syndrome for checking odd parity Copyright M. Baltrush (CS252- comerr) 6 Hamming Example Data: 0 1 0 1 1 1 0 0 Code: P 1 P 2 D 3 P 4 D 5 D 6 D 7 P 8 D 9 D 10 D 11 D 12 P 1 = XOR( 0, 1, 1, 1, 0 ) = 1 P 2 = XOR( 0, 0, 1, 1, 0 ) = 0 P 4 = XOR( 1, 0, 1, 0 ) = 0 P 8 = XOR( 1, 1, 0, 0 ) = 0 0 1 0 1 1 1 0 0 1 0 0 1 0 P 1 = XOR( D 3 , D 5 , D 7 ,D 9 , D 11 ) P 2 = XOR( D 3 , D 6 , D 7 , D 10 , D 11 ) P 4 = XOR( D 5 , D 6 , D 7 , D 12 ) P 8 = XOR( D 9 , D 10 , D 11 , D 12 ) Calculation of parity bits for a byte of information
Image of page 2
3 Copyright M. Baltrush (CS252- comerr) 7 Hamming Example Code: P 1 P 2 D 3 P 4 D 5 D 6 D 7 P 8 D 9 D 10 D 11 D 12 Data: 0 1 0 0 1 1 0 0 C 1 = XOR( 1, 0, 1, 0, 1, 0 ) = 1 C 2 = XOR( 0, 0, 0, 0, 1, 0 ) = 1 C
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern