0% found this document useful (0 votes)
5 views14 pages

L3 Binary Codes

The document discusses digital design and binary codes, explaining their symbolic representation of information using binary digits (0 and 1) for communication in digital computers. It classifies binary codes into five groups, including weighted and non-weighted binary codes, error detecting and correcting codes, and alphanumeric codes. Additionally, it covers specific examples of these codes, such as BCD, Excess-3, and Gray codes, along with methods for converting between binary and Gray codes.

Uploaded by

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

L3 Binary Codes

The document discusses digital design and binary codes, explaining their symbolic representation of information using binary digits (0 and 1) for communication in digital computers. It classifies binary codes into five groups, including weighted and non-weighted binary codes, error detecting and correcting codes, and alphanumeric codes. Additionally, it covers specific examples of these codes, such as BCD, Excess-3, and Gray codes, along with methods for converting between binary and Gray codes.

Uploaded by

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

Digital Design

Binary Codes
Codes
• Codes are the symbolic representation of discrete information,
which may be presented in the form of numbers, letters or
physical quantitates.
• The symbols used for binary digits are 0 and 1 which are
arranged according to the specified rule to make it as
information.
• These codes are formed for communication information using
digital computers.
ENCODER

Numbers/letters/Words
+/-/*/? 10101100
• (Information)
(Digital Codes)
Process ins Called ENCODING
Codes Classification
• Binary Codes are broadly classified into five groups
1. Weighted Binary Codes
(Eg. 8421 , 2421 and BCD codes)
2. Non-Weighted Binary Codes
(Eg. Exess-3 and Grey Codes)
3. Error Detecting Codes
(Eg. Even-Parity code, Odd-Parity code, Check sums)
4. Error Correcting Codes
(Eg. Hamming code)
5. Alphanumeric codes
(Eg. ASCII codes)
Weighted Binary Codes
• These codes obey the Positional Weighting Principles.
• Each number represents a specific weight.
• The bits are multiplied with indicated weights, the sum
gives the decimal equivalent number
• Eg: 8421, 2421 and BCD codes
Weighted Binary Codes : 8421 and 2421 codes

Weights

8 4 2 1 Decimal 2 4 2 1 Decimal
Equivalent Equivalent
0 0 0 0 0 0 0 0 0 0
0 0 0 1 1 0 0 0 1 1
0 0 1 0 2 0 0 1 0 2
0 0 1 1 3 0 0 1 1 3
0 1 0 0 4 0 1 0 0 4
0 1 0 1 5 1 0 1 1 5
0 1 1 0 6 1 1 0 0 6
0 1 1 1 7 1 1 0 1 7
1 0 0 0 8 1 1 1 0 8
1 0 0 1 9 1 1 1 1 9
Weighted Binary Codes : BCD Codes
• Binary Coded Decimals (BCD): Uses Binary number to specify
decimal equivalent
• 8Uses four bits case for each decimal value
4 2 1 Decimal 8 4 2 1 8 4 2 1 Decimal
Equivalent Equivalent
0 0 0 0 0 0 0 0 1 0 0 0 0 10
0 0 0 1 1 0 0 0 1 0 0 0 1 11
0 0 1 0 2 0 0 0 1 0 0 1 0 12
0 0 1 1 3 0 0 0 1 0 0 1 1 13
0 1 0 0 4 0 0 0 1 0 1 0 0 14
0 1 0 1 5 0 0 0 1 0 1 0 1 15
0 1 1 0 6 0 0 0 1 0 1 1 0 16
0 1 1 1 7 0 0 0 1 0 1 1 1 17
1 0 0 0 8 0 0 0 1 1 0 0 0 18
1 0 0 1 9 0 0 0 1 1 0 0 1 19
Non-Weighted Binary Codes
• These codes not obey any Positional Weighting
Principles.
• Each number is not assigned a fixed value.
• They obey a special rule hat an encoder decides
• Eg.: Excess-3 and Grey Codes
Non-Weighted Binary Codes : Excess-3
• It is obtained by adding “3” to a decimal number. Its binay gives
the exact code.
• It also uses four bits format as that of BCD codes
BCD XS-3 DE
0 0 0 0 0 0 1 1 0
0 0 0 1 0 1 0 0 1
0 0 1 0 0 1 0 1 2
0 0 1 1 0 1 1 0 3 0 1 0 0 0 0 1 1 10
0 1 0 0 0 1 1 1 10 and
4 11 in XS-3
0 1 0 1 1 0 0 0 5 0 1 0 0 0 1 0 0 11
0 1 1 0 1 0 0 1 6
0 1 1 1 1 0 1 0 7
1 0 0 0 1 0 1 1 8
1 0 0 1 1 1 0 0 9
Non-Weighted Binary Codes : Gray Code
• Are also called MINIMUM CHANGE CODES
• In these codes only one bit in code group changes when moving
from one step to next
Binary Gray DE
Codes
0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1 1
0 0 1 0 0 0 1 1 2
0 0 1Also
1 0 Called
0 1 0 Unit
3 Distant Codes
0 1 0 0 0 1 1 0 4
0 1 0 1 0 1 1 1 5
Used in Analog to Digital Converters
0 1 1 0 0 1 0 1 6
0 1 1 1 0 1 0 0 7
Mirror Image Codes
1 0 0 0 1 1 0 0 8
1 0 0 1 1 1 0 1 9
Binary to Gray Code Conversion

1.The Most Significant Bit (MSB) of


the gray code is always equal to the
MSB of the given binary code.
2.Other bits of the output gray code
can be obtained by XORing binary
code bit at that index and previous
index.
Gray to Binary Code Conversion

1.The Most Significant Bit (MSB) of


the binary code is always equal to
the MSB of the given gray code.
2.Other bits of the output binary
code can be obtained by checking
the gray code bit at that index. If
the current gray code bit is 0, then
copy the previous binary code bit,
else copy the invert of the previous
binary code bit.
Alphanumeric codes
1.A complete alphanumeric code would include the 26
lowercase characters, 26 uppercase characters, 10
numeric digits, etc.

2. There are many choices of codes sets to represent


alphanumeric characters and several control
characters.

3. Two well accepted code sets are used for information


coding:

• EBCDIC code: extended binary coded decimal


interchange code.
Example
• 1. Write the ASCII code for
the message: The email is

• Answer: 1010100 1101000


1100101 1100101 1101101
1100001 1101001 1101100
1101001 1110011

You might also like