Different Types of Code Lecture-09
Different Types of Code Lecture-09
Lecture#09
Gray Code n Error Detecting Code
The first bit(MSB) of the Gray code is the same as the first
bit of the binary number
The second bit of the Gray code equals the exclusive- OR, of
the first and second bits of the binary number,i.e it will be 1
if these binary code bits are different and 0 if they are the
same
The third Gray code bit equals the exclusive- OR of the
second and third bits of the binary number, and so on
Binary to Gray code conversion
Binary to Gray code conversion
The first binary bit (MSB) is the same as that of the first
Gray code bit.
If the second Gray bit is 0,the second binary bit is the same
as that of the first binary; if the second Gray bit is 1, the
second binary is the inverse of its first binary bit.
Step 2 is repeated for each successive bit.
Gray to Binary code conversion
Gray to Binary code conversion
=
Error Detecting Codes
Error-detecting codes are a sequence of numbers
generated by specific procedures for detecting errors in
data that has been transmitted over computer networks.
When bits are transmitted over the computer network,
they are subject to get corrupted due to interference and
network problems. The corrupted bits leads to spurious
data being received by the receiver and are called
errors.
Error – detecting codes ensures messages to be
encoded before they are sent over noisy
channels. The encoding is done in a manner so
that the decoder at the receiving end can detect
whether there are errors in the incoming signal
with high probability of success.
Features of Error Detecting Codes
Error detecting codes are adopted when backward error
correction techniques are used for reliable data transmission. In
this method, the receiver sends a feedback message to the sender
to inform whether an error-free message has been received or not.
If there are errors, then the sender retransmits the message.
Error-detecting codes are usually block codes, where the message
is divided into fixed-sized blocks of bits, to which redundant bits
are added for error detection.
Error detection involves checking whether any error has occurred
or not. The number of error bits and the type of error does not
matter.
Error Detection Techniques
000 1 0001
001 0 0010
010 0 0100
011 1 0111
100 0 1000
101 1 1011
110 1 1101
111 0 1110
Here, the number of bits present in the odd parity codes is 4. So,
the possible odd number of ones in these odd parity codes are 1 &
3.
•If the other system receives one of these odd parity codes, then
there is no error in the received data. The bits other than odd parity
bit are same as that of binary code.
•If the other system receives other than odd parity codes, then there
is an errors in the received data. In this case, we can’t predict the
original binary code because we don’t know the bit positions of
error.
Therefore, odd parity bit is useful only for detection of error in the
received parity code. But, it is not sufficient to correct the error.