Beruflich Dokumente
Kultur Dokumente
ANDHRA PRADESH
Name : P.Swarupa
Designation : Lecturer
Branch : ECE
Institute : Govt.Polytechnic, Masab Tank, Hyd.
Semester : III Semester
Subject : Digital Electronics
Subject Code : EC – 304
Topic : Basics of Digital Electronics
Duration : 50 Mts.
Sub-Topic : Digital Codes
Teaching Aids : PPT Animations
EC304.6 1
Objectives
• On the completion of this topic, you would be able to
Know
• Weighted codes.
• Unweighted codes.
• Comparison of weighted and unweighted codes
• Conversion of 8421, Excess-3 & Gray code to binary
and vice-versa.
• Alphanumeric codes
• Parity Bit.
EC304.6 2
Recap
EC304.6 3
Binary Codes
EC304.6 4
Weighted Codes
• Digital codes are classified as (i) weighted codes (ii)
unweighted codes.
EC304.6 6
BCD Code
EC304.6 7
Conversion of Binary Code to 8421 Code
EC304.6 8
Conversion of 8421 Code to
Binary Code
EC304.6 9
Excess-3 Code
• Is a 4 bit Code.
EC304.6 10
To convert Binary number 1100 to Excess-3 code
1100 Binary code is equivalent to (12)10
Add 3 to each decimal digit
• 1 2
• +3 +3
• ------- -------
• 4 5
• ------- -------
45 is equivalent to 0100 0101
(1100)2 = (12)10 = 0100 0101 is the
• Excess-3 Code
EC304.6 11
Gray Code
EC304.6 12
Binary - Gray Code
• Write the MSB of the binary as it is
• 1 0 0 1
• 1
• Add the MSB to the next lower significant bit of Binary
number & note down the sum, ignore the carry
• 1001 1+0=1
• 0+0=0
• 1101 0+1=1
• Continue the same process till all the binary digits are
added.
• 1101 is the gray code of 1001 binary number.
EC304.6 13
To convert Gray Code 1110 number to
Binary Code number
• Binary number 1
• Add the MSB of the Binary to next LSB of gray code,
note down the sum, ignore the carry
• Gray code number 1 1 1 0
• Binary number 1 0 1 1
• 1011 is the binary number of 1110 gray code number
EC304.6 14
Alphanumeric codes
EC304.6 15
ASCII
EC304.6 16
EBCDIC
EC304.6 17
Parity Bit
EC304.6 18
• Parity means number of once in a digital data may be
even or odd.
EC304.6 20
Summary
• We have discussed about
• Differences
• Conversion of 8421, Excess-3 and Gray code to
binary and vice-versa.
EC304.6 21
QUIZ
EC304.6 22
1. The code used for 9 in BCD ________
c) 1001
d) 1010
e) 1011
f) 1111
EC304.6 23
2. Example of unweighted code
c) Excess-3
d) Binary code
e) BCD Code
f) Decimal
EC304.6 24
3. Example of weighted code
• (i) Excess-3
• (ii) Gray code
• (iii) BCD Code
• (iv) none
EC304.6 25
Frequently Asked Questions
• Give the difference between weighted and unweighted
codes.