L3 Binary Codes
L3 Binary Codes
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