0% found this document useful (0 votes)
12 views12 pages

10-Dec-2019 - Binary - Codes - 3

Binary codes represent data using binary digits (bits) of 1s and 0s. The minimum number of bits needed to represent n distinct quantities is n bits. There are different types of binary codes such as weighted codes which assign values to bits based on their position (e.g. BCD), and unweighted codes like gray code where only one bit changes between consecutive values. Error detection codes like parity bits can be used to detect errors during data transmission by checking that the total number of 1s is even or odd.

Uploaded by

pasangatech9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views12 pages

10-Dec-2019 - Binary - Codes - 3

Binary codes represent data using binary digits (bits) of 1s and 0s. The minimum number of bits needed to represent n distinct quantities is n bits. There are different types of binary codes such as weighted codes which assign values to bits based on their position (e.g. BCD), and unweighted codes like gray code where only one bit changes between consecutive values. Error detection codes like parity bits can be used to detect errors during data transmission by checking that the total number of 1s is even or odd.

Uploaded by

pasangatech9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 12

Binary Codes

Binary Codes
• Bit – binary digit
• An n-bit binary code is a group of n bits that assumes up
to 2n distinct combinations of 1’s and 0’s, with each
combination representing one element of the set that is
being coded
• Minimum number of bits to code 2n distinct quantities is n
Decimal Codes

– Only written for (0-9) digits


– Requires minimum four bits

Weighted Codes: The representation of the digit is obtained based


on the weight assigned to the binary bits according to their
positions

• 8 4 2 1 [BCD (Binary Coded Decimal)]


• 2 4 2 1 code
• 8 4 -2 -1 code
• 5 0 4 3 2 1 0 (Biquinary code)
Un-Weighted Codes
Excess – 3 code

J.Saira Banu
Self Complementary Code
• 9’s complement of the decimal number is obtained by changing 1’s
to 0’s and 0’s to 1’s
• Ex: 395 in 2 4 2 1 code is 0011 1111 1011
9’s complement of 395 = 604 in 2 4 2 1 is 1100 0000 0100
Examples of self complementary codes –
• 8 4 -2 -1 code
• 2 4 2 1 code
• Excess-3 code
Error detection codes
• Used to detect errors during transmission
• A parity bit is an extra bit included with a message to
make the total number of 1’s either odd or even
• The message including the parity bit is transferred to the
destination
• In the receiving end, all the incoming bits are applied to a
“parity check” network to check the proper parity
adopted.
• An error is detected if the checked parity does not
correspond to the adopted one.
Parity bit generation
Reflected code
• Number in reflected code
changes by only one bit
as it proceeds from one
number to the next.
• It is a non weighted
code.
• Also known as gray
code
• There are many possible
gray codes
• One possibility is shown
here
Alphanumeric Code
• It is a binary code of a group of elements
consisting of the ten decimal digits, the 26 letters
of alphabets and special symbols.
1. 7 bit ASCII code (American Standard Code for
Information Interchange)
– lower case + upper case + numerals+special
+control characters
– 94 Graphic printing characters.
– 34 Non-printing characters
2. 8 bit EBCDIC –Extended BCD Interchange code
ASCII Code
Control Characters in ASCII
References
• M. Morris Mano – Digital Logic and
Computer Design PHI – 5th Edition- 2004.
pp. 12 - 20

You might also like