Error detection and correction codes

1,486 views 32 slides Aug 06, 2021
Slide 1
Slide 1 of 32
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32

About This Presentation

Error Detection and Correction in Digital Circuits, Parity Bit, Block Parity , Hamming Code


Slide Content

Dr. (Mrs.) GargiKhanna
Associate Professor
Electronics & Communication Engg. Deptt..
National Institute of Technology Hamirpur
(HP)
By:-

oError detection and correction Codes
oParity codes
oBlock Parity Codes
oHamming codes

When the digital information in the binary form is
transmitted from one circuit or system to another circuit or
system an error mayoccur due to interference, noise, etc
Hence, data will be corrupted
This means the signal corresponding to 0 may change to 1
or vice-versa due to presence of noise
Need schemes devised to detect and correct the error

•Tomaintaindataintegritybetweentransmitterand
receiver,extrabitormorethanonebitareaddedinthe
data.
•Theseextrabitsallowthedetectionandsometimesthe
correctionoferrorinthedata.
•Thedataalongwiththeextrabit/bitsformthecode
•Codeswhichallowonlyerrordetectionarecallederror
detectingcodesandcodeswhichallowerrordetection
andcorrectionarecallederrordetectingandcorrecting
codes
3

Single-bit error
Only 1 bit in the data unit has changed.

•A paritybitisusedfor thepurposeofdetecting
errors during transmission of binary information.
•A parity bit is an extra bit included with a binary
message to make the number of 1s either odd(
ODD Parity)oreven (EVEN Parity).
•Themessageincludingtheparitybitis
transmittedandthencheckedatthereceiving
endforerrors.
•Anerrorisdetectedifthecheckedparitydoesnot
matchwiththeonetransmitted.
3

Even/odd parity:
is basic method for detecting if an odd number of bits
has been switched by accident.
Odd parity:
The number of 1-bit must add up to an odd number
Even parity:
The number of 1-bit must add up to an even number

•Thecircuitthatgeneratestheparitybitinthetransmitter
iscalledaparitygeneratorandthecircuitthatchecksthe
parityinthereceiveriscalledaparitychecker.
•Asageneralruleinthedigitalsystemwherethe
transmissionsystemisrelativelyshort,itmaybeassumed
thatprobabilityofasingle-biterrorissmallandthatofa
double-biterrorandhigherordererrorsisextremely
small.
Theparityerrordetectionsystemdetectsanyoddnumber
oferrors.
However,itcannotdetectevennumberoferrorsassuch
errorswillnotdestroytheparityofthetransmittedgroup
ofbits 8

ASCII code may have an extra bit appended to detect
data transmission errors
P = 0if the number of 1s in the character is even, else P
= 1(even parity)
P = 0 if the number of 1s in the character is odd, else P =
1 (odd parity)
If any single bit changes, parity will be wrong at receive
end
Even parityOdd parity
ASCII A = 10000010100000111000001
ASCII T = 101010011010100 01010100

Parity bit
Even parity: additional bit
added to make total number of
1’s even.
Odd parity: additional bit added
to make total number of 1’s odd.
Example of odd parity on ASCII
values.Character ASCII Code
0 10110000
1 00110001
. . . . . .
9 10111001
: 10111010
A 11000001
B 11000010
. . . . . .
Z 11011010
[ 01011011
\ 11011100


Parity bits

Parity bit can detect odd
number of errors but not even
number of errors.
Example: Assume odd parity,
1001110001(detected)
1001110101(not detected)
Parity bits can also be applied
to a block of data.
CS2100Number Systems and Codes 110110 1
0001 0
1011 0
1111 1
1001 1
0101 0
Column-wise
parity
Row-wise parity

Assume we are using even paritywith 7-bit ASCII.
The letter V in 7-bit ASCII is encoded as 01101011.
How will the letter V be transmitted?
Because there are four 1s (an even number), parity is set to
zero.
This would be transmitted as: 01101010.
If we are using anodd parity:
The letter V will be transmitted as 01101011

Whenseveralbinarywordsaretransmittedorreceivedin
succession,theresultingcollectionofbitscanberegardedasa
blockofdata,havingrowsandcolumns.
Example:foureightbitwordsinsuccessionforman4x8block.
Paritybitscanthenbeassignedtobothrowsandcolumns.
Thisschemeisknownasblockparity
Itmakesitpossibletocorrectanysingleerroroccurringin
adatawordandtodetectanytwoerrorsinaword.
1
3

Sometimes, it is not enough to do error detection. We
may want to correct the errors.
Error correction is expensive. In practice, we may use
only single-bit error correction.
Popular technique: Hamming code.
CS2100Number Systems and Codes 15

In the late 1940’s Richard Hamming recognized that
the further evolution of computers required greater
reliability, in particular the ability to not only detect
errors, but correct them. His search for error-
correcting codes led to the Hamming Codes and the
extended Hamming Codes.

18
Hamming Code
Detects single and double-bit errors
Application
Computing
Telecommunication (i.e. networking)
Theory
Using 4 data bits, can generate 3 correction bits
giving a total of 7 bits
Can correct any single bit error

Hammingcode…
Data: bit-stream write data in particular sequence
receiver checks Hamming codes, corrects errors
transmit
compute, add hamming code bits to data
Corrected data

Hammingcodenotonlyprovidesthedetectionofabit
error,butalsoidentifieswhichbitisinerrorsothatitcan
becorrected.
Thushammingcodeiscallederrordetectingand
correctingcode.
Thecodeusesanumberofparitybits(dependentonthe
numberofinformationbits)locatedatcertainpositionina
group.
Numberofparitybits:
Thenumberofparitybitsdependsonthenumberof
informationbits
Ifthenumberofbitsisdesignatedasx,thenthenumberof
paritybitsPisdeterminedusingtherelation
2
??????
≥ ??????+ ??????+ 1
20

Location of the parity bits in a code:
•The parity bits are located in the positions that are
numbered corresponding to ascending powers of
two(1,2,4,8,….).
•Therefore, for 7-bit code, locations for parity bits and
information bits are as follows:
D
4, D
3,D
2,P
3, D
1,P
2,P
1
Assigning values to parity bit:
•In hamming code , each parity bit provides a check on
certain other bits in the total code, therefore we must
know the value of these others in order to assign the
parity bit value.
22

Bit Designation D
7D
6 D
5 P
4 D
3 P
2P
1
Bit Location 7 6 5 4 3 2 1
Binary Location
Number
111110101100011010001
Information Bits
Parity Bits
24

AssignmentofP
1:
Thisparitybitchecksallbitlocations,thathave1sinthe
samelocationinthebinarylocationnumbers.
AssignmentofP
2:
Thisparitybitchecksallbitlocations,thathave1sinthe
middlebit.
AssignmentofP
3:
Thisparitybitchecksallbitlocations,thathave1sinthe
left-mostbit.
26

AssignmentofC
1:
Thisparitybitchecksallbitlocations,thathave1sinthe
samelocationinthebinarylocationnumbers.
AssignmentofC
2:
Thisparitybitchecksallbitlocations,thathave1sinthe
middlebit.
AssignmentofC
4:
Thisparitybitchecksallbitlocations,thathave1sinthe
left-mostbit.
C
4C
2C
1
30