More Related Content
Similar to error handling codes (20)
error handling codes
- 2. We can minimize effect of noise signals by using various
modulation and demodulation technique but still noise can cause
errors. To further reduce effects of noise especially in data
communication channel coding is used the use of various coding
technique enables us to detect and even correct errors. There are
two error control coding techniques
© 2020 APARNA LAL
- 3. 1.Forward error correction code (FEC)
Here large amount of controlled redundancy that is extra bit is added to a
message before transmission. This redundancy bits enable the receiver
to make a reliable guess of the transmitted information when an error is
detected the redundancy bits are used to determine which bit as an error
by complementing it. This system of error detection and correction is
called as FEC. In simplex system there is no return path for the receiver
to automatically request retransmission in the event of an error.
Therefore in such system FEC coding system is more useful.
© 2020 APARNA LAL
- 4. 2. Automatic repeat request scheme ( ARQ)
A small amount of controlled redundancy is added to a
message to allow the receiver to detect if an error
is detected, the user can either ignore the message or
request a source to reset the message. Note that in order
to request for the user retransmission the communication
link must be two way. This method is called as automatic
retransmission request. Duplex system use this method
since it is more reliable than FEC
© 2020 APARNA LAL
- 5. Hamming Code:-
In communication one of the most common FEC type error
detection and correction code is hamming code It makes the use
of concept of addition of extra parity bits called error correction
bits in the data information to be communicated. Here first
message called hamming code words is generated consisting of
data information and parity bits. Constructed message is
transmitted. When Hamming code word is received at receiver,
adding parity bit helps not only in identifying an error during
transmission but also in its location in the message. Once
location is known that it can be inverted to generate correct data
information.
© 2020 APARNA LAL
- 6. Number of parity bits
If length is ‘ m’ then number of extra parity bits required, ‘ P’ is calculated
by the hamming rule:
m+P+1<=2^P.
Mostly P is determined by trial and error method using above rule.
For example: if we want to transmit 4 bit data information then M=4.
Let P=2 then m+P+1= 2+4+1=7. Since 2^P=2^2=4.
Here P cannot be equal to 2. Therefore hamming rue is not satisfied.
Let P=3 then m+P+1= 3+4+1=8. Since 2^P=2^3=8.
Here P is equal to 3. Therefore hamming rule is satisfied.
Thus hamming code word in this case will have 4 bits data information
and additional 3 parity bits. The length of hamming code word is 4 + 3= 7.
© 2020 APARNA LAL
- 7. 7 Bit Hamming Code
Note that the parity bits are inserted at each 2n Bit where n=0,1,2,3…… Thus P1 is at 20
=1 and so on
© 2020 APARNA LAL
- 8. Computing of Parity Bits
Computing parity involves counting the number of ones in a unit
of data and adding either a 0 or a one (called the parity bit) to
make the count odd( for odd parity) or even ( for even parity); for
example 1001 is a 4- bit data unit containing two one
bits; since that is an even number zero would be added to
maintain even parity. To maintain odd parity one would be added
in original no 1001.
© 2020 APARNA LAL
- 9. Construction of Hamming Code
The algorithm to generate, Hamming Code for any
number of bits is given in below :
• Number bits starting from 1: bit 1,2,3,4,5,etc.
• Write the bit numbers in binary: 1, 10, 11, 100, 101,
etc
• Mark all bit positions that are powers of 2 as parity
bits. Positions : 1,2,4,8,16,32,etc .
(have only 1 bit in the binary form of their position i.e
1,10,100,1000)
• Mark all other bit positions as data bits.
© 2020 APARNA LAL
- 10. 5. Parity bits are computed as follows:
1. Parity Bit 1 covers all bit position which have the least significant bit set.
2. Parity Bit 2 covers all bit position which have the second least significant bit set.
3. Parity Bit 4 covers all bit position which have the third least significant bit set.
4. Parity Bit 8 covers all bit position which have the fourth least significant bit set.
© 2020 APARNA LAL
- 11. Parity Bit Bits to be checked
P1 1,3,5,7,9,11,13,15,….
P2 2,3,6,7,10,11,14,15,…
P3 4,5,6,7,12,13,14,15,…
P4 8,9,10,11,12,13,14,15,…..
© 2020 APARNA LAL
- 12. Example:1
A bit word 1011 is to be transmitted. Construct the even parity seven-bit hamming Code for this data.
The code word format:
D7
1
D6
0
D5
1
P4 D3
1
P2 P1
Step 2: Decide P1
D7
1
D6
0
D5
1
P4 D3
1
P2 P1
1
© 2020 APARNA LAL
- 13. Step 3: Decide P2
D7
1
D6
0
D5
1
P4 D3
1
P2
0
P1
1
Step 4: Decide P4
D7
1
D6
0
D5
1
P4
0
D3
1
P2
0
P1
1
D7
1
D6
0
D5
1
P4
0
D3
1
P2
0
P1
1
Complete Code word
© 2020 APARNA LAL
- 14. 2. Encode the data bit 0 1 0 1 into a seven bit even parity Hamming Code .
3. Encode the data bit 0 1 0 1 into a seven bit odd parity Hamming Code .
4. A bit word 1011 is to be transmitted. Construct the odd parity seven-bit
hamming Code for this data.
© 2020 APARNA LAL
- 15. Cyclic Redundancy Check-
• Cyclic Redundancy Check (CRC) is an FEC error detection method.
• It is based on binary division.
CRC Generator-
• CRC generator is an algebraic polynomial represented as a bit
pattern.
• Bit pattern is obtained from the CRC generator using the following
rule-
The power of each term gives the position of the bit and the
gives the value of the bit.
© 2020 APARNA LAL