Beruflich Dokumente
Kultur Dokumente
h
a
b
a
r
8/10/2012
ERRORDETECTION
ERROR
DETECTION
&
ERRORCORRECTION
M
T
U
ASCIIA= 10000010100000111000001
ASCIIT= 10101001101010001010100
ASCIIe= 11001010110010111100101
TheextrabitisaddedastheLeftMostBit,Evenparityismorecommon
8/10/2012
ERRORDETECTINGCODE
contd.
K
h
a
b
a
r
M
T
U
HAMMING CODE
Electrical Signals may affect the Memory path
causing errors while storing or retrieving Data.
Memory reliability can be enhanced by
employing Err Deting & Corrtion Codes
e.g. when parity Bit is employed for the
purpose, it is stored with the Data word in the
memory. As & when it is retrieved & if the
parity is not correct err is detected but can
cantt
be corrected.
contd
8/10/2012
HAMMING CODE
contd
K
h
a
b
a
r
contd
Hamming Code
contd
M
T
U
8/10/2012
Hamming Code
contd
K
h
a
b
a
r
Bit Position 1 2 3 4 5 6 7 8 9 10 11 12
0 0 1 1 1 0 0 1 0 1 0 0
On retrieval the parity is checked for the same set of
bits including parity bits (Even parity)
C1 = XOR of bits (1, 3, 5,7, 9, 11) = 0
C2 = XOR of bits (2, 3, 6, 7, 10, 11) = 0
=0
C4 = XOR of bits (4, 5, 6, 7, 12)
C8 = XOR of bits (8, 9, 10, 11, 12) = 0
Hamming Code
1
0
1
0
2
0
0
0
3
1
1
1
M
T
U
Bit
Pos.n:
4
1
1
1
C8
For no error
0
For error in bit 1 0
For error in bit 5 0
5
1
1
0
6
0
0
0
7
0
0
0
8
1
1
1
contd
9 10 11 12
0 1 0 0 No Error
0 1 0 0 Error in bit 1
0 1 0 0 Error in
i bit
bi 5
C4
C2
C1
0
0
1
0
0
0
0
1
1
8/10/2012
Hamming Code
contd
K
h
a
b
a
r
Hamming
HammingCode
Code
contd
contd
M
T
U
Thegroupingofbitsforparitygenrtion and
checking can be determined from a list of
checkingcanbedeterminedfromalistof
binarynumbersfrom0to2k 1.
LSBis1inthebinarynos1,3,5,7,..
The2nd significantbitis1binarynos.2,3,6,7..
Eachgroupstartswithapowerof2::1,2,4
Thenumbersarealsothepositionnumberof
theparitybits.
8/10/2012
HammingCode
contd
K
h
a
b
a
r
SINGLEERRORCORR,DOUBLEERRORDetection
ByaddinganotherparityHCcancorrectsinglebitanddetect
doubleerrorbits.
Addinganotherbittotheprev12bitwordandevaluatingitwith
XORingallthe12bitsweget
001110010100P13
0011100101001(evenparity)
OnretrievingdatawordifP=0thenparityiscorrectelseitisincorrect.
If C=0 and P=0 no error has occurred
IfC=0andP=0,noerrorhasoccurred
IfC0andP=1,asingleerroroccurredthatcanbecorrected
IfC0andP=0,adoubleerroroccurredthatisdetectedbutcantbe
corrected
IfC=0andP=1,asingleerroroccurredinP13 bit
EX.IC74637uses5bitparity&8bitdataword
M
T
U
10.Given8bitDataword,01011011,Findthe13bitHCword
thatcorrectssingleerrorsanddetectsdoubleerrors.
11.Obtain15bitHammingcodewordfor11bitdataword
11001001010
12.Thefollowing12bithammingwordcontaining4paritybits
arereceived.Whatweretheoriginal8bitdatawordwritten
intomemory?
(a)000011101010
(b)101110000110
( ) 101111110100
(c)101111110100
13.Howmnay paritycheckbitsmustbeincludedtoachieve
singleerrorscotrection anddoubleerrordetectionforthe
followingdatawords:
(a)16bits,(b)32bits,(c)48bits.