SlideShare a Scribd company logo
1 of 12
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

What's hot (20)

Signed Binary Numbers
Signed Binary NumbersSigned Binary Numbers
Signed Binary Numbers
 
Number system conversion
Number system conversionNumber system conversion
Number system conversion
 
Binary true ppt
Binary true pptBinary true ppt
Binary true ppt
 
Binary codes
Binary codesBinary codes
Binary codes
 
Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes
 
Code conversions.pptx415.pptx
Code conversions.pptx415.pptxCode conversions.pptx415.pptx
Code conversions.pptx415.pptx
 
Bcd to excess 3 code converter
Bcd to excess 3 code converterBcd to excess 3 code converter
Bcd to excess 3 code converter
 
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
 
Number system and codes
Number system and codesNumber system and codes
Number system and codes
 
Digital Electronics Notes
Digital Electronics Notes Digital Electronics Notes
Digital Electronics Notes
 
Complement in DLD
Complement in DLDComplement in DLD
Complement in DLD
 
binary number system
 binary number system binary number system
binary number system
 
Encoder
EncoderEncoder
Encoder
 
Binary to grey code conversion
Binary to grey code conversionBinary to grey code conversion
Binary to grey code conversion
 
Weighted and Non Weighted Codes
Weighted and Non Weighted CodesWeighted and Non Weighted Codes
Weighted and Non Weighted Codes
 
Digital logic design part1
Digital logic design part1Digital logic design part1
Digital logic design part1
 
Digital Logic circuit
Digital Logic circuitDigital Logic circuit
Digital Logic circuit
 
Binary codes
Binary codesBinary codes
Binary codes
 
Encoders and decoders
Encoders and decodersEncoders and decoders
Encoders and decoders
 
Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital Electronics
 

Viewers also liked

Chap iii-Logic Gates
Chap iii-Logic GatesChap iii-Logic Gates
Chap iii-Logic Gates
Bala Ganesh
 
Flip flop& RAM ROM
Flip flop& RAM ROMFlip flop& RAM ROM
Flip flop& RAM ROM
Bala Ganesh
 

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
 
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...
 
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
 
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
 
Ipv4 and Ipv6
Ipv4 and Ipv6Ipv4 and Ipv6
Ipv4 and Ipv6
 
Encoder and decoder
Encoder and decoderEncoder and decoder
Encoder and decoder
 

Similar to Chap ii.BCD code,Gray code

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
 

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
 
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...
 
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
 

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

Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 

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