SlideShare a Scribd company logo
1 of 26
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 2
Session 2: Focus
 Binary codes and their classifications
 Weighted codes
◦ Binary Coded Decimal (BCD)
 Various BCD formats
 Unsigned BCD arithmetic
 Packed and unpacked BCD
 Non-weighted codes
◦ Excess-3
◦ Gray code
◦ Optical Encoder Example using Gray Code
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com
Binary Codes
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 4
What are Binary Codes and
Why are they needed?
 Digital systems represent and manipulate not only
binary numbers, but also
◦ Many other discrete elements of information.
◦ Example: Digital speech signal, Character symbols (a, b, etc.)
 Any discrete element of information that is distinct
among a group of quantities can be represented
◦ With binary code, i.e., a pattern of 0’s and 1’s
 The digital data is represented, stored and transmitted
as group of binary bits
 A set of eight elements requires a three‐bit code and a
set of 16 elements requires a four‐bit code
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 5
Binary Codes
 Both letters, numbers, symbols are represented by
binary codes
◦ Various fonts used in word processors are examples of
binary codes
 Binary codes are used in computer applications and
digital data communication
 Binary codes ease implementation of digital circuits to
process encoded digital data
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 6
Classification of Binary Codes
 Weighted Codes
 Non-Weighted Codes
 Binary Coded Decimal Code
 Alphanumeric Codes
 Error Detecting Codes – Not covered in this course
 Error Correcting Codes – Not covered in this course
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com
Weighted Codes
Binary Coded Decimal (BCD)
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 8
Weighted Codes
 Weighted binary codes are those binary codes which obey the
positional weight principle.
 Each position of the number represents a specific weight.
 Several systems of the codes are used to express the decimal
digits 0 through 9.
 In these codes each decimal digit is represented by a group of
four bits
Courtesy: Tutorial Point
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 9
Binary Coded Decimal (BCD)
 Only the first 9
combinations of four bits
are valid
 The remaining 6
combinations are unused in
BCD
 Easier to represent decimal
digits in BCD which is
straightforward
 Example: (12.75)10
 BCD (8421):
 (0001 0010.0111 0101)8421
 (0001 0010.1101 1011)2421
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 10
Other BCDs
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 11
Unsigned BCD (8421) Addition
 Invalid (out of range) BCD values are corrected
by adding a value of 6 (0110) to it
 The reason for adding six is that six binary
combinations are unused in BCD (8421)
sequence
 Note that if just BCD is mentioned, it means 8421
Valid BCD
Invalid BCD
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 12
N-bit Unsigned BCD Addition
 It follows the same procedure with carry propagating
from right to left
Carry
BCD
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 14
Packed and Unpacked BCD
 When a BCD number is stored in a register inside
a processor, when each BCD number occupies one
register
◦ It is called Unpacked BCD
◦ Only lower four bits will be having the values, which is
not efficient in terms of register usage
 In packed BCD, based on the size of register, two
or more BCD numbers are stored in a register or
memory
◦ In a 8 bit register, two BCD numbers are stored
◦ In a 16 bit register, four BCD number are stored
◦ An 8 bit register having 57BCD reads 0101 0111
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com
Non-weighted Codes
Excess-3 Code
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 16
Non-weighted Codes: Excess-3
 No positional weights are assigned in non-weighted codes
◦ Examples: Excess-3 code and Gray code
Weighted Non-weighted
Courtesy: Tutorial Point
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 17
Excess-3 Codes
 The Excess-3 code is also called as XS-3 code.
 It is non-weighted code used to express decimal numbers.
 The Excess-3 code words are derived from the 8421 BCD code
words by adding 3 (0011) to each code word in 8421.
 This is a self complementing code
 A self complementing code for Base-10 is a code for which the
complement of a given encoded digit d[0-9] will result in 9-d, its
9's complement
◦ It helps in building digital circuits for subtraction
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 18
Excess-3 Code: Example
 Find Excess-3 code for the decimal value 597:
 The addition of ‘3’ to each digit yields three new
digits/numbers ‘8’, ‘12’ and ‘10’
 The corresponding four-bit binary equivalents are
1000, 1100 and 1010 respectively
 The excess-3 code for 597 is therefore given by: 1000
1100 1010
 59710 = 1000 1100 1010XS-3
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 19
Self complementing Code: Excess-3
 Self complementing means that
the 9’s complement of the
Excess-3 code can be got, by
just complementing the bits.
 For example:
 9’s complement of 95 is 4 (99-
95)
◦ Excess-3 of 95 : 1100 1000
◦ Complement bits: 0011 0111
◦ In Excess-3, it is : 04
◦ Which is 9’s complement of 95
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com
Non-weighted Codes:
Gray Codes
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 21
Constructing Gray Codes
Value
Gray code Gray code Gray code Gray code
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 22
Gray Codes
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 23
Gray Codes
 It is non-weighted code and it is not arithmetic code.
◦ i.e., Gray code cannot be used for arithmetic operations
 There are no specific weights assigned to the bit
positions in Gray codes
 It has a very special feature that, only one bit will
change each time the decimal number is
incremented
 As only one bit changes at a time, the gray code is
called as a unit distance code
 The gray code is a cyclic code.
◦ Circular shifts of each codeword gives another word that
belongs to the code
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 24
Use of Gray Codes
 It is a non-weighted code which belongs to a class of
codes called minimum change codes
 Here, two adjacent code numbers differs from each
other by only one bit
 Gray code is popularly used in the shaft position
encoders.
◦ A shaft position encoder produces a code word which
represents the angular position of the shaft
 It is also used in the transmission of digital signals
 The Gray code is used for labelling the axes of
Karnaugh maps
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 25
Optical Encoder
Coded Disc
Connected to a
Rotating Shaft
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 26
Session 2: Summary
 Binary codes and their classifications
 Weighted codes
◦ Binary Coded Decimal (BCD)
 Various BCD formats
 Unsigned BCD arithmetic
 Packed and unpacked BCD
 Non-weighted codes
◦ Excess-3
◦ Gray code
◦ Optical Encoder Example using Gray Code
Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 27
References
Ref 1 Ref 2

More Related Content

What's hot

digital logic circuits, digital component
digital logic circuits, digital componentdigital logic circuits, digital component
digital logic circuits, digital componentRai University
 
Ece 301 lecture 2 - number systems and codes
Ece 301   lecture 2 - number systems and codesEce 301   lecture 2 - number systems and codes
Ece 301 lecture 2 - number systems and codesXiaolong Fang
 
binary arithmetic rules
binary arithmetic rulesbinary arithmetic rules
binary arithmetic rulesstudent
 
Digital Principles-Number systems
Digital Principles-Number systemsDigital Principles-Number systems
Digital Principles-Number systemschandkec
 

What's hot (20)

Digital Design Session 28
Digital Design Session 28Digital Design Session 28
Digital Design Session 28
 
Digital Design Session 6
Digital Design Session 6Digital Design Session 6
Digital Design Session 6
 
Digital Design Course Summary
 Digital Design Course Summary Digital Design Course Summary
Digital Design Course Summary
 
Digital Design Session 14
Digital Design Session 14Digital Design Session 14
Digital Design Session 14
 
Digital Design Session 4
Digital Design Session 4Digital Design Session 4
Digital Design Session 4
 
Digital Design Session 26
Digital Design Session 26Digital Design Session 26
Digital Design Session 26
 
Digital Design Session 17
Digital Design Session 17Digital Design Session 17
Digital Design Session 17
 
Digital Design Session 25
Digital Design Session 25Digital Design Session 25
Digital Design Session 25
 
Digital Design Session 27
Digital Design Session 27Digital Design Session 27
Digital Design Session 27
 
Digital Design Session 29
Digital Design Session 29Digital Design Session 29
Digital Design Session 29
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
digital logic circuits, digital component
digital logic circuits, digital componentdigital logic circuits, digital component
digital logic circuits, digital component
 
Digital Design Session 18
Digital Design Session 18Digital Design Session 18
Digital Design Session 18
 
Ece 301 lecture 2 - number systems and codes
Ece 301   lecture 2 - number systems and codesEce 301   lecture 2 - number systems and codes
Ece 301 lecture 2 - number systems and codes
 
Bcd
BcdBcd
Bcd
 
number system
number systemnumber system
number system
 
binary arithmetic rules
binary arithmetic rulesbinary arithmetic rules
binary arithmetic rules
 
Digital Principles-Number systems
Digital Principles-Number systemsDigital Principles-Number systems
Digital Principles-Number systems
 
Code conversion r006
Code conversion r006Code conversion r006
Code conversion r006
 
Digital Design Session 19
Digital Design Session 19Digital Design Session 19
Digital Design Session 19
 

Similar to Digital Design Binary Codes

Lecture5 Chapter1- Binary Codes.pdf
Lecture5 Chapter1- Binary Codes.pdfLecture5 Chapter1- Binary Codes.pdf
Lecture5 Chapter1- Binary Codes.pdfUmerKhan147799
 
BCD,GRAY and EXCESS 3 codes
BCD,GRAY and EXCESS 3 codesBCD,GRAY and EXCESS 3 codes
BCD,GRAY and EXCESS 3 codesstudent
 
Student IP Addressing Tutorial.ppt
Student IP Addressing Tutorial.pptStudent IP Addressing Tutorial.ppt
Student IP Addressing Tutorial.pptjohnBronson6
 
Lecture 5 binary_codes
Lecture 5 binary_codesLecture 5 binary_codes
Lecture 5 binary_codesKamran Zafar
 
Digital electronics- BCD & Decoder
Digital electronics- BCD & DecoderDigital electronics- BCD & Decoder
Digital electronics- BCD & DecoderPritam Shil
 
Csl 202, code converters
Csl 202, code convertersCsl 202, code converters
Csl 202, code convertersCKSunith1
 
QR Integration with MuleSoft | MuleSoft Mysore Meetup #8
QR Integration with MuleSoft | MuleSoft Mysore Meetup #8QR Integration with MuleSoft | MuleSoft Mysore Meetup #8
QR Integration with MuleSoft | MuleSoft Mysore Meetup #8MysoreMuleSoftMeetup
 
DDD beyond the infamous repository pattern - GeeCon Prague 2018
DDD beyond the infamous repository pattern - GeeCon Prague 2018DDD beyond the infamous repository pattern - GeeCon Prague 2018
DDD beyond the infamous repository pattern - GeeCon Prague 2018Cyrille Martraire
 
Unit1_Part2-Machine_Instructions_Programs_7_9_2018_3pm.ppt
Unit1_Part2-Machine_Instructions_Programs_7_9_2018_3pm.pptUnit1_Part2-Machine_Instructions_Programs_7_9_2018_3pm.ppt
Unit1_Part2-Machine_Instructions_Programs_7_9_2018_3pm.pptChiragSuresh
 
Qrcodequickresponsecode presentation
Qrcodequickresponsecode presentationQrcodequickresponsecode presentation
Qrcodequickresponsecode presentationUmsh23
 
12.Representation of signed binary numbers. Binary codes - BCD code, Gray co...
12.Representation of signed binary numbers.  Binary codes - BCD code, Gray co...12.Representation of signed binary numbers.  Binary codes - BCD code, Gray co...
12.Representation of signed binary numbers. Binary codes - BCD code, Gray co...JatinJatin30
 
Sean Farmar - Successfully Decomposing Your Monolith or UpdateUser Means Noth...
Sean Farmar - Successfully Decomposing Your Monolith or UpdateUser Means Noth...Sean Farmar - Successfully Decomposing Your Monolith or UpdateUser Means Noth...
Sean Farmar - Successfully Decomposing Your Monolith or UpdateUser Means Noth...Codemotion
 

Similar to Digital Design Binary Codes (20)

Lecture5 Chapter1- Binary Codes.pdf
Lecture5 Chapter1- Binary Codes.pdfLecture5 Chapter1- Binary Codes.pdf
Lecture5 Chapter1- Binary Codes.pdf
 
BCD ADDER (1).pptx
BCD ADDER (1).pptxBCD ADDER (1).pptx
BCD ADDER (1).pptx
 
BCD ADDER (1).pptx
BCD ADDER (1).pptxBCD ADDER (1).pptx
BCD ADDER (1).pptx
 
Number codes students
Number codes studentsNumber codes students
Number codes students
 
BCD,GRAY and EXCESS 3 codes
BCD,GRAY and EXCESS 3 codesBCD,GRAY and EXCESS 3 codes
BCD,GRAY and EXCESS 3 codes
 
Binary codes
Binary codesBinary codes
Binary codes
 
Student IP Addressing Tutorial.ppt
Student IP Addressing Tutorial.pptStudent IP Addressing Tutorial.ppt
Student IP Addressing Tutorial.ppt
 
Lecture 5 binary_codes
Lecture 5 binary_codesLecture 5 binary_codes
Lecture 5 binary_codes
 
DDD for real
DDD for realDDD for real
DDD for real
 
Number codes
Number codesNumber codes
Number codes
 
Mcs 012 soved assignment 2015-16
Mcs 012 soved assignment 2015-16Mcs 012 soved assignment 2015-16
Mcs 012 soved assignment 2015-16
 
Digital electronics- BCD & Decoder
Digital electronics- BCD & DecoderDigital electronics- BCD & Decoder
Digital electronics- BCD & Decoder
 
Csl 202, code converters
Csl 202, code convertersCsl 202, code converters
Csl 202, code converters
 
QR Integration with MuleSoft | MuleSoft Mysore Meetup #8
QR Integration with MuleSoft | MuleSoft Mysore Meetup #8QR Integration with MuleSoft | MuleSoft Mysore Meetup #8
QR Integration with MuleSoft | MuleSoft Mysore Meetup #8
 
DDD beyond the infamous repository pattern - GeeCon Prague 2018
DDD beyond the infamous repository pattern - GeeCon Prague 2018DDD beyond the infamous repository pattern - GeeCon Prague 2018
DDD beyond the infamous repository pattern - GeeCon Prague 2018
 
Unit1_Part2-Machine_Instructions_Programs_7_9_2018_3pm.ppt
Unit1_Part2-Machine_Instructions_Programs_7_9_2018_3pm.pptUnit1_Part2-Machine_Instructions_Programs_7_9_2018_3pm.ppt
Unit1_Part2-Machine_Instructions_Programs_7_9_2018_3pm.ppt
 
Qrcodequickresponsecode presentation
Qrcodequickresponsecode presentationQrcodequickresponsecode presentation
Qrcodequickresponsecode presentation
 
Computer-codes.pptx
Computer-codes.pptxComputer-codes.pptx
Computer-codes.pptx
 
12.Representation of signed binary numbers. Binary codes - BCD code, Gray co...
12.Representation of signed binary numbers.  Binary codes - BCD code, Gray co...12.Representation of signed binary numbers.  Binary codes - BCD code, Gray co...
12.Representation of signed binary numbers. Binary codes - BCD code, Gray co...
 
Sean Farmar - Successfully Decomposing Your Monolith or UpdateUser Means Noth...
Sean Farmar - Successfully Decomposing Your Monolith or UpdateUser Means Noth...Sean Farmar - Successfully Decomposing Your Monolith or UpdateUser Means Noth...
Sean Farmar - Successfully Decomposing Your Monolith or UpdateUser Means Noth...
 

More from International Institute of Information Technology - Bangalore (10)

Digital Design Session 24
Digital Design Session 24Digital Design Session 24
Digital Design Session 24
 
Digital Design Session 23
Digital Design Session 23Digital Design Session 23
Digital Design Session 23
 
Digital Design Session 22
Digital Design Session 22Digital Design Session 22
Digital Design Session 22
 
Digital Design Session 21
Digital Design Session 21Digital Design Session 21
Digital Design Session 21
 
Digital Design Session 20
Digital Design Session 20Digital Design Session 20
Digital Design Session 20
 
Digital Design Session 16
Digital Design Session 16Digital Design Session 16
Digital Design Session 16
 
Digital Design Session 15
Digital Design Session 15Digital Design Session 15
Digital Design Session 15
 
Digital Design Session 13
Digital Design Session 13Digital Design Session 13
Digital Design Session 13
 
Digital Design Session 11
Digital Design Session 11Digital Design Session 11
Digital Design Session 11
 
Basic Electric Circuits Tutorial 7
Basic Electric Circuits Tutorial 7Basic Electric Circuits Tutorial 7
Basic Electric Circuits Tutorial 7
 

Recently uploaded

Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 

Recently uploaded (20)

Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 

Digital Design Binary Codes

  • 1. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com
  • 2. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 2 Session 2: Focus  Binary codes and their classifications  Weighted codes ◦ Binary Coded Decimal (BCD)  Various BCD formats  Unsigned BCD arithmetic  Packed and unpacked BCD  Non-weighted codes ◦ Excess-3 ◦ Gray code ◦ Optical Encoder Example using Gray Code
  • 3. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com Binary Codes
  • 4. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 4 What are Binary Codes and Why are they needed?  Digital systems represent and manipulate not only binary numbers, but also ◦ Many other discrete elements of information. ◦ Example: Digital speech signal, Character symbols (a, b, etc.)  Any discrete element of information that is distinct among a group of quantities can be represented ◦ With binary code, i.e., a pattern of 0’s and 1’s  The digital data is represented, stored and transmitted as group of binary bits  A set of eight elements requires a three‐bit code and a set of 16 elements requires a four‐bit code
  • 5. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 5 Binary Codes  Both letters, numbers, symbols are represented by binary codes ◦ Various fonts used in word processors are examples of binary codes  Binary codes are used in computer applications and digital data communication  Binary codes ease implementation of digital circuits to process encoded digital data
  • 6. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 6 Classification of Binary Codes  Weighted Codes  Non-Weighted Codes  Binary Coded Decimal Code  Alphanumeric Codes  Error Detecting Codes – Not covered in this course  Error Correcting Codes – Not covered in this course
  • 7. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com Weighted Codes Binary Coded Decimal (BCD)
  • 8. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 8 Weighted Codes  Weighted binary codes are those binary codes which obey the positional weight principle.  Each position of the number represents a specific weight.  Several systems of the codes are used to express the decimal digits 0 through 9.  In these codes each decimal digit is represented by a group of four bits Courtesy: Tutorial Point
  • 9. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 9 Binary Coded Decimal (BCD)  Only the first 9 combinations of four bits are valid  The remaining 6 combinations are unused in BCD  Easier to represent decimal digits in BCD which is straightforward  Example: (12.75)10  BCD (8421):  (0001 0010.0111 0101)8421  (0001 0010.1101 1011)2421
  • 10. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 10 Other BCDs
  • 11. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 11 Unsigned BCD (8421) Addition  Invalid (out of range) BCD values are corrected by adding a value of 6 (0110) to it  The reason for adding six is that six binary combinations are unused in BCD (8421) sequence  Note that if just BCD is mentioned, it means 8421 Valid BCD Invalid BCD
  • 12. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 12 N-bit Unsigned BCD Addition  It follows the same procedure with carry propagating from right to left Carry BCD
  • 13. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 14 Packed and Unpacked BCD  When a BCD number is stored in a register inside a processor, when each BCD number occupies one register ◦ It is called Unpacked BCD ◦ Only lower four bits will be having the values, which is not efficient in terms of register usage  In packed BCD, based on the size of register, two or more BCD numbers are stored in a register or memory ◦ In a 8 bit register, two BCD numbers are stored ◦ In a 16 bit register, four BCD number are stored ◦ An 8 bit register having 57BCD reads 0101 0111
  • 14. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com Non-weighted Codes Excess-3 Code
  • 15. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 16 Non-weighted Codes: Excess-3  No positional weights are assigned in non-weighted codes ◦ Examples: Excess-3 code and Gray code Weighted Non-weighted Courtesy: Tutorial Point
  • 16. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 17 Excess-3 Codes  The Excess-3 code is also called as XS-3 code.  It is non-weighted code used to express decimal numbers.  The Excess-3 code words are derived from the 8421 BCD code words by adding 3 (0011) to each code word in 8421.  This is a self complementing code  A self complementing code for Base-10 is a code for which the complement of a given encoded digit d[0-9] will result in 9-d, its 9's complement ◦ It helps in building digital circuits for subtraction
  • 17. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 18 Excess-3 Code: Example  Find Excess-3 code for the decimal value 597:  The addition of ‘3’ to each digit yields three new digits/numbers ‘8’, ‘12’ and ‘10’  The corresponding four-bit binary equivalents are 1000, 1100 and 1010 respectively  The excess-3 code for 597 is therefore given by: 1000 1100 1010  59710 = 1000 1100 1010XS-3
  • 18. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 19 Self complementing Code: Excess-3  Self complementing means that the 9’s complement of the Excess-3 code can be got, by just complementing the bits.  For example:  9’s complement of 95 is 4 (99- 95) ◦ Excess-3 of 95 : 1100 1000 ◦ Complement bits: 0011 0111 ◦ In Excess-3, it is : 04 ◦ Which is 9’s complement of 95
  • 19. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com Non-weighted Codes: Gray Codes
  • 20. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 21 Constructing Gray Codes Value Gray code Gray code Gray code Gray code
  • 21. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 22 Gray Codes
  • 22. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 23 Gray Codes  It is non-weighted code and it is not arithmetic code. ◦ i.e., Gray code cannot be used for arithmetic operations  There are no specific weights assigned to the bit positions in Gray codes  It has a very special feature that, only one bit will change each time the decimal number is incremented  As only one bit changes at a time, the gray code is called as a unit distance code  The gray code is a cyclic code. ◦ Circular shifts of each codeword gives another word that belongs to the code
  • 23. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 24 Use of Gray Codes  It is a non-weighted code which belongs to a class of codes called minimum change codes  Here, two adjacent code numbers differs from each other by only one bit  Gray code is popularly used in the shaft position encoders. ◦ A shaft position encoder produces a code word which represents the angular position of the shaft  It is also used in the transmission of digital signals  The Gray code is used for labelling the axes of Karnaugh maps
  • 24. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 25 Optical Encoder Coded Disc Connected to a Rotating Shaft
  • 25. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 26 Session 2: Summary  Binary codes and their classifications  Weighted codes ◦ Binary Coded Decimal (BCD)  Various BCD formats  Unsigned BCD arithmetic  Packed and unpacked BCD  Non-weighted codes ◦ Excess-3 ◦ Gray code ◦ Optical Encoder Example using Gray Code
  • 26. Digital Design – © 2020 Mouli Sankaran Email: mouli.sankaran@yahoo.com 27 References Ref 1 Ref 2