SlideShare a Scribd company logo
1 of 12
Download to read offline
Subject Name
Digital Electronics and Logic Design

Code
DEL-244

Digital Electronics and Logic Design

Credit Hours
3
Subject Name
Digital Electronics and Logic Design

Code
DEL-244

Credit Hours
3

Binary codes
• Binary codes are codes which are represented
in binary system with modification from the
original ones. Below we will be seeing the
following:
• Weighted Binary Systems
• Non Weighted Codes
2
Subject Name
Digital Electronics and Logic Design

Code
DEL-244

Credit Hours
3

Weighted Binary Systems
• Weighted Binary Systems Weighted binary
codes are those which obey the positional
weighting principles, each position of the
number represents a specific weight. The
binary counting sequence is an example.

3
Subject Name
Digital Electronics and Logic Design

Code
DEL-244

Credit Hours
3

4
Subject Name
Digital Electronics and Logic Design

Code
DEL-244

Credit Hours
3

Gray code

5
Subject Name
Digital Electronics and Logic Design

•

•

•
•

Code
DEL-244

Credit Hours
3

8421 Code/BCD Code The BCD (Binary Coded Decimal) is a straight assignment of
the binary equivalent. It is possible to assign weights to the binary bits according
to their positions. The weights in the BCD code are 8,4,2,1.
Example: The bit assignment 1001, can be seen by its weights to represent the
decimal 9 because:
1x8+0x4+0x2+1x1 = 9
2421 Code This is a weighted code, its weights are 2, 4, 2 and 1. A decimal
number is represented in 4-bit form and the total four bits weight is 2 + 4 + 2 + 1
= 9. Hence the 2421 code represents the decimal numbers from 0 to 9.

6
Subject Name
Digital Electronics and Logic Design

Code
DEL-244

Credit Hours
3

• Reflective Code A code is said to be reflective when code for 9 is
complement for the code for 0, and so is for 8 and 1 codes, 7 and 2, 6 and
3, 5 and 4. Codes 2421, 5211, and excess-3 are reflective, whereas the
8421 code is not.
• Sequential Codes A code is said to be sequential when two subsequent
codes, seen as numbers in binary representation, differ by one. This
greatly aids mathematical manipulation of data. The 8421 and Excess-3
codes are sequential, whereas the 2421 and 5211 codes are not.
• Non Weighted Codes Non weighted codes are codes that are not
positionally weighted. That is, each position within the binary number is
not assigned a fixed value.
• Excess-3 Code Excess-3 is a non weighted code used to express decimal
numbers. The code derives its name from the fact that each binary code is
the corresponding 8421 code plus 0011(3).
• Example: 1000 of 8421 = 1011 in Excess-3
•
7
Subject Name
Digital Electronics and Logic Design

•

Code
DEL-244

Credit Hours
3

Gray Code The gray code belongs to a class of codes called
minimum change codes, in which only one bit in the code
changes when moving from one code to the next. The Gray
code is non-weighted code, as the position of bit does not
contain any weight. The gray code is a reflective digital code
which has the special property that any two subsequent
numbers codes differ by only one bit. This is also called a unitdistance code. In digital Gray code has got a special place.

8
Subject Name
Digital Electronics and Logic Design

Code
DEL-244

Credit Hours
3

Two’s compliment
• How do you represent a minus sign electronically in a
computer?
• How can you represent it such that arithmetic
operations are manageable?
• There are two types of compliments for each number
base system.
– Have the r’s complement
– Have the (r-1)’s complement

• For base 2
complement

have 2’s complement

9/15/09 - L15 Decoders,
Multiplexers

Copyright 2009 - Joanne DeGroat, ECE, OSU

and 1’s

9
Subject Name
Digital Electronics and Logic Design

Code
DEL-244

Credit Hours
3

1’s Complement
• 1’s complement of N is defined as (2n -1)-N.
– If n=4 have (2n -1) being 1 0000 - 1 = 1111

• So for n=4 would subtract any 4-bit binary
number from 1111.
• This is just inverting each bit.
• Example: 1’s compliment of 1011001
is 0100110
9/15/09 - L15 Decoders,
Multiplexers

Copyright 2009 - Joanne DeGroat, ECE, OSU

10
Subject Name
Digital Electronics and Logic Design

Code
DEL-244

Credit Hours
3

2’s complement
• The 2’s complement is defined as 2n-N
• Can be done by subtraction of N from 2n or
adding 1 to the 1’s complement of a number.
• For 6 = 0110
– The 1’s complement is 1001
– The 2’s complement is 1010
9/15/09 - L15 Decoders,
Multiplexers

Copyright 2009 - Joanne DeGroat, ECE, OSU

11
Subject Name
Digital Electronics and Logic Design

Code
DEL-244

Credit Hours
3

Operation with 2’s complement
• Add 4 and -6
• Will use the 2’s complement of -6 or 1010
– 4
– -6
–

0100
1010
1110

• And taking the 2’s complement of 1110 get
0001 + 1 = 0010
9/15/09 - L15 Decoders,
Multiplexers

Copyright 2009 - Joanne DeGroat, ECE, OSU

12

More Related Content

What's hot

Binaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesBinaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesDr. Anita Goel
 
BCD,GRAY and EXCESS 3 codes
BCD,GRAY and EXCESS 3 codesBCD,GRAY and EXCESS 3 codes
BCD,GRAY and EXCESS 3 codesstudent
 
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
 
Digital electronics
Digital electronicsDigital electronics
Digital electronicsnanishajieha
 
Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes VandanaPagar1
 
Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital ElectronicsJanki Shah
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmeticgavhays
 
What is bcd number system
What is bcd number systemWhat is bcd number system
What is bcd number systemMuhammad Shahid
 
Weighted and Non Weighted Codes
Weighted and Non Weighted CodesWeighted and Non Weighted Codes
Weighted and Non Weighted CodesSubhamSatpathy2
 
boolean algebra and logic simplification
boolean algebra and logic simplificationboolean algebra and logic simplification
boolean algebra and logic simplificationUnsa Shakir
 
Fixed point and floating-point numbers
Fixed point and  floating-point numbersFixed point and  floating-point numbers
Fixed point and floating-point numbersMOHAN MOHAN
 

What's hot (20)

Signed Binary Numbers
Signed Binary NumbersSigned Binary Numbers
Signed Binary Numbers
 
Binaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesBinaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemes
 
BCD,GRAY and EXCESS 3 codes
BCD,GRAY and EXCESS 3 codesBCD,GRAY and EXCESS 3 codes
BCD,GRAY and EXCESS 3 codes
 
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...
 
Binary codes
Binary codesBinary codes
Binary codes
 
Digital electronics
Digital electronicsDigital electronics
Digital electronics
 
Codes
CodesCodes
Codes
 
Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes
 
Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital Electronics
 
1s and 2s complement
1s and 2s complement1s and 2s complement
1s and 2s complement
 
Encoder and decoder
Encoder and decoderEncoder and decoder
Encoder and decoder
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
 
4 bit Binary to Gray converter using XOR
4 bit Binary to Gray converter using XOR4 bit Binary to Gray converter using XOR
4 bit Binary to Gray converter using XOR
 
What is bcd number system
What is bcd number systemWhat is bcd number system
What is bcd number system
 
Digital logic design part1
Digital logic design part1Digital logic design part1
Digital logic design part1
 
Bcd
BcdBcd
Bcd
 
Weighted and Non Weighted Codes
Weighted and Non Weighted CodesWeighted and Non Weighted Codes
Weighted and Non Weighted Codes
 
boolean algebra and logic simplification
boolean algebra and logic simplificationboolean algebra and logic simplification
boolean algebra and logic simplification
 
Binary arithmetic
Binary arithmeticBinary arithmetic
Binary arithmetic
 
Fixed point and floating-point numbers
Fixed point and  floating-point numbersFixed point and  floating-point numbers
Fixed point and floating-point numbers
 

Viewers also liked

Viewers also liked (20)

DEL-244Chep i
DEL-244Chep iDEL-244Chep i
DEL-244Chep i
 
Chap iii-Logic Gates
Chap iii-Logic GatesChap iii-Logic Gates
Chap iii-Logic Gates
 
Binary to grey code conversion
Binary to grey code conversionBinary to grey code conversion
Binary to grey code conversion
 
Bcd to excess 3 code converter
Bcd to excess 3 code converterBcd to excess 3 code converter
Bcd to excess 3 code converter
 
karnaugh maps
karnaugh mapskarnaugh maps
karnaugh maps
 
Flip flop& RAM ROM
Flip flop& RAM ROMFlip flop& RAM ROM
Flip flop& RAM ROM
 
The BCD to excess-3 converter
The BCD to excess-3 converterThe BCD to excess-3 converter
The BCD to excess-3 converter
 
Design of Binary to BCD Code Converter using Area Optimized Quantum Dot Cellu...
Design of Binary to BCD Code Converter using Area Optimized Quantum Dot Cellu...Design of Binary to BCD Code Converter using Area Optimized Quantum Dot Cellu...
Design of Binary to BCD Code Converter using Area Optimized Quantum Dot Cellu...
 
Dlc{binary to gray code conversion} ppt
Dlc{binary to gray code conversion} pptDlc{binary to gray code conversion} ppt
Dlc{binary to gray code conversion} ppt
 
EVALUACIÓN
EVALUACIÓNEVALUACIÓN
EVALUACIÓN
 
Cookies and Session
Cookies and SessionCookies and Session
Cookies and Session
 
Hackers
HackersHackers
Hackers
 
Binary to gray converter using xor
Binary to gray converter using xor Binary to gray converter using xor
Binary to gray converter using xor
 
Logic Equation Simplification
Logic Equation SimplificationLogic Equation Simplification
Logic Equation Simplification
 
Hacking
Hacking Hacking
Hacking
 
Hacking
HackingHacking
Hacking
 
Hacker&cracker
Hacker&crackerHacker&cracker
Hacker&cracker
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
 
Virus (Trojan Horse and Salami Attack)
Virus (Trojan Horse and Salami Attack)Virus (Trojan Horse and Salami Attack)
Virus (Trojan Horse and Salami Attack)
 
STLD-Combinational logic design
STLD-Combinational  logic design STLD-Combinational  logic design
STLD-Combinational logic design
 

Similar to Chap ii.BCD code,Gray code

Dee 2034 chapter 1 number and code system (Baia)
Dee 2034 chapter 1 number and code system (Baia)Dee 2034 chapter 1 number and code system (Baia)
Dee 2034 chapter 1 number and code system (Baia)SITI SABARIAH SALIHIN
 
Chapter 1 number and code system sss
Chapter 1 number and code system sssChapter 1 number and code system sss
Chapter 1 number and code system sssBaia Salihin
 
1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptx1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptxLibanMohamed26
 
computer architecture organization in Ece
computer architecture organization in Ececomputer architecture organization in Ece
computer architecture organization in EceBayesayohannis
 
Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2ISMT College
 
Student IP Addressing Tutorial.ppt
Student IP Addressing Tutorial.pptStudent IP Addressing Tutorial.ppt
Student IP Addressing Tutorial.pptjohnBronson6
 
MODULE_2_Ch4_01082014.pptx .
MODULE_2_Ch4_01082014.pptx                   .MODULE_2_Ch4_01082014.pptx                   .
MODULE_2_Ch4_01082014.pptx .happycocoman
 
digital logic circuits, digital component floting and fixed point
 digital logic circuits, digital component floting and fixed point digital logic circuits, digital component floting and fixed point
digital logic circuits, digital component floting and fixed pointRai University
 
3F4ecc.ppt
3F4ecc.ppt3F4ecc.ppt
3F4ecc.pptAnnymus
 
Switching theory Unit 1
Switching theory Unit 1Switching theory Unit 1
Switching theory Unit 1SURBHI SAROHA
 

Similar to Chap ii.BCD code,Gray code (20)

Binary and EC codes
Binary and EC codesBinary and EC codes
Binary and EC codes
 
DSD.pptx
DSD.pptxDSD.pptx
DSD.pptx
 
Computer-codes.pptx
Computer-codes.pptxComputer-codes.pptx
Computer-codes.pptx
 
Dee 2034 chapter 1 number and code system (Baia)
Dee 2034 chapter 1 number and code system (Baia)Dee 2034 chapter 1 number and code system (Baia)
Dee 2034 chapter 1 number and code system (Baia)
 
Chapter 1 number and code system sss
Chapter 1 number and code system sssChapter 1 number and code system sss
Chapter 1 number and code system sss
 
DLD-W3-L1.pptx
DLD-W3-L1.pptxDLD-W3-L1.pptx
DLD-W3-L1.pptx
 
Code conversion r006
Code conversion r006Code conversion r006
Code conversion r006
 
unit-3.pptx
unit-3.pptxunit-3.pptx
unit-3.pptx
 
1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptx1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptx
 
computer architecture organization in Ece
computer architecture organization in Ececomputer architecture organization in Ece
computer architecture organization in Ece
 
Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2
 
Student IP Addressing Tutorial.ppt
Student IP Addressing Tutorial.pptStudent IP Addressing Tutorial.ppt
Student IP Addressing Tutorial.ppt
 
MODULE_2_Ch4_01082014.pptx .
MODULE_2_Ch4_01082014.pptx                   .MODULE_2_Ch4_01082014.pptx                   .
MODULE_2_Ch4_01082014.pptx .
 
Codes r005
Codes  r005Codes  r005
Codes r005
 
Digital electronics
Digital electronicsDigital electronics
Digital electronics
 
DLD_Lecture_notes2.ppt
DLD_Lecture_notes2.pptDLD_Lecture_notes2.ppt
DLD_Lecture_notes2.ppt
 
digital logic circuits, digital component floting and fixed point
 digital logic circuits, digital component floting and fixed point digital logic circuits, digital component floting and fixed point
digital logic circuits, digital component floting and fixed point
 
3F4ecc.ppt
3F4ecc.ppt3F4ecc.ppt
3F4ecc.ppt
 
Switching theory Unit 1
Switching theory Unit 1Switching theory Unit 1
Switching theory Unit 1
 
lecture_19.pptx
lecture_19.pptxlecture_19.pptx
lecture_19.pptx
 

More from Bala Ganesh

More from Bala Ganesh (20)

DDL,DML,1stNF
DDL,DML,1stNFDDL,DML,1stNF
DDL,DML,1stNF
 
sfdfds
sfdfdssfdfds
sfdfds
 
Dbms chapter viii
Dbms chapter viiiDbms chapter viii
Dbms chapter viii
 
Dbms chapter vii
Dbms chapter viiDbms chapter vii
Dbms chapter vii
 
Dbms chapter v
Dbms chapter vDbms chapter v
Dbms chapter v
 
Dbms chapter iv
Dbms chapter ivDbms chapter iv
Dbms chapter iv
 
Dbms chapter iii
Dbms chapter iiiDbms chapter iii
Dbms chapter iii
 
Dmbs chapter vi
Dmbs chapter viDmbs chapter vi
Dmbs chapter vi
 
Dbms chapter ii
Dbms chapter iiDbms chapter ii
Dbms chapter ii
 
Dbms chap i
Dbms chap iDbms chap i
Dbms chap i
 
Software engineering Questions and Answers
Software engineering Questions and AnswersSoftware engineering Questions and Answers
Software engineering Questions and Answers
 
Software testing
Software testingSoftware testing
Software testing
 
Design
DesignDesign
Design
 
Comp 107 cep 8
Comp 107 cep 8Comp 107 cep 8
Comp 107 cep 8
 
Comp 107 cep 7
Comp 107 cep 7Comp 107 cep 7
Comp 107 cep 7
 
Cocomo model
Cocomo modelCocomo model
Cocomo model
 
Software Requirements
Software RequirementsSoftware Requirements
Software Requirements
 
Comp107 chep6
Comp107 chep6Comp107 chep6
Comp107 chep6
 
Comp 111chp iv vi
Comp 111chp iv viComp 111chp iv vi
Comp 111chp iv vi
 
Comp 111 cep ii
Comp 111 cep iiComp 111 cep ii
Comp 111 cep ii
 

Recently uploaded

Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Celine George
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFEPART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFEMISSRITIMABIOLOGYEXP
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Objectives n learning outcoms - MD 20240404.pptx
Objectives n learning outcoms - MD 20240404.pptxObjectives n learning outcoms - MD 20240404.pptx
Objectives n learning outcoms - MD 20240404.pptxMadhavi Dharankar
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6Vanessa Camilleri
 
DiskStorage_BasicFileStructuresandHashing.pdf
DiskStorage_BasicFileStructuresandHashing.pdfDiskStorage_BasicFileStructuresandHashing.pdf
DiskStorage_BasicFileStructuresandHashing.pdfChristalin Nelson
 
How to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command LineHow to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command LineCeline George
 
Shark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristicsShark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristicsArubSultan
 
Satirical Depths - A Study of Gabriel Okara's Poem - 'You Laughed and Laughed...
Satirical Depths - A Study of Gabriel Okara's Poem - 'You Laughed and Laughed...Satirical Depths - A Study of Gabriel Okara's Poem - 'You Laughed and Laughed...
Satirical Depths - A Study of Gabriel Okara's Poem - 'You Laughed and Laughed...HetalPathak10
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
DBMSArchitecture_QueryProcessingandOptimization.pdf
DBMSArchitecture_QueryProcessingandOptimization.pdfDBMSArchitecture_QueryProcessingandOptimization.pdf
DBMSArchitecture_QueryProcessingandOptimization.pdfChristalin Nelson
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 

Recently uploaded (20)

Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFEPART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
PART 1 - CHAPTER 1 - CELL THE FUNDAMENTAL UNIT OF LIFE
 
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
CARNAVAL COM MAGIA E EUFORIA _
CARNAVAL COM MAGIA E EUFORIA            _CARNAVAL COM MAGIA E EUFORIA            _
CARNAVAL COM MAGIA E EUFORIA _
 
Objectives n learning outcoms - MD 20240404.pptx
Objectives n learning outcoms - MD 20240404.pptxObjectives n learning outcoms - MD 20240404.pptx
Objectives n learning outcoms - MD 20240404.pptx
 
Chi-Square Test Non Parametric Test Categorical Variable
Chi-Square Test Non Parametric Test Categorical VariableChi-Square Test Non Parametric Test Categorical Variable
Chi-Square Test Non Parametric Test Categorical Variable
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6
 
DiskStorage_BasicFileStructuresandHashing.pdf
DiskStorage_BasicFileStructuresandHashing.pdfDiskStorage_BasicFileStructuresandHashing.pdf
DiskStorage_BasicFileStructuresandHashing.pdf
 
How to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command LineHow to Uninstall a Module in Odoo 17 Using Command Line
How to Uninstall a Module in Odoo 17 Using Command Line
 
Shark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristicsShark introduction Morphology and its behaviour characteristics
Shark introduction Morphology and its behaviour characteristics
 
Satirical Depths - A Study of Gabriel Okara's Poem - 'You Laughed and Laughed...
Satirical Depths - A Study of Gabriel Okara's Poem - 'You Laughed and Laughed...Satirical Depths - A Study of Gabriel Okara's Poem - 'You Laughed and Laughed...
Satirical Depths - A Study of Gabriel Okara's Poem - 'You Laughed and Laughed...
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
DBMSArchitecture_QueryProcessingandOptimization.pdf
DBMSArchitecture_QueryProcessingandOptimization.pdfDBMSArchitecture_QueryProcessingandOptimization.pdf
DBMSArchitecture_QueryProcessingandOptimization.pdf
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 

Chap ii.BCD code,Gray code

  • 1. Subject Name Digital Electronics and Logic Design Code DEL-244 Digital Electronics and Logic Design Credit Hours 3
  • 2. Subject Name Digital Electronics and Logic Design Code DEL-244 Credit Hours 3 Binary codes • Binary codes are codes which are represented in binary system with modification from the original ones. Below we will be seeing the following: • Weighted Binary Systems • Non Weighted Codes 2
  • 3. Subject Name Digital Electronics and Logic Design Code DEL-244 Credit Hours 3 Weighted Binary Systems • Weighted Binary Systems Weighted binary codes are those which obey the positional weighting principles, each position of the number represents a specific weight. The binary counting sequence is an example. 3
  • 4. Subject Name Digital Electronics and Logic Design Code DEL-244 Credit Hours 3 4
  • 5. Subject Name Digital Electronics and Logic Design Code DEL-244 Credit Hours 3 Gray code 5
  • 6. Subject Name Digital Electronics and Logic Design • • • • Code DEL-244 Credit Hours 3 8421 Code/BCD Code The BCD (Binary Coded Decimal) is a straight assignment of the binary equivalent. It is possible to assign weights to the binary bits according to their positions. The weights in the BCD code are 8,4,2,1. Example: The bit assignment 1001, can be seen by its weights to represent the decimal 9 because: 1x8+0x4+0x2+1x1 = 9 2421 Code This is a weighted code, its weights are 2, 4, 2 and 1. A decimal number is represented in 4-bit form and the total four bits weight is 2 + 4 + 2 + 1 = 9. Hence the 2421 code represents the decimal numbers from 0 to 9. 6
  • 7. Subject Name Digital Electronics and Logic Design Code DEL-244 Credit Hours 3 • Reflective Code A code is said to be reflective when code for 9 is complement for the code for 0, and so is for 8 and 1 codes, 7 and 2, 6 and 3, 5 and 4. Codes 2421, 5211, and excess-3 are reflective, whereas the 8421 code is not. • Sequential Codes A code is said to be sequential when two subsequent codes, seen as numbers in binary representation, differ by one. This greatly aids mathematical manipulation of data. The 8421 and Excess-3 codes are sequential, whereas the 2421 and 5211 codes are not. • Non Weighted Codes Non weighted codes are codes that are not positionally weighted. That is, each position within the binary number is not assigned a fixed value. • Excess-3 Code Excess-3 is a non weighted code used to express decimal numbers. The code derives its name from the fact that each binary code is the corresponding 8421 code plus 0011(3). • Example: 1000 of 8421 = 1011 in Excess-3 • 7
  • 8. Subject Name Digital Electronics and Logic Design • Code DEL-244 Credit Hours 3 Gray Code The gray code belongs to a class of codes called minimum change codes, in which only one bit in the code changes when moving from one code to the next. The Gray code is non-weighted code, as the position of bit does not contain any weight. The gray code is a reflective digital code which has the special property that any two subsequent numbers codes differ by only one bit. This is also called a unitdistance code. In digital Gray code has got a special place. 8
  • 9. Subject Name Digital Electronics and Logic Design Code DEL-244 Credit Hours 3 Two’s compliment • How do you represent a minus sign electronically in a computer? • How can you represent it such that arithmetic operations are manageable? • There are two types of compliments for each number base system. – Have the r’s complement – Have the (r-1)’s complement • For base 2 complement have 2’s complement 9/15/09 - L15 Decoders, Multiplexers Copyright 2009 - Joanne DeGroat, ECE, OSU and 1’s 9
  • 10. Subject Name Digital Electronics and Logic Design Code DEL-244 Credit Hours 3 1’s Complement • 1’s complement of N is defined as (2n -1)-N. – If n=4 have (2n -1) being 1 0000 - 1 = 1111 • So for n=4 would subtract any 4-bit binary number from 1111. • This is just inverting each bit. • Example: 1’s compliment of 1011001 is 0100110 9/15/09 - L15 Decoders, Multiplexers Copyright 2009 - Joanne DeGroat, ECE, OSU 10
  • 11. Subject Name Digital Electronics and Logic Design Code DEL-244 Credit Hours 3 2’s complement • The 2’s complement is defined as 2n-N • Can be done by subtraction of N from 2n or adding 1 to the 1’s complement of a number. • For 6 = 0110 – The 1’s complement is 1001 – The 2’s complement is 1010 9/15/09 - L15 Decoders, Multiplexers Copyright 2009 - Joanne DeGroat, ECE, OSU 11
  • 12. Subject Name Digital Electronics and Logic Design Code DEL-244 Credit Hours 3 Operation with 2’s complement • Add 4 and -6 • Will use the 2’s complement of -6 or 1010 – 4 – -6 – 0100 1010 1110 • And taking the 2’s complement of 1110 get 0001 + 1 = 0010 9/15/09 - L15 Decoders, Multiplexers Copyright 2009 - Joanne DeGroat, ECE, OSU 12