SlideShare a Scribd company logo
1 of 21
Prepared By
Asst. Lect. Mohammed Salim
Department of IT
1 LFU 2014
Contents
LFU 20142
Binary Addition, Subtraction, Multiplication,
Division
1's Complement of Binary Number.
2's Complement of Binary Number.
Signed Numbers & Binary Coded Decimal (BCD)
Gray Code
Excess-3 Code
Notes
LFU 20143
What is Binary Arithmetic?
LFU 20144
 Binary arithmetic is essential part of all the digital
computers and many other digital system such as
mobile phones .
 Binary numbers are NUMBERS: That means you
can add, subtract, multiply, and divide.
 2 + 2 = 4 , and
in Binary: 10 + 10 = 100
Binary Addition Rules
Rules:
 0 + 0 = 0
 0 + 1 = 1
 1 + 0 = 1
 1 + 1 = 10= 0 with 1 to carry
 1 + 1 + 1 =11 = 1 with 1 to carry
11_
11 0011
+ 1011
11 1110
carried bits
Addition Example & Practice
LFU 20146
 Ex: 1110 + 1010 = 11000
 Ex: 1001 + 111= 10000
 Ex: 1111 0000 + 1111 = 1111 1111
 Now take a few minutes to try these two:
 111 1000 + 1111
 1000 1100 + 1100 0110
Subtraction
LFU 20147
 The rules for binary subtraction are:
Binary
1002
- 0012
-------
0112
0-1 = 1; with borrow of 1
from next column
0 -1 (borrow) - 0 = 1, with
borrow of 1
1 - 1 (borrow) - 0 = 0.
Answer = 0112.
Subtraction Example & Practice
LFU 20148
Now take a few minutes to try these two:
100001 – 11111= ?
11100 - 1111 = ?
Multiplication
LFU 20149
Division
LFU 201410
Ex: 11010/101 = 101
LFU 201411
1's Complement of Binary Number
 As the binary system has base radix = 2. So the two types of
complements for the binary system are 2's complement and 1's
complement.
 Complements are used in the digital computers in order to simplify
the subtraction operation and for the logical manipulations, and also
to represent negative numbers.
 The 1's complement of a number is found by changing all 1's to 0's
and all 0's to 1's. This is called as taking complement or 1's
complement. Example of 1's Complement is:
Note: All complements should deal with a specific byte or bit size. For example the number above
is 5bits long.
LFU 201412
1's Complement Problems
2's Complement of Binary Number
LFU 201413
 The 2's complement of binary number is obtained by adding 1 to the
Least Significant Bit (LSB) of 1's complement of the number.
 2's complement = 1's complement + 1
 Example of 2's Complement is as follows.
The problems of multiple representations of 0 and the need for the end-around
carry are solved by a system called two's complement. In two's complement,
negative numbers are represented by the bit pattern which is one greater (in an
unsigned sense) than the ones' complement of the positive value. In two's-
complement, there is only one zero, represented as 00000000.
2's Complement & Signed Numbers
LFU 201414
Signed Binary Numbers
LFU 201415
Binary Number
Representation
Binary Coded Decimal (BCD)
LFU 201416
Binary Coded Decimal (BCD):
In computing and electronic systems, binary-coded decimal (BCD) is
a class of binary encodings of decimal numbers where each decimal
digit is represented by a fixed number of bits, usually four or eight,
Gray Code
LFU 201417
 The reflected binary code, which invented by Frank
Gray, is a binary numeral system where two
successive values differ in only one bit.
 The Gray code was originally designed
to prevent false output from
electromechanical switches. Today, Gray
codes are widely used to facilitate error
correction in digital communications such
as digital terrestrial television and some
cable TV systems.
Binary to Gray code conversion
LFU 201418
It is easy to convert binary code to gray, by following these steps:
 (1) The M.S.B. of the gray code will be exactly equal to the first bit of
the given binary number.
 (2) Now the second bit of the code will be exclusive-or of the first
and second bit of the given binary number, i.e if both the bits are
same the result will be 0 and if they are different the result will be 1.
 (3)The third bit of gray code will be equal to the exclusive-or of the
second and third bit of the given binary number. Thus
the Binary to gray code conversion goes on. One example given
below can make your idea clear on this type of conversion.
 Let (01001) be the given binary number
 Thus the equivalent gray code is 01101.
Gray to Binary code conversion
LFU 201419
It is also very easy process. Just follow these steps:
 (1) The M.S.B of the binary number will be equal to the M.S.B of the
given gray code.
 (2) Now if the second gray bit is 0 the second binary bit will be same
as the previous or the first bit. If the gray bit is 1 the second binary bit
will alter. If it was 1 it will be 0 and if it was 0 it will be 1.
 (3) This step is continued for all the bits to do Gray code to binary
conversion.
 One example given below will make your idea clear.
 Let the gray code be 01101
 The binary code = (01001)
More Examples on Gray Code Conversion
LFU 201420
Excess 3 Code
LFU 201421
 It is a complementary BCD code and numeral system. It is
basically a binary code which is made by adding 3 to the
equivalent decimal of a binary number and again converting it
into binary number.
Examples:
 Excess-3 of 12 is 0001 0010 + 0011 0011 = 0100 0101 (45) .
 Excess-3 of 6 is 0110(6) + 0011(3)= 1001(9) .

More Related Content

What's hot

1sand2scomplement r004
1sand2scomplement  r0041sand2scomplement  r004
1sand2scomplement r004arunachalamr16
 
EC Binary Substraction using 1's Complement,2's Complement
EC Binary Substraction using 1's Complement,2's ComplementEC Binary Substraction using 1's Complement,2's Complement
EC Binary Substraction using 1's Complement,2's ComplementAmberSinghal1
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmeticgavhays
 
1's and 2's complement
1's and 2's complement 1's and 2's complement
1's and 2's complement Shiraz Azeem
 
Binary coded decimal r004
Binary coded decimal   r004Binary coded decimal   r004
Binary coded decimal r004arunachalamr16
 
Number system arithmetic
Number system arithmetic Number system arithmetic
Number system arithmetic renatus katundu
 
Number systems - binary, BCD, 2s comp
Number systems - binary, BCD, 2s compNumber systems - binary, BCD, 2s comp
Number systems - binary, BCD, 2s compmrlee2014
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representationgavhays
 
Decimal to binary number
Decimal to binary numberDecimal to binary number
Decimal to binary numberguestd8696a
 
Complements of numbers
Complements of numbersComplements of numbers
Complements of numbersKiriti Varkur
 
Binary Codes and Number System
Binary Codes and Number SystemBinary Codes and Number System
Binary Codes and Number SystemDebarati Das
 
Data types
Data typesData types
Data typesgavhays
 

What's hot (20)

1sand2scomplement r004
1sand2scomplement  r0041sand2scomplement  r004
1sand2scomplement r004
 
2's complement
2's complement2's complement
2's complement
 
Complements
ComplementsComplements
Complements
 
Complement
ComplementComplement
Complement
 
EC Binary Substraction using 1's Complement,2's Complement
EC Binary Substraction using 1's Complement,2's ComplementEC Binary Substraction using 1's Complement,2's Complement
EC Binary Substraction using 1's Complement,2's Complement
 
Binary true ppt
Binary true pptBinary true ppt
Binary true ppt
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
 
1's and 2's complement
1's and 2's complement 1's and 2's complement
1's and 2's complement
 
Chapter 7 rohith
Chapter 7 rohithChapter 7 rohith
Chapter 7 rohith
 
Binary coded decimal r004
Binary coded decimal   r004Binary coded decimal   r004
Binary coded decimal r004
 
Representation of Negative Numbers
Representation of Negative NumbersRepresentation of Negative Numbers
Representation of Negative Numbers
 
Number system arithmetic
Number system arithmetic Number system arithmetic
Number system arithmetic
 
Number systems - binary, BCD, 2s comp
Number systems - binary, BCD, 2s compNumber systems - binary, BCD, 2s comp
Number systems - binary, BCD, 2s comp
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representation
 
Decimal to binary number
Decimal to binary numberDecimal to binary number
Decimal to binary number
 
Complements of numbers
Complements of numbersComplements of numbers
Complements of numbers
 
Binary Codes and Number System
Binary Codes and Number SystemBinary Codes and Number System
Binary Codes and Number System
 
Data types
Data typesData types
Data types
 
Binary operations
 Binary operations Binary operations
Binary operations
 

Similar to Digital logic mohammed salim ch2

W3 Chapter 2B Notes CCB1223 Digital Logic.pdf
W3 Chapter 2B Notes CCB1223 Digital Logic.pdfW3 Chapter 2B Notes CCB1223 Digital Logic.pdf
W3 Chapter 2B Notes CCB1223 Digital Logic.pdfMOHDZAMRIBINIBRAHIM1
 
5_2019_01_03!03_33_00_PM.pptx
5_2019_01_03!03_33_00_PM.pptx5_2019_01_03!03_33_00_PM.pptx
5_2019_01_03!03_33_00_PM.pptxAbijahRoseline1
 
Unit-1 (DLD) Lecture 2.pptx
Unit-1 (DLD) Lecture 2.pptxUnit-1 (DLD) Lecture 2.pptx
Unit-1 (DLD) Lecture 2.pptxBunnyYadav7
 
review of number systems and codes
review of number systems and codesreview of number systems and codes
review of number systems and codessrinu247
 
Two's complement represenation
Two's complement represenationTwo's complement represenation
Two's complement represenationKUNDANKUMAR932294
 
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
 
Unit 1 data representation and computer arithmetic
Unit 1  data representation and computer arithmeticUnit 1  data representation and computer arithmetic
Unit 1 data representation and computer arithmeticAmrutaMehata
 
Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital ElectronicsJanki Shah
 
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdfCDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdfshubhangisonawane6
 
Digital Principles-Number systems
Digital Principles-Number systemsDigital Principles-Number systems
Digital Principles-Number systemschandkec
 

Similar to Digital logic mohammed salim ch2 (20)

Number codes students
Number codes studentsNumber codes students
Number codes students
 
W3 Chapter 2B Notes CCB1223 Digital Logic.pdf
W3 Chapter 2B Notes CCB1223 Digital Logic.pdfW3 Chapter 2B Notes CCB1223 Digital Logic.pdf
W3 Chapter 2B Notes CCB1223 Digital Logic.pdf
 
Number codes
Number codesNumber codes
Number codes
 
5_2019_01_03!03_33_00_PM.pptx
5_2019_01_03!03_33_00_PM.pptx5_2019_01_03!03_33_00_PM.pptx
5_2019_01_03!03_33_00_PM.pptx
 
Digital electronics
Digital electronicsDigital electronics
Digital electronics
 
Unit-1 (DLD) Lecture 2.pptx
Unit-1 (DLD) Lecture 2.pptxUnit-1 (DLD) Lecture 2.pptx
Unit-1 (DLD) Lecture 2.pptx
 
Code conversion r006
Code conversion r006Code conversion r006
Code conversion r006
 
review of number systems and codes
review of number systems and codesreview of number systems and codes
review of number systems and codes
 
Two's complement represenation
Two's complement represenationTwo's complement represenation
Two's complement represenation
 
ch2.pdf
ch2.pdfch2.pdf
ch2.pdf
 
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
 
Unit 1 data representation and computer arithmetic
Unit 1  data representation and computer arithmeticUnit 1  data representation and computer arithmetic
Unit 1 data representation and computer arithmetic
 
Codes r005
Codes  r005Codes  r005
Codes r005
 
Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital Electronics
 
uyuyuy.pdf
uyuyuy.pdfuyuyuy.pdf
uyuyuy.pdf
 
Bcd
BcdBcd
Bcd
 
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdfCDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
 
Data Representation
Data RepresentationData Representation
Data Representation
 
Data representation in computers
Data representation in computersData representation in computers
Data representation in computers
 
Digital Principles-Number systems
Digital Principles-Number systemsDigital Principles-Number systems
Digital Principles-Number systems
 

Recently uploaded

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 

Recently uploaded (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Digital logic mohammed salim ch2

  • 1. Prepared By Asst. Lect. Mohammed Salim Department of IT 1 LFU 2014
  • 2. Contents LFU 20142 Binary Addition, Subtraction, Multiplication, Division 1's Complement of Binary Number. 2's Complement of Binary Number. Signed Numbers & Binary Coded Decimal (BCD) Gray Code Excess-3 Code
  • 4. What is Binary Arithmetic? LFU 20144  Binary arithmetic is essential part of all the digital computers and many other digital system such as mobile phones .  Binary numbers are NUMBERS: That means you can add, subtract, multiply, and divide.  2 + 2 = 4 , and in Binary: 10 + 10 = 100
  • 5. Binary Addition Rules Rules:  0 + 0 = 0  0 + 1 = 1  1 + 0 = 1  1 + 1 = 10= 0 with 1 to carry  1 + 1 + 1 =11 = 1 with 1 to carry 11_ 11 0011 + 1011 11 1110 carried bits
  • 6. Addition Example & Practice LFU 20146  Ex: 1110 + 1010 = 11000  Ex: 1001 + 111= 10000  Ex: 1111 0000 + 1111 = 1111 1111  Now take a few minutes to try these two:  111 1000 + 1111  1000 1100 + 1100 0110
  • 7. Subtraction LFU 20147  The rules for binary subtraction are: Binary 1002 - 0012 ------- 0112 0-1 = 1; with borrow of 1 from next column 0 -1 (borrow) - 0 = 1, with borrow of 1 1 - 1 (borrow) - 0 = 0. Answer = 0112.
  • 8. Subtraction Example & Practice LFU 20148 Now take a few minutes to try these two: 100001 – 11111= ? 11100 - 1111 = ?
  • 11. LFU 201411 1's Complement of Binary Number  As the binary system has base radix = 2. So the two types of complements for the binary system are 2's complement and 1's complement.  Complements are used in the digital computers in order to simplify the subtraction operation and for the logical manipulations, and also to represent negative numbers.  The 1's complement of a number is found by changing all 1's to 0's and all 0's to 1's. This is called as taking complement or 1's complement. Example of 1's Complement is: Note: All complements should deal with a specific byte or bit size. For example the number above is 5bits long.
  • 13. 2's Complement of Binary Number LFU 201413  The 2's complement of binary number is obtained by adding 1 to the Least Significant Bit (LSB) of 1's complement of the number.  2's complement = 1's complement + 1  Example of 2's Complement is as follows. The problems of multiple representations of 0 and the need for the end-around carry are solved by a system called two's complement. In two's complement, negative numbers are represented by the bit pattern which is one greater (in an unsigned sense) than the ones' complement of the positive value. In two's- complement, there is only one zero, represented as 00000000.
  • 14. 2's Complement & Signed Numbers LFU 201414
  • 15. Signed Binary Numbers LFU 201415 Binary Number Representation
  • 16. Binary Coded Decimal (BCD) LFU 201416 Binary Coded Decimal (BCD): In computing and electronic systems, binary-coded decimal (BCD) is a class of binary encodings of decimal numbers where each decimal digit is represented by a fixed number of bits, usually four or eight,
  • 17. Gray Code LFU 201417  The reflected binary code, which invented by Frank Gray, is a binary numeral system where two successive values differ in only one bit.  The Gray code was originally designed to prevent false output from electromechanical switches. Today, Gray codes are widely used to facilitate error correction in digital communications such as digital terrestrial television and some cable TV systems.
  • 18. Binary to Gray code conversion LFU 201418 It is easy to convert binary code to gray, by following these steps:  (1) The M.S.B. of the gray code will be exactly equal to the first bit of the given binary number.  (2) Now the second bit of the code will be exclusive-or of the first and second bit of the given binary number, i.e if both the bits are same the result will be 0 and if they are different the result will be 1.  (3)The third bit of gray code will be equal to the exclusive-or of the second and third bit of the given binary number. Thus the Binary to gray code conversion goes on. One example given below can make your idea clear on this type of conversion.  Let (01001) be the given binary number  Thus the equivalent gray code is 01101.
  • 19. Gray to Binary code conversion LFU 201419 It is also very easy process. Just follow these steps:  (1) The M.S.B of the binary number will be equal to the M.S.B of the given gray code.  (2) Now if the second gray bit is 0 the second binary bit will be same as the previous or the first bit. If the gray bit is 1 the second binary bit will alter. If it was 1 it will be 0 and if it was 0 it will be 1.  (3) This step is continued for all the bits to do Gray code to binary conversion.  One example given below will make your idea clear.  Let the gray code be 01101  The binary code = (01001)
  • 20. More Examples on Gray Code Conversion LFU 201420
  • 21. Excess 3 Code LFU 201421  It is a complementary BCD code and numeral system. It is basically a binary code which is made by adding 3 to the equivalent decimal of a binary number and again converting it into binary number. Examples:  Excess-3 of 12 is 0001 0010 + 0011 0011 = 0100 0101 (45) .  Excess-3 of 6 is 0110(6) + 0011(3)= 1001(9) .

Editor's Notes

  1. 000010, 01101