'& A 5B/6B coding scheme in which five data bits are encoded into six-bit codewords is used in conjunction with offsetting the data on different channels by three bits in quartet signaling. It provides the level of error detection necessary, produces a signal balanced within narrow limits, and restricts strings of consecutive 0s or 1s to a maximum length of 6. It is also efficient. & ! $ # % 2',1* 2) '$7$ %()25( 75$160,66,21 +$6 7+5(( 0$,1 385326(6 ,567 ,7 &$1 (1685( 7+$7 7+( 75$160,77(' 6,*1$/6 $5( '& %$/@ $1&(' 7+$7 ,6 7+$7 7+(5( $5( (48$/ 180%(56 2) 6$1'6 29(5 $1 (;7(1'(' 3(5,2' 2) 7,0( !+,6 ,6 ,03257$17 ,1 75$16@ )250(5@&283/(' 6<67(06 :+,&+ $5( '(6,*1(' 72 35(9(17 *5281' /2236 (&21' &2',1* &$1 $,' &/2&. 6<1&+521,=$7,21 %< 0,1,0,=,1* 7+( /(1*7+ 2) 675,1*6 2) &216(&87,9( 6 25 6 !+,6 (1685(6 7+$7 7+(5( ,6 $ +,*+ '(16,7< 2) 6,*1$/ 75$16,7,216 !+,5' 72*(7+(5 :,7+ &<&/,& 5('81'$1&< &+(&.6 6 ,7 &$1 (1$%/( (55256 72 %( '(7(&7(' !+(5( ,6 $1 52-(&7 )81&7,21$/ 5(48,5(0(17 7+$7 $1< 7+5(( %,76 ,1 (5525 :,7+,1 $ '$7$ )5$0( 0867 %( '(7(&7(' !+(5( ,6 $/62 $ 1((' 72 '(7(&7 %8567 (55256 $1< &2',1* 6<67(0 0867 127 &203520,6( 7+( '(7(&7,21 3529,'(' %< 7+( !+( #@1< 7($0 &+26( $ &2',1* 6&+(0( ,1 :+,&+ ),9( '$7$ %,76 $5( (1&2'(' ,172 6,;@%,7 &2'(:25'6 !+,6 ,6 86(' ,1 &21-81&7,21 :,7+ 2))6(77,1* 7+( '$7$ 21 ',))(5(17 &+$11(/6 %< 7+5(( %,76 ,1 48$57(7 6,*1$/,1* 7 3529,'(6 7+( /(9(/ 2) (5525 '(7(&7,21 1(&(66$5< 352'8&(6 $ 6,*1$/ %$/@ $1&(' :,7+,1 1$552: /,0,76 $1' 5(675,&76 675,1*6 2) &216(&8@ 7,9( 6 25 6 72 $ 0$;,080 /(1*7+ 2) 7 7+( 6$0( 7,0( ,7 ,6 ()),&,(17 $'',1* 21/< 72 7+( '$7$ /2$' &203$5(' :,7+ 7+( 352'8&(' %< 7+( $1&+(67(5 &2',1* 86(' ,1 $6(@! !+( &2'( ,6 $/62 ())(&7,9( :+(1 7+( )285 '$7$ &+$11(/6 $5( 08/7,3/(;(' )25 75$160,66,21 21 ! 25 ),%(5@237,& &$%/(6 !+,6 $57,&/( '(6&5,%(6 7+( '(6,*1 2) 7+( %/2&. &2'( 86(' ,1 #@1< $1' 025( *(1(5$//< ,1 7+( 352326(' /2&$/ $5($ 1(7:25. 67$1'$5' $1' (;3/$,16 7+( 5($6216 %(+,1' ,76 '(6,*1 & !+( 0(7+2' 86(' 72 75$160,7 ',*,7$/ '$7$ +$6 72 7$.( $&&2817 2) 7+( 3+<6,&$/ &21675$,176 7+$7 7+( 75$160,66,21 0(',80 ,0326(6 8321 7+( 75$160,66,21 6<67(0 !+( 3+<6,&$/ 0(',$ 86(' %< #@1< ,1&/8'( 816+,(/'(' 7:,67(' 3$,5 "! &$%/( 6+,(/'(' 7:,67(' 3$,5 ! &$%/( $1' 237,&$/ ),%(5 !+( '(0$1'6 ,0326(' %< 7+( 86( 2) "! &$%/( 0($1 7+$7 72 75$160,7 $7 %,766 (9(1 :+(1 86,1* 48$57(7 6,*1$/,1* ',*,7$/ '$7$ +$6 72 %( &2'(' %()25( ,7 ,6 75$16@ 0,77(' !+( '(6,*1 2) 7+( &2'( +$6 72 7$.( $&&2817 2) 9$5,@ 286 &21675$,176 ,0326(' %< ,03/(0(17$7,21 &216,'(5$7,216 $1' %< 7+( 1((' 72 %( &203$7,%/( :,7+ 27+(5 '$7$ 75$160,6@ 6,21 6<67(06 1 3$57,&8/$5 7+( #@1< &2'( 6&+(0( :$6 '(6,*1(' 72 %( &203$7,%/( :,7+ 7+( 3$&.(7 6758&785( $1' (5525 '(7(&7,21 &$3$%,/,7,(6 '(),1(' %< 7+( 67$1'$5' 86(' ,1 7+(51(7 /2&$/ $5($ 1(7:25.6 $1' %< 7+( 67$1'$5' 86(' ,1 72.(1 5,1* /2&$/ $5($ 1(7@ :25.6 " !! ! ## (1(5$//< 63($.,1* $ &2'( ,6 $ 0$33,1* )520 $1 $/3+$%(7 2) 6<0%2/6 72 $ 6(7 2) 6(48(1&(6 2) 6<0%2/6 )520 620( 27+(5 $/3+$%(7 2 )25 (;$03/( :( &28/' '(),1( $ &2'( )520 7+( $/3+$%(7 >$%&=? 72 7+( 6(7 2) 6(48(1&(6 2) =(526 $1' 21(6 %< $ → % → & → $1' 62 21 25 $127+(5 (;$03/( 7+( 5(35(6(17$7,21 2) '(&,0$/ 180%(56 $6 7+(,5 %,1$5< (48,9$/(176 &$1 %( 5(*$5'(' $6 $ &2'( !+,6 ,'($ 2) $ &2'( 6+28/' 127 %( &21)86(' :,7+ 7+( 127,21 2) $ &,3+(5 :+,&+ ,6 $ &2'( 7+$7 ,6 63(&,),&$//< '(6,*1(' 72 +,'( 7+( 0($1,1* 2) 75$160,77(' '$7$ )520 7+26( 127 0($17 72 81'(567$1' ,7 !+( &2'(6 7+$7 :( $5( 86,1* $5( '(6,*1(' 72 %( ($6< 72 '(&2'( $1' $5( &$3$%/( 2) '(7(&7,1* (55256 ,1 75$160,66,21 25 7+( 0$7+(0$7,&$/ %$&.*5281' 2) &2',1* 7+(25< 6(( 5()(5(1&( 25 $1 (1*,1((5,1* 3(563(&7,9( 6(( 5()(5(1&( %/2&. &2'( ,6 $ 63(&,),& 7<3( 2) &2'( ,1 :+,&+ (9(5< &2'(@ :25' +$6 7+( 6$0( /(1*7+ 1 $ %/2&. &2'( ($&+ (/(0(17 2) $1 $/3+$%(7 2) ',))(5(17 6<0%2/6 :+,&+ ,76(/) &$1 %( 5(35(6(17(' %< $ @%,7 180%(5 ,6 (1&2'(' $6 $ @%,7 &2'(:25' !+( 0$-25 3+<6,&$/ &21675$,17 7+$7 $))(&76 7+( 86( 2) $ &2',1* 6&+(0( ,6 7+( 1((' 72 0$,17$,1 '& %$/$1&( 7+$7 ,6 7+( 63(&@ 75$/ &217(17 2) 7+( 75$160,77(' 6,*1$/ 6+28/' +$9( 12 =(52@ )5(48(1&< &20321(17 1 0$7+(0$7,&$/ 7(506 7+,6 75$16/$7(6 ,172 5(48,5,1* 7+$7 7+( ',))(5(1&( %(7:((1 7+( 180%(5 2) 21(6 $1' 7+( 180%(5 2) =(526 75$160,77(' $7 $1< 7,0( 0867 %( .(37 $6 &/26( 72 =(52 $6 3266,%/( /($5/< $ 6,03/( :$< 72 *(7 $ %$/$1&(' &2'( ,6 72 5(35(6(17 $ '$7$ &+$5$&7(5 2) %< 7+( &2'(:25' $1' $ '$7$ %< 7+( &2'(:25' !+( 180%(5 2) 6 75$160,77(' :,// 7+(1 (48$/ 7+( 180%(5 2) 6 75$160,77(' $7 7+( (1' 2) ($&+ &2'(:25' "1)25781$7(/< 7+,6 ,6 $/62 $ 9(5< ,1()),&,(17 :$< 2) $&+,(9,1* '& %$/$1&( %(&$86( ,7 5(48,5(6 7+( 3+<6,&$/ 75$160,66,21 2) 7:2 &2'( %,76 )25 (9(5< '$7$ %,7 6(17 !+( #@1< 7($0 &+26( 72 ,03/(0(17 $ &2'( %(&$86( ,7 *,9(6 $ 68,7$%/( 75$'(@2)) %(7:((1 ()),&,(1&< $1' &267 2) ,03/(0(17$7,21 8*867 (:/(77@$&.$5' 2851$/ IEEE 802.3 or 802.5 Frame Bit Stream 11000101 5-Bit Data Words 11000 10111 11000 A1 B1 C1 11110001 00101011 10010 01011000 10110 D1 00110011 10110 A2 B2 00001 C2 10011 D2 If necessary, the last data word is padded to the 5-bit boundary. Data Words on 4 Channels 0 1 1 0 1 0 0 0 1 1 A2 0 1 1 0 1 A1 1 1 1 0 1 Channel A B2 1 0 0 0 0 B1 0 0 0 1 1 Channel B C2 1 1 0 0 1 D2 C1 0 1 0 0 1 D1 Channel C ,675,%87,21 2) $ '$7$ 675($0 21 )285 &+$11(/6 )25 48$5= 7(7 6,*1$/,1* Channel D !+( 0$-25 &203$7,%,/,7< &21675$,17 ,0326(' 8321 7+( '(6,*1 2) 7+( "=1< &2'( :$6 7+$7 ,7 +$' 72 %( &203$7,%/( :,7+ 7+( )5$0( )250$76 '(),1(' %< 7+( $1' 67$1'$5'6 $1' ,1 3$57,&8/$5 :,7+ 7+( (5525= '(7(&7,21 &$3$%,/,7,(6 2))(5(' %< 7+( &<&/,& 5('81'$1&< &+(&. %8,/7 ,172 7+26( )250$76 (( ##2/<120,$/ 5,7+0(7,& $1' <&/,& ('81'$1&< +(&.6 21 3$*( = 7+( '(),1(' %< %27+ $1' '(7(&76 83 72 7+5(( 6,1*/(=%,7 (55256 2&&855,1* $1<:+(5( ,1 $ )5$0( 25 $ 6,1*/( %8567 (5525 2) 83 72 %,76 ,1 7+( )5$0( !+( 35272&2/ :,// 7+(1 ',6&$5' 7+$7 3$&.(7 $6 )/$:(' '$7$ 3$&.(7 &21= 6,676 2) 7+( )5$0( '(/,0,7(' %< $ 35($0%/( $1' 67$57 $1' (1' '(/,0,7(56 !+( "=1< 7($0 +$' 72 '(6,*1 7+( &2'( 62 7+$7 6,0,/$5 (5525='(7(&7,21 &+$5$&7(5,67,&6 :,// %( 0$,17$,1(' :+(1 25 )5$0(6 $5( &2'(' $1' 75$160,77(' ,1 3$5$//(/ 86,1* 48$57(7 6,*1$/,1* 1 3$57,&8= /$5 7+( 5(48,5(0(17 72 '(7(&7 83 72 7+5(( 6,1*/(=%,7 (55256 $1<:+(5( ,1 $ )5$0( ,6 $ &2038/625< 5(48,5(0(17 2) 52-(&7 62 7+( 1(: 67$1'$5' +$' 72 0((7 7+,6 '(0$1' 1 7+( 1(;7 7:2 6(&7,216 :( '(6&5,%( 7+( 352&(66 2) &2',1* 7+( '$7$ )5$0( $1' 7+( (5525 '(7(&7,21 &$3$%,/,7,(6 2) "= 1< $7$ )520 7+( 25 )5$0( ,6 ',9,'(' ,172 =%,7 '$7$ %/2&.6 :,7+ 3$'',1* $''(' $7 7+( (1' ,) 1(&(66$5< $1' ,6 ',675,%87(' %(7:((1 7+( )285 '$7$ 675($06 75$160,77(' 86,1* 7+( 48$57(7 6,*1$/,1* 6&+(0( 6(( ,* Cipher A Cipher B Cipher C Cipher D 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 A2 B2 C2 D2 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 1 1 A1 B1 C1 D1 A 8*867 (:/(77=$&.$5' 2851$/ B C D !+( '$7$ :25'6 $5( XOR(' :,7+ 36(8'25$1'20 675($0 &,= 3+(56 #%* &#5# 453'#. +4 '9%-64+7';OR'& 8+5* # 453'#. 0( 14'6&0; • "'+)*5;580 #/& 8'+)*5;(063 %0&'803&4 %0/5+/6' 50 #-5'3; 3#/&0. $+54 130&6%'& $: 453'#. %+1*'34 4'' +) *' /#5' 8*'/'7'3 #/ 6/$#-#/%'& %0&'803& 0%%634 %+1*'3'& &#5# $-0%,4 0/ 5*' (063 453'#.4 #3' 5*'/ %0&'& *' 0$4'37#/5 3'#&'3 8+-- /05+%' 5*#5 +/ #-- $65 0/' 0( 5*' #%%03&+/) 50 5*' (0--08+/) %0&' 5#$-' #4 4*08/ +/ %0&' 1#+34 5*' #-5'3/#5+7' 6/$#-#/%'& %0&'803&4 #3' -0)+%#+) /')#5+7'4 0( '#%* 05*'3 *+4 +4 /05 536' 0( 5*' 4'%0/& 1#+3 Data Code Data Code Pair (03 3'#40/4 *#7+/) 50 &0 8+5* 5*' '3303 1301'35+'4 0( 5*' %0&' 5 5*' '/& 0( 5*' 453'#. 0/' 0( 580 '/& &'-+.+5'34 +4 64'& +/&'1'/&'/5-: +/ '#%* 453'#. 4'' +) "*'/ 5*' '/& 0( 5*' 453'#. +4 3'#%*'& +( 5*' /'95 6/$#-#/%'& %0&'803& +4 &6' 50 *#7' 8'+)*5 #%%03&+/) 50 5*' 36-'4 #$07' '/& &'-+.+5'3 +4 64'& ( +5 +4 &6' 50 *#7' 8'+)*5 +4 64'& *' +/7#-+& 1#%,'5 .#3,'3 +4 64'& $: 3'1'#5'34 50 .#3, '3303'& 1#%,'54 (03 &+4104#- 03 (635*'3 130%'44+/) (5'3 %0&+/) 5*' &#5# 453'#.4 #3' 0((4'5 $: $+54 8+5* 3'; 41'%5 50 '#%* 05*'3 $'(03' 53#/4.+44+0/ 4'' +) )#+/ 5*' 3'#40/ (03 5*+4 *#4 50 &0 8+5* '3303;&'5'%5+0/ 1301'35+'4 #/& 8+-- $' '91-#+/'& $'-08 *' #%56#- 53#/4.+55'& $+5 4'26'/%' &08/ '#%* %*#//' -00,4 #4 4*08/ +/ +) *' 45#35 #/& '/& 0( 1#%,'5 .#3,; '34 #3' &'4+)/'& 50 .#+/5#+/ '3303 &'5'%5+0/ %#1#$+-+5+'4 *' 64' 0( #-5'3/#5+7' '/& &'-+.+5'34 '(('%5+7'-: #/ '953# 1#3+5: %*'%, +4 #/ '44'/5+#- 1#35 0( 5*' '3303 &'5'%5+0/ 4%*'.' 0( !;/: / 5*' 4'%0/& %0-6./ #-- 5*' ;$+5 %0&'803&4 #3' $#-#/%'& 5*#5 +4 5*'3' #3' '26#- /6.$'34 0( 4 #/& 4 *'3' #3' /05 '/06)* $#-#/%'& ;$+5 %0&'803&4 50 %0&' #-- 1044+$-' ;$+5 &#5# 4:.$0-4 40 58'-7' &#5# 4:.$0-4 #3' %0&'& $: # %*0+%' 0( 580 &+(('3'/5 ;$+5 %0&'803&4 0/' 0( 8'+)*5 580 580 4 #/& (063 4 #/& 0/' 0( 8'+)*5 (063 4 #/& 580 4 *' 580 %0&'803&4 #3' 64'& +/ 5*' (0--08+/) (#4*+0/ +/&'1'/; &'/5-: +/ '#%* 453'#. • 03 5*' (+345 &#5# 4:.$0- 5*#5 %0&'4 50 #/ 6/$#-#/%'& %0&'; 803& 5*' 8'+)*5;580 %0&'803& +4 %*04'/ • "*'/ 5*' /'95 6/$#-#/%'& %0&'803& 0%%634 5*' 8'+)*5; (063 %0&'803& +4 64'& /05*'3 &'4+)/ %0/453#+/5 0( 5*' %0&+/) 4%*'.' 8#4 5*#5 +5 4*06-& $'*#7' 8'-- 8*'/ 5*' (063 &#5# 453'#.4 #3' .6-5+1-'9'& 0/50 ('8'3 %*#//'-4 (03 /'5803,4 64+/) 03 (+$'3;015+% %#$-'4 4 /05'& +/ 5*' #35+%-' 0/ 1#)' #/& (+$'3;015+% 4 1#44 (063 1#3#--'- 453'#.4 0( &#5# 5*306)* # .6-5+1-'9'3 8*+%* %0.$+/'4 5*' (063 %0&'803& 453'#.4 +/50 0/' 453'#. %0&'803& $: %0&'803& +) "*'/ %0.$+/'& +/ 5*+4 8#: 5*' 1*:4+%#- #/& '3303 1305'%; 5+0/ %#1#$+-+5+'4 0( 5*' %0&' #3' .#+/5#+/'& #4 '9; 1-#+/'& +/ 5*' /'95 4'%5+0/ 0 1 1 0 0 0 1 0 0 1 0 0 0 0 0 1 1 1 0 1 0 1 1 1 0 0 0 1 1 0 1 1 0 0 0 1 1 1 1 0 1 0 0 0 0 1 1 0 1 0 1 0 1 0 0 0 1 1 0 1 1 0 0 0 Channel A Channel B Channel C Channel D Stream of Ciphered Data Symbols Channel A 0 0 1 1 0 0 1 0 0 0 0 1 1 0 0 0 1 1 0 1 1 0 0 1 Channel C Channel D Channel B 6-Bit Codewords 0/7'34+0/ 0( ;$+5 &#5# 4:.$0-4 50 ;$+5 %0&'803&4 *' 5*3'';$+5 0((4'5 0( %*#//'-4 #/& +4 (03 '3303 &'5'%5+0/ 6)645 '8-'55;#%,#3& 063/#- The IEEE 802.3 frame (Fig. 1) consists of a 48-bit destination address, a 48-bit source address, a 16-bit length field, and then a data field ranging between 368 and 12,000 bits in length and consisting of data organized into octets. This is followed by a 32-bit cyclic redundancy check (CRC). End of Packet ED2 = Weight 2 Expected ED4 = Weight 4 Expected IPM = Invalid Packet Marker 111111 000000 110000 000011 000001 111100 111110 011111 110000 SDH = High-Priority Packet SDN = Normal-Priority Packet 100000 111100 111110 000011 6-Bit Codewords 32-Bit CRC Data Field Start of Packet ...010101 Preamble 16-Bit Length Field 48-Bit Source Address !5$160,77(' %,7 6(48(1&( 21 ($&+ &+$11(/ 48-Bit Destination Address '(6,*1 ())257 :$6 '(',&$7(' 72 /,0,7,1* 7+( 180%(5 2) '$7$ %,76 $))(&7(' %< $ 6,1*/( &2'( %,7 ,1 (5525 Fig. 1. IEEE 802.3 frame structure. The IEEE 802.5 token-ring frame (Fig. 2) consists of an 8-bit access control field (not used in the 802.12 standard), an 8-bit frame control field, a 48-bit destination address, a 48-bit source address, between 0 and 240 bits of routing information, and then a data field ranging between 0 and 36,016 bits in length and consisting of data organized into octets. This data field is followed by a 32-bit CRC. 32-Bit CRC Data Field 0 to 240 Bits Routing Information 48-Bit Source Address 48-Bit Destination Address 8-Bit Frame Control Field 8-Bit Access Control Field Fig. 2. IEEE 802.5 frame structure. The CRC provides two types of protection for an IEEE 802.3 or 802.5 frame: • Any three single-bit errors occurring anywhere in the frame are detected. • Any burst of errors for which the distance between the first corrupted bit and the last corrupted bit is less than or equal to 32 bits is detected. IEEE Project 802 requires that any transmission scheme developed under its aegis can perform the first type of error detection, that is, that at least three singlebit errors can always be detected. !+( &+2,&( 2) &2'( 72*(7+(5 :,7+ 7+( $/7(51$7,21 2) 81%$/$1&(' &2'(:25'6 $1' 7+( 86( 2) 7+( $/7(51$7,9( (1' '(/,0,7(56 (1685(6 7+$7 6 5(48,5(0(17 ,6 0(7 83 72 7+5(( 6,1*/(>%,7 (55256 2&&855,1* $1<:+(5( 21 7+( )285 &+$1> 1(/6 :,7+,1 $ '$7$ )5$0( $5( '(7(&7(' !+,6 ,6 127 $ 75,9,$/ 0$77(5 72 &21),50 %(&$86( 7+( 86( 2) $ &2'( 0($16 7+$7 $ 6,1*/(>%,7 (5525 ,1 7+( 75$160,77(' %,7 675($0 0$< &$86( 0$1< 025( 7+$1 21( 6,1*/( %,7 72 %( ,1 (5525 ,1 7+( '$7$ 675($0 $)7(5 '(&2',1* 68%67$17,$/ 3257,21 2) 7+( &2'( 8*867 (:/(77>$&.$5' 2851$/ 7 ,6 127 ',)),&8/7 72 6(( +2: 7+( 86( 2) 7+( $/7(51$7,21 58/( )25 &+226,1* 81%$/$1&(' &2'(:25'6 72*(7+(5 :,7+ 7+( 86( 2) 7+( $/7(51$7,9( (1' '(/,0,7(56 /($'6 72 7+( '(7(&7,21 2) $// 75,3/(6 2) 6,1*/(>%,7 (55256 :+(1 7+26( (55256 2&&85 ,1 ',67,1&7 &2'(:25'6 21 $ 6,1*/( &+$11(/ ,* 6+2:6 6(9(5$/ &$6(6 ,1 :+,&+ 7+5(( 6,1*/( (55256 $5( '(7(&7(' %< 7+( $/7(51$7,21 58/(6 $1' 7+( 86( 2) (1' '(/,0,7(56 6(&21' 0$-25 '(6,*1 7+5867 :$6 72 0$.( 685( 7+$7 %8567 (5525>'(7(&7,21 3523(57,(6 ,1+(5,7(' )520 > $5( 127 &203520,6(' ,1 ">1< (&$86( :( $5( 12: 7$/.> ,1* $%287 $ 6<67(0 7+$7 &$1 75$160,7 29(5 )285 3$5$//(/ 675($06 $6 :(// $6 $ 6,1*/( 675($0 :( +$9( 72 %( &$5()8/ 72 '(),1( :+$7 :( 0($1 %< $ %8567 (5525 #( '(&,'(' 7+$7 7+( &/($5(67 &$6( &28/' %( 0$'( %< &216,'(5,1* $ %8567 (5525 72 %( $1< (5525 &$86(' %< $5%,75$5< &255837,21 $&5266 $// 7+( 675($06 )25 $ &(57$,1 180%(5 2) %,7 3(5,2'6 6(( ,* 2 )25 (;$03/( )25 $ %8567 (5525 2) 6(9(1 &2'( %,7 3(5,2'6 7+(5( ,6 $ %/2&. 6(9(1 &2'( %,76 /21* %< )285 &2'( %,76 :,'( &255(6321',1* 72 7+( )285 &+$11(/6 :,7+,1 :+,&+ $1< *,9(1 &2'( %,7 0$< 25 0$< 127 %( ,19(57(' !+( ),567 7+,1* :( 5($/,=(' :$6 7+$7 ,) $// 7+( &2'(:25'6 :(5( 75$160,77(' 6<1&+521286/< 21 $// )285 &+$11(/6 $ %8567 (5525 2) /(1*7+ &255837,1* (,*+7 &2'( %,76 &28/' &$86( 7528%/( ,) ,7 2&&855(' $7 $ &2'(:25' %281'$5< 6(( ,* !+( (5525 &28/' &255837 (,*+7 &2'( :25'6 $1' 7+86 (,*+7 '$7$ %/2&.6 &255(6321',1* 72 )257< '$7$ %,76 !+,6 ,6 :(// $%29( 7+( 3527(&7(' %< 7+( 7 :28/' 7+(5()25( 5(> 48,5( $ 5(0$5.$%/< *22' &2',1* 6&+(0( 72 3527(&7 $*$,167 (9(1 68&+ $ 6+257 (5525 %8567 D2 D1 C2 C1 B2 B1 A2 A1 D2 C2 B2 A2 D1 C1 8/7,3/(;,1* )285 675($06 ,172 21( B1 A1 Correct Codeword Weights: 3 3 3 3 3 3 3 3 ED2 Errored Codeword Weights: 3 2 3 4 3 3 2 3 ED2 Error! The last apparently unbalanced codeword has weight 2, so the next would have weight 4, yet the ED2 delimiter indicates that the next should have weight 2. Correct Codeword Weights: 3 3 3 3 3 3 3 3 ED2 Errored Codeword Weights: 3 4 3 3 2 4 3 3 ED2 The calculation of cyclic redundancy checks (CRCs) depends upon the arithmetic of modulo 2 polynomials. A modulo 2 polynomial is an expression of the form a0 + a1x + a2x2 + ...+ anxn, where the coefficients a0, a1, ... ,an are integers modulo 2, that is, they can take values of 0 or 1. The coefficients obey regular modulo 2 arithmetic as follows: Addition Error! The first apparently unbalanced codeword has weight 4, yet the rules stipulate that the first must have weight 2. Correct Codeword Weights: 3 2 3 4 3 2 4 3 ED2 Errored Codeword Weights: 3 2 3 3 3 2 3 4 ED2 Error! The alternation rule is violated—apparently two unbalanced codewords in succession have weight 2. "0" 0&+* +# "..+./ 0%.+1$% 0%" (0".*0&+* .1(" *! "*! !"(&)&0"./ %" /+(10&+* 0+ 0%&/ ,.+(") &/ 0+ +##/"0 0%" +!"3+.!/ +* 03+ +# 0%" %**"(/ ."(0&2" 0+ 0%" +0%". 03+ &$ (".(5 /%+3/ 0%0 3&0% /1 % * +##/"0 "2"* * "..+. 1./0 +# ("*$0% #+1. +..1,0&*$ +!" &0/ * +*(5 +..1,0 0%" +!" &0/ +# 0 )+/0 +!"3+.!/ %&/ +.."/,+*!/ 0+ !0 (+ '/ !0 &0/ *! /+ 3&(( " !"0" 0"! 10+)0& ((5 5 0%" 1./0 "..+. ,.+,".0&"/ +# 0%" %1/ "2"* 3&0% * .&7 0..5 +!" *5 1./0 "..+. +# ("*$0% #+1. &/ !"0" 0"! 1/0*0&( 0%"+."0& ( 3+.' ("! 1/ 0+ !"/&$* +!" +* 0+, +# 0%&/ +##/"0 / %")" 0%0 "40"*!/ 0%" 1./0 "..+.7!"0" 0&+* ,&(&05 0+ /"2"* +!" &0 ,".&+!/ .&0..&(5 +..1,0&*$ +!" &0/ 3%&(" /0&(( )""0&*$ 0%" ."-1&.")"*0 0+ !"0" 0 0%."" /",.0" /&*$("7&0 "..+./ /"" &$ %" 0.&1),% +# 0%"+.5 +2". 0.&( *! "..+. /%+1(! *+0 " 1*!"."/0&)0"! %"."80%"." ." ,,.+4&)0"(5 %+& "/ +# +!" %"* )1(0&,("4"! +*0+ /&*$(" %**"( #+. +. #&".7 +,0& /+(10&+*/ 0%" "..+. !"0" 0&+* ,&(&0&"/ +# 0%" +!" ." "*%* "! %" /&*$("7&0 "..+. ,.+0" 0&+* .")&*/ 0 0%."" 3%&(" 0%" 1./0 "..+.7!"0" 0&+* ,&(&0&"/ ." &*7 ."/"! 0+ +!" &0/ Multiplication + 0 1 × 0 1 0 0 1 0 0 0 1 1 0 1 0 1 Electrical engineers will recognize the addition operation as the XOR operation defined on binary states. The following are examples: • (1+x2+x4) + (1+x+x4) = x+x2 • (1+x2+x4) (1+x+x4) = 1+x+x2+x3+x5+x6+x8. Division of modulo 2 polynomials is done in exactly the same way as it is for ordinary polynomials, remembering that the coefficients obey modulo 2 arithmetic as defined above. A very important operation in the calculation of CRCs is the calculation of the remainder R(x) when one polynomial M(x) is divided by another G(x). R(x) is uniquely defined by M(x) = G(x)K(x) + R(x), where the degree of R(x) is less than the degree of G(x). The degree of a polynomial is defined as the largest value of n for which the coefficient an is nonzero, so, for example, 1+x2+x5 has degree 5. Although this sort of polynomial division may look formidable, there are very efficient means of calculation based on shift registers. CRCs are calculated on a stream of data by assuming that the data represents the coefficients of some modulo 2 polynomial. So, given a stream of data n bits long, the first bit can be considered as the coefficient an1 of xn1, the second bit as the coefficient an2 of xn2, the (n1)th bit as the coefficient a1 of x and the nth bit as the constant term a0. Roughly speaking, the 32 bits of the CRC are defined to be the polynomial remainder R(x) when the polynomial defined by the data M(x) is divided by a standard polynomial: G(x)= 1+x+x2+x4+x5+x7+x8+x10+x11+x12+x16+x22+x23+x26+x32. Slight modifications are made for implementation reasons, but as far as the error properties are concerned, this is what is calculated. Channel C Channel A Channel D The CRC bits are appended onto the data. When the data is received, the CRC is calculated and compared with the received CRC. If there is a difference, the data is known to have been corrupted. Channel B Bits Possibly Inverted by Error Burst Codeword Boundary ((1/0.0&+* +# 1./0 "..+. 3&0% ("*$0% +# /"2"* +!" &0 ,".&+!/ When a corruption occurs in transmission, a number of bits are inverted. Let the errored bits define the coefficients of a polynomial E(x); for example, if errors occur at bit positions p and q, the polynomial will be xnp + xnq. Since the operation of calculating CRCs is linear, the error is detected if and only if E(x) is not exactly divisible by G(x). CRC-generating polynomials such as G(x) are chosen precisely to detect as many polynomials like E(x) as possible. * !!&0&+* 0+ 0%" "..+. !"0" 0&+* 0%" +!" %/ +0%". ,.+,".0&"/ 0%0 ." %&$%(5 ,".0&*"*0 0+ ,%5/& ( 0.*/)&//&+* %" #&./0 +# 0%"/" &/ .1* ("*$0%80%" )4&)1) *1)". +# +*/" 10&2" 6".+/ +. +*/" 10&2" +*"/ 0.*/)&00"! +* *5 +!" /0.") %&/ &/ &),+.0*0 &* 0.*/)&//&+* /5/0")/ 3%"." /+)" #+.) +# (+ ' &*#+.)0&+* &/ ." +2"."! #.+) 0%" !0 /0.") /&* " (+ ' ." +2".5 1/1((5 !","*!/ +* ." "&2&*$ 1$1/0 "3("007 '.! +1.*( A B C C D A D B Codeword Boundary &8567 )5525 %'5266 6<1',521286 ',%11)/6 &8567 2* /)1+7, '2558376 83 72 )-+,7 '2() &-76 5)%621%&/) ()16-7< 2* 6-+1%/ 75%16-7-216 25 7,) #>1<> '2() 7,-6 0%;-080 581 /)1+7, -6 :,)7,)5 21 *285 ',%11)/6 25 21 21) 127,)5 3,<6-'%/ %775-&87) 2* 7,) '2() -6 7,) 5811-1+ (-+-7%/ 680 !?7,) (-**)5)1') &)7:))1 7,) 180&)5 2* =)526 %1( 7,) 180&)5 2* 21)6 -1 7,) 75%160-77)( &-7 675)%0 6-1') 7,) '2() 75%160-66-21 &)+%1 &281()( ! )1685)6 &281()( &%6)/-1) :%1()5 25 7,) *285>3%-5 6',)0) 7,) ! -6 &281()( &)7:))1 * %1( ) 25 7,) 6-1+/)>675)%0 6',)0) 7,) &281(6 %5) * %1( ) ",) &281(6 %5) 127 6<00)75-'%/ &)'%86) 2* 7,) %/7)51%7-21 58/)?% :)-+,7> '2():25( -6 %/:%<6 6)17 *-567 21 % ',%11)/ :,)1 7,)5) -6 % ',2-') 2* 81&%/%1')( '2():25(6 C A D B )7)'7-21 2* % &8567 2* /)1+7, &8567 2* /)1+7, -6 %/> :%<6 ()7)'7)( &)'%86) 2* 7,) 2**6)7 %1( 7,) '2(-1+ 6',)0) 1 6800%5< 7,)1 7,) ',2-') 2* '2() :-7, 7,) %/7)5> 1%7-9) )1( ()/-0-7)56 :25.-1+ 21 723 2* 7,) 2**6)7 75%160-6> 6-21 6',)0) %//2:6 #>1< 72 0))7 6 5)> 48-5)0)176 7 :-// ()7)'7 7,5)) 6)3%5%7) 6-1+/)>&-7 )55256 %1<:,)5) -1 7,) *5%0) %1( -6 '%3%&/) 2* ()7)'7-1+ 68&67%1> 7-%/ &8567 )55256 *25 %// 7,) 0)(-% ',2-')6 :,-/) 0%-17%-1-1+ *%925%&/) 3,<6-'%/ 75%160-66-21 %775-&87)6 ",) %87,256 :28/( /-.) 72 7,%1. %// 2* 7,) 7)%0 0)0&)56 %7 %&25%725-)6 5-672/ %1( 7,) 26)9-//) )7:25.6 -9-6-21 *25 7,)-5 -1(-9-(8%/ '2175-&87-216 :,-', 0%() 7,) 7)%0 )**257 62 *8/*-//-1+ !3)'-%/ 7,%1.6 6,28/( +2 72 %7 ",%/)5 %1( %1 29) %7 %1( 72 %9-( 811-1+,%0 /-67%-5 2/)6 -5%1(% 2:&5%< %9-( 2.)5 %1( -',%)/ !35%77 %7 %&25%725-)6 :,2 %// 3529-()( 9%/8%&/) %(9-') -1 7,)-5 2:1 63)'-%/ :%<6 !"% '"! !""*," ! '%"#"'! % '+ )"%&,%' ! %"%'* && '" ! *& *% #'"! 9%1 -17 !'%"('"! '" "! "%* " !35-1+)5 #)5/%+ /%,87 "%* ! %' " %%"% "%%'! "& ((-> 621 $)6/)< (!'"! $(% !'& %"' 2'%/ %1( )75232/-> 7%1 5)% )7:25.6 !7%1(%5(6 200-77)) 5%*7 )7)'7-21 2* % &8567 2* /)1+7, &8567 2* /)1+7, :-// %/:%<6 &) ()7)'7)( &)'%86) 2* 7,) 2**6)7 &)7:))1 ',%11)/6 8+867 ):/)77>%'.%5( 2851%/