CODES
CODES
Coding
• The digital systems understands only 0’s and 1’s i.e. binary
language
• Generally information is in numeric, alphabetic or alphanumeric
form.
• Before processing the information by digital circuits information
should be converted into binary language.
• Coding is a process of conversion of information into binary
language.
• The codes in which the decimal digits 1 to 9 represented by
binary digits is called binary codes
• Number of codes are developed to simplify the communication
between machine and man.
• Generally information available in numerical, alphabetic or
alphanumeric form and it will not be understood by digital
circuits and digital systems so coding is needed.
Binary codes
• Gray codes have a very special feature that, only one bit will
change each time the decimal number is incremented (see the
figure below). As only one bit changes at a time, gray codes are
also known unit distance code.
To detect and correct the errors, additional bits are added to the data
bits at the time of transmission.
•The additional bits are called parity bits. They allow detection or
correction of the errors.
•The data bits along with the parity bits form a code word.
Parity Checking of Error Detection
Even Parity − Even parity means the number of 1's in the given
word including the parity bit should be even (2,4,6,....).
Odd Parity − Odd parity means the number of 1's in the given word
including the parity bit should be odd (1,3,5,....).
Use of Parity Bit
• The parity bit can be set to "0" or "1" depending on the type of
the parity required.
• For even parity, this bit is set to 1 or 0 such that the number of "1
bits" in the entire word is even. See Fig. (a).
• For odd parity, this bit is set to 1 or 0 such that the number of "1
bits" in the entire word is odd. See Fig. (b).
How Does Error Detection Take Place?
If an error is detected, then the receiver will ignore the received byte
and request for retransmission of the same byte to the transmitter.
Advantages of Binary Codes
Binary codes are widely used in various fields due to their high
efficiency in information representation.
•Digital Displays − Binary codes are also used to display numbers and
alphabets in digital systems.
•Barcode Systems − Binary codes are also used in barcode systems for
product identification and inventory management. In this system, bars
of different width and spaces between them represent binary digits
that can be interpreted by a scanner.
•Data Storage − Binary codes are used to store information in
digital devices like computer memory.