際際滷

際際滷Share a Scribd company logo
Binary Arithmetic
Binary operations
 Binary addition
 Binary subtraction
 Binary multiplication
 Binary division
Binary addition
 Rules for binary addition:
Binary addition
Addition of large binary numbers
Binary-Arithmeticcccccccccccccccccc.pptx
Solve
1. (12)10 + (8)10
2. (15)10 + (10)10
3. (35)10 + (48)10
4. (10101)2 + (10110)2
5. (10111)2 + (11000)2
Binary Subtraction
Rules for binary subtraction
Binary subtraction
Subtraction of large binary numbers
11001 - 10111 = 00010
Examples
Binary subtraction
Example 1: 0011010  001100
Solution:
1 1 Borrow
0 0 1 1 0 1 0
(-) 0 0 1 1 0 0

0 0 0 1 1 1 0
Decimal Equivalent :
0 0 1 1 0 1 0 = 26
0 0 1 1 0 0 = 12
Therefore, 26  12 = 14
The binary resultant 0 0 0 1 1 1 0 is equivalent to the 14
Logic for binary to decimal
0 0 1 1 0 1 0 =26
26
25
24
23
22
21
20
64 32 16 8 4 2 1
16 8 2 =26
Binary Subtraction
 Example 2: 0100010  0001010
 Solution:
 1 1 Borrow
 0 1 0 0 0 1 0 = 3410
 (-) 0 0 0 1 0 1 0 = 1010
 
 0 0 1 1 0 0 0 = 2410
Binary subtraction
subtract 1010101.10 from 1111011.11
1 borrow
 1111011.11
 1010101.10

0100110.01
Binary subtraction
using 1s and 2s complement method
How to find 1s Complement of given
number
 1s complement of a number is found by changing
all 1s to 0s and all 0s to 1s.
 Ex: 1s complement of a number 10111 is = 01000
 Solve---- Find 1s complement of
a. 11010 = 00101
b. 101101= 010010
c. 1010= 0101
d. 1111=0000
e. 1011001=0100110
How to find 2s Complement of given number
 The 2s complement of a number is obtained by adding
1 to the LSB of 1s complement of that number
 2s complement = 1s complement + 1
 Ex: obtain 2s complement of a number (10110010)2
Solution:
Solve
 Find 2s complement of following numbers.
a. (1101)2 0010=1=0011
b. (10111)2 01000+1=01001
c. (101101)2 010010+1=010011
d. (1011111)2 010000+1=010001
e. (101111101)2 010000010+1=010000011
Subtraction using 1s
complement
A) For subtracting a smaller number from a larger
number, the 1s
complement method is as follows:
1. Determine the 1s
complement of the smaller number.
2. Add the 1s
complement to the larger number.
3. Remove the final carry and add it to the result. This is
called the end-around carry.
Binary subtraction using 1s complement
method
 To perform subtraction (A)2 - (B)2
 Step 1: convert number to be subtracted (B)2 to its 1s complement.
 Step 2: Add first number (A)2 and 1s complement of (B)2 using rules
of binary addition.
 Step 3: if final carry is 1 then add it to the result of addition obtained
in step 2 to get final result.
**If final carry in step 2 is 1 then result obtained in step 2 is Positive
and in its true form no conversion required.
 Step 4: if final carry in step 2 is 0 then result obtained in step 2 is
negative and in 1s complement form. So convert it to its true form.
Binary subtraction using 1s complement
10---------------------------------- 10
-3 - 11-----1complement of 11 +00
--- -----
-1 10 result
1s complement of result 01 final
result
carry 0 so result sign is negative
0
 3 11 11
 -2 10---------01
 ----------
 1 0 0
 1
 ------------
 01
Binary subtraction using 1s complement
9 1001 1001
- 15 1111 1s complement +0000
------- -------
-6 1001
1s complement of result 0110 ---6
carry is 0 so result sign is negative
0
Binary Subtraction Questions Using 1s Complement
Question 1:
(110101)2  (100101)2
Solution:
(1 1 0 1 0 1)2 = 5310------- minuend.
(1 0 0 1 0 1)2 = 3710  subtrahend
Now take the 1s complement of the subtrahend and add with minuend.
1 carry
1 1 0 1 0 1
(+) 0 1 1 0 1 0

0 0 1 1 1 1
+ 1 carry

0 1 0 0 0 0
Therefore, the solution is 010000
(010000)2 = 1610
1
Binary Subtraction Questions Using 1s
Complement
Question 2:
(101011)2  (111001)2 43-57= -14
Solution:
Take 1s complement of the subtrahend
1 1 1
1 0 1 0 1 1
(+) 0 0 0 1 1 0 (1s complement)

1 1 0 0 0 1
Now take the 1s complement of the resultant since it does not carry 1
The resultant becomes 0 0 1 1 1 0
Now, add the negative sign to the resultant value
Therefore the solution is  (001110)2.
Binary subtraction using 2s complement
method
 To perform subtraction (A)2 - (B)2
 Step 1: convert number to be subtracted (B)2 to its 2s complement.
 Step 2: Add first number (A)2 and 2s complement of (B)2 using rules
of binary addition.
 Step 3: if final carry is 1 then the result Positive and in its true form
no conversion required.
 Step 4: if final carry in step 2 is 0 then result obtained in step 2 is
negative and in 2s complement form. So convert it to its true form.
** Carry always be discarded.
Binary subtraction using 2s complement
5 101
-7 111 1s comple.---000
---- + 1
-2 ------
2s complement 001
+101
-------
result 110
1s complement 001
+ 1
--------
2s complement 010 final result
Carry is 0 so result is negative
0
 13 1101
-10 1010 0101
------- 1
03 ---------
0110
1101
--------------
1 0011
Subtraction using 2s complement
33 100001
-45 101101 1s 010010
----- + 1
-12 ------------
2s 010011
+100001
------------
110100 result
1s 001011
+ 1
-------------
2s 001100 final result
0
Solve the following binary subtraction using
1s and 2s complement method
 15-23
 25-18
 23-18
 18-9
Binary-Arithmeticcccccccccccccccccc.pptx
 10111 10111
 -10010 01101 1s
 1
 ---------
 01110
 10111
 -----------
 100101
Binary Multiplication
Multiplication (1 of 3)
 Decimal (just for fun)
35
x 105
175
000
35
3675
Multiplication
 Binary, two 1-bit values
A B A  B
0 0 0
0 1 0
1 0 0
1 1 1
Example Binary Multiplication
A = 910 = 10012
A3A2A1A0
B = 810 = 10002
B3B2B1B0
1001
 1000
------------------
0000 multiply by B0
+ 0000 multiply by B1
+ 0000 multiply by B2
+ 1001 multiply by B3
--------------
1001000
Cross check
1 0 0 1 0 0 0
64 32 16 8 4 2 1 place value of result bits
64+8=72
Perform the following multiplication in binary number system: 10112  1012
1 0 1 1
 1 0 1
---------
1 0 1 1
+ 0 0 0 0
+ 1 0 1 1
carry 1
-------------------
1 1 0 1 1 1
Perform the following multiplication in binary number system:
101.12  11.12
1 0 1 .1
 1 1 .1
----------------
1 0 1 1
+ 1 0 1 1
+ 1 0 1 1
Carry 1 1 1 1
---------------------
1 0 0 1 1. 0 1
Multiplication
 Binary, two n-bit values
 As with decimal values
 E.g.,
1110
x 1011
1110
1110
0000
1110
10011010
Binary Multiplication
 Perform the following multiplication in binary
number system: 1510  810
 Perform the following multiplication in binary
number system: 10012  11012
 Perform the following multiplication in binary
number system: 111.112  101.12
Solve
 (205)10 x (3)10
 (1110101)2 x (1001)2
 (110)2 x (10)2
 (1111101)2 x (101)2
 (15)10 x (8)10
Binary Division
Binary Division:110 歎10
10) 110 ( 11
- 10
----------
010
- 10
------------
000
Binary division
Ex: (25)10 歎 (5)10
Perform the division 111110.1 歎101
1100.1 quotient
101)
111110.1 5)62.5(12.5
-101 -5
-------------- ---------
0101 12.5
- 101 - 10
------------- --------
0000101 02.5
- 101 - 2.5
-------------- --------
0000000 remainder 000
Solve
 (205)10 歎 (3)10
 (1110101)2 歎 (1001)2
 (110)2 歎 (10)2
 (1111101)2 歎 (101)2
Binary-Arithmeticcccccccccccccccccc.pptx
 100)1100(11
 100
 ---------------
 0100
 100
 ----------------
 0000
END

More Related Content

Similar to Binary-Arithmeticcccccccccccccccccc.pptx (20)

CA Unit ii
CA Unit iiCA Unit ii
CA Unit ii
AmirthavalliR
Decimal arithematic operation
Decimal arithematic operationDecimal arithematic operation
Decimal arithematic operation
PadmapriyaG
Data representation
Data representationData representation
Data representation
Chew Hoong
digital-electronics (1)_watermark.pdfhindi
digital-electronics (1)_watermark.pdfhindidigital-electronics (1)_watermark.pdfhindi
digital-electronics (1)_watermark.pdfhindi
NikhilPant15
DIGITAL ELECTRONICS.pptx
DIGITAL ELECTRONICS.pptxDIGITAL ELECTRONICS.pptx
DIGITAL ELECTRONICS.pptx
KSatyanarayanaRaju
Alu1
Alu1Alu1
Alu1
khizarhabibqureshi
Digital_Electronics_Basics.pdf
Digital_Electronics_Basics.pdfDigital_Electronics_Basics.pdf
Digital_Electronics_Basics.pdf
rahul143341
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
Suganthi Vasanth Raj
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
ssuser52a19e
Review on Number Systems: Decimal, Binary, and Hexadecimal
Review on Number Systems: Decimal, Binary, and HexadecimalReview on Number Systems: Decimal, Binary, and Hexadecimal
Review on Number Systems: Decimal, Binary, and Hexadecimal
UtkirjonUbaydullaev1
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
RAJKUMARP63
mmmmmmmmmmmmmmmmmmmmmmbinary-numbers.ppt
mmmmmmmmmmmmmmmmmmmmmmbinary-numbers.pptmmmmmmmmmmmmmmmmmmmmmmbinary-numbers.ppt
mmmmmmmmmmmmmmmmmmmmmmbinary-numbers.ppt
AdityaGupta221734
ch3a-binary-numbers.ppt ch3a-binary-numbers.ppt ch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt ch3a-binary-numbers.ppt  ch3a-binary-numbers.pptch3a-binary-numbers.ppt ch3a-binary-numbers.ppt  ch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt ch3a-binary-numbers.ppt ch3a-binary-numbers.ppt
anilmallah76
binary-numbers.ppt
binary-numbers.pptbinary-numbers.ppt
binary-numbers.ppt
MarlonMagtibay2
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
Meenakshi Paul
data java lesson11111111111111233333333333333333.pptx
data java lesson11111111111111233333333333333333.pptxdata java lesson11111111111111233333333333333333.pptx
data java lesson11111111111111233333333333333333.pptx
RobertCarreonBula
Churrrrrrrrr12345221145647654564789.pptx
Churrrrrrrrr12345221145647654564789.pptxChurrrrrrrrr12345221145647654564789.pptx
Churrrrrrrrr12345221145647654564789.pptx
RobertCarreonBula
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
Edhole.com
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
RabiaAsif31
L2 number
L2 numberL2 number
L2 number
mondalakash2012
Decimal arithematic operation
Decimal arithematic operationDecimal arithematic operation
Decimal arithematic operation
PadmapriyaG
Data representation
Data representationData representation
Data representation
Chew Hoong
digital-electronics (1)_watermark.pdfhindi
digital-electronics (1)_watermark.pdfhindidigital-electronics (1)_watermark.pdfhindi
digital-electronics (1)_watermark.pdfhindi
NikhilPant15
Digital_Electronics_Basics.pdf
Digital_Electronics_Basics.pdfDigital_Electronics_Basics.pdf
Digital_Electronics_Basics.pdf
rahul143341
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
ssuser52a19e
Review on Number Systems: Decimal, Binary, and Hexadecimal
Review on Number Systems: Decimal, Binary, and HexadecimalReview on Number Systems: Decimal, Binary, and Hexadecimal
Review on Number Systems: Decimal, Binary, and Hexadecimal
UtkirjonUbaydullaev1
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
RAJKUMARP63
mmmmmmmmmmmmmmmmmmmmmmbinary-numbers.ppt
mmmmmmmmmmmmmmmmmmmmmmbinary-numbers.pptmmmmmmmmmmmmmmmmmmmmmmbinary-numbers.ppt
mmmmmmmmmmmmmmmmmmmmmmbinary-numbers.ppt
AdityaGupta221734
ch3a-binary-numbers.ppt ch3a-binary-numbers.ppt ch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt ch3a-binary-numbers.ppt  ch3a-binary-numbers.pptch3a-binary-numbers.ppt ch3a-binary-numbers.ppt  ch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt ch3a-binary-numbers.ppt ch3a-binary-numbers.ppt
anilmallah76
data java lesson11111111111111233333333333333333.pptx
data java lesson11111111111111233333333333333333.pptxdata java lesson11111111111111233333333333333333.pptx
data java lesson11111111111111233333333333333333.pptx
RobertCarreonBula
Churrrrrrrrr12345221145647654564789.pptx
Churrrrrrrrr12345221145647654564789.pptxChurrrrrrrrr12345221145647654564789.pptx
Churrrrrrrrr12345221145647654564789.pptx
RobertCarreonBula
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
Edhole.com
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
RabiaAsif31

Recently uploaded (20)

Industrial Valves, Instruments Products Profile
Industrial Valves, Instruments Products ProfileIndustrial Valves, Instruments Products Profile
Industrial Valves, Instruments Products Profile
zebcoeng
Wireless-Charger presentation for seminar .pdf
Wireless-Charger presentation for seminar .pdfWireless-Charger presentation for seminar .pdf
Wireless-Charger presentation for seminar .pdf
AbhinandanMishra30
Embedded System intro Embedded System intro.ppt
Embedded System intro Embedded System intro.pptEmbedded System intro Embedded System intro.ppt
Embedded System intro Embedded System intro.ppt
23ucc580
Introduction to Safety, Health & Environment
Introduction to Safety, Health  & EnvironmentIntroduction to Safety, Health  & Environment
Introduction to Safety, Health & Environment
ssuserc606c7
04 MAINTENANCE OF CONCRETE PAVEMENTS.ppt
04  MAINTENANCE OF CONCRETE PAVEMENTS.ppt04  MAINTENANCE OF CONCRETE PAVEMENTS.ppt
04 MAINTENANCE OF CONCRETE PAVEMENTS.ppt
sreenath seenu
How to Build a Maze Solving Robot Using Arduino
How to Build a Maze Solving Robot Using ArduinoHow to Build a Maze Solving Robot Using Arduino
How to Build a Maze Solving Robot Using Arduino
CircuitDigest
only history of java.pptx real bihind the name java
only history of java.pptx real bihind the name javaonly history of java.pptx real bihind the name java
only history of java.pptx real bihind the name java
mushtaqsaliq9
Engineering at Lovely Professional University (LPU).pdf
Engineering at Lovely Professional University (LPU).pdfEngineering at Lovely Professional University (LPU).pdf
Engineering at Lovely Professional University (LPU).pdf
Sona
Frankfurt University of Applied Science urkunde
Frankfurt University of Applied Science urkundeFrankfurt University of Applied Science urkunde
Frankfurt University of Applied Science urkunde
Lisa Emerson
Turbocor Product and Technology Review.pdf
Turbocor Product and Technology Review.pdfTurbocor Product and Technology Review.pdf
Turbocor Product and Technology Review.pdf
Totok Sulistiyanto
Optimization of Cumulative Energy, Exergy Consumption and Environmental Life ...
Optimization of Cumulative Energy, Exergy Consumption and Environmental Life ...Optimization of Cumulative Energy, Exergy Consumption and Environmental Life ...
Optimization of Cumulative Energy, Exergy Consumption and Environmental Life ...
J. Agricultural Machinery
Soil Properties and Methods of Determination
Soil Properties and  Methods of DeterminationSoil Properties and  Methods of Determination
Soil Properties and Methods of Determination
Rajani Vyawahare
CFOT Fiber Optics FOA CERTIFICATION.pptx
CFOT Fiber Optics FOA CERTIFICATION.pptxCFOT Fiber Optics FOA CERTIFICATION.pptx
CFOT Fiber Optics FOA CERTIFICATION.pptx
MohamedShabana37
Env and Water Supply Engg._Dr. Hasan.pdf
Env and Water Supply Engg._Dr. Hasan.pdfEnv and Water Supply Engg._Dr. Hasan.pdf
Env and Water Supply Engg._Dr. Hasan.pdf
MahmudHasan747870
IPC-9716_2024 Requirements for Automated Optical Inspection (AOI) Process Con...
IPC-9716_2024 Requirements for Automated Optical Inspection (AOI) Process Con...IPC-9716_2024 Requirements for Automated Optical Inspection (AOI) Process Con...
IPC-9716_2024 Requirements for Automated Optical Inspection (AOI) Process Con...
ssuserd9338b
TM-ASP-101-RF_Air Press manual crimping machine.pdf
TM-ASP-101-RF_Air Press manual crimping machine.pdfTM-ASP-101-RF_Air Press manual crimping machine.pdf
TM-ASP-101-RF_Air Press manual crimping machine.pdf
ChungLe60
Cyber Security_ Protecting the Digital World.pptx
Cyber Security_ Protecting the Digital World.pptxCyber Security_ Protecting the Digital World.pptx
Cyber Security_ Protecting the Digital World.pptx
Harshith A S
Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...
Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...
Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...
ASHISHDESAI85
Mathematics behind machine learning INT255 INT255__Unit 3__PPT-1.pptx
Mathematics behind machine learning INT255 INT255__Unit 3__PPT-1.pptxMathematics behind machine learning INT255 INT255__Unit 3__PPT-1.pptx
Mathematics behind machine learning INT255 INT255__Unit 3__PPT-1.pptx
ppkmurthy2006
Taykon-Kalite belgeleri
Taykon-Kalite belgeleriTaykon-Kalite belgeleri
Taykon-Kalite belgeleri
TAYKON
Industrial Valves, Instruments Products Profile
Industrial Valves, Instruments Products ProfileIndustrial Valves, Instruments Products Profile
Industrial Valves, Instruments Products Profile
zebcoeng
Wireless-Charger presentation for seminar .pdf
Wireless-Charger presentation for seminar .pdfWireless-Charger presentation for seminar .pdf
Wireless-Charger presentation for seminar .pdf
AbhinandanMishra30
Embedded System intro Embedded System intro.ppt
Embedded System intro Embedded System intro.pptEmbedded System intro Embedded System intro.ppt
Embedded System intro Embedded System intro.ppt
23ucc580
Introduction to Safety, Health & Environment
Introduction to Safety, Health  & EnvironmentIntroduction to Safety, Health  & Environment
Introduction to Safety, Health & Environment
ssuserc606c7
04 MAINTENANCE OF CONCRETE PAVEMENTS.ppt
04  MAINTENANCE OF CONCRETE PAVEMENTS.ppt04  MAINTENANCE OF CONCRETE PAVEMENTS.ppt
04 MAINTENANCE OF CONCRETE PAVEMENTS.ppt
sreenath seenu
How to Build a Maze Solving Robot Using Arduino
How to Build a Maze Solving Robot Using ArduinoHow to Build a Maze Solving Robot Using Arduino
How to Build a Maze Solving Robot Using Arduino
CircuitDigest
only history of java.pptx real bihind the name java
only history of java.pptx real bihind the name javaonly history of java.pptx real bihind the name java
only history of java.pptx real bihind the name java
mushtaqsaliq9
Engineering at Lovely Professional University (LPU).pdf
Engineering at Lovely Professional University (LPU).pdfEngineering at Lovely Professional University (LPU).pdf
Engineering at Lovely Professional University (LPU).pdf
Sona
Frankfurt University of Applied Science urkunde
Frankfurt University of Applied Science urkundeFrankfurt University of Applied Science urkunde
Frankfurt University of Applied Science urkunde
Lisa Emerson
Turbocor Product and Technology Review.pdf
Turbocor Product and Technology Review.pdfTurbocor Product and Technology Review.pdf
Turbocor Product and Technology Review.pdf
Totok Sulistiyanto
Optimization of Cumulative Energy, Exergy Consumption and Environmental Life ...
Optimization of Cumulative Energy, Exergy Consumption and Environmental Life ...Optimization of Cumulative Energy, Exergy Consumption and Environmental Life ...
Optimization of Cumulative Energy, Exergy Consumption and Environmental Life ...
J. Agricultural Machinery
Soil Properties and Methods of Determination
Soil Properties and  Methods of DeterminationSoil Properties and  Methods of Determination
Soil Properties and Methods of Determination
Rajani Vyawahare
CFOT Fiber Optics FOA CERTIFICATION.pptx
CFOT Fiber Optics FOA CERTIFICATION.pptxCFOT Fiber Optics FOA CERTIFICATION.pptx
CFOT Fiber Optics FOA CERTIFICATION.pptx
MohamedShabana37
Env and Water Supply Engg._Dr. Hasan.pdf
Env and Water Supply Engg._Dr. Hasan.pdfEnv and Water Supply Engg._Dr. Hasan.pdf
Env and Water Supply Engg._Dr. Hasan.pdf
MahmudHasan747870
IPC-9716_2024 Requirements for Automated Optical Inspection (AOI) Process Con...
IPC-9716_2024 Requirements for Automated Optical Inspection (AOI) Process Con...IPC-9716_2024 Requirements for Automated Optical Inspection (AOI) Process Con...
IPC-9716_2024 Requirements for Automated Optical Inspection (AOI) Process Con...
ssuserd9338b
TM-ASP-101-RF_Air Press manual crimping machine.pdf
TM-ASP-101-RF_Air Press manual crimping machine.pdfTM-ASP-101-RF_Air Press manual crimping machine.pdf
TM-ASP-101-RF_Air Press manual crimping machine.pdf
ChungLe60
Cyber Security_ Protecting the Digital World.pptx
Cyber Security_ Protecting the Digital World.pptxCyber Security_ Protecting the Digital World.pptx
Cyber Security_ Protecting the Digital World.pptx
Harshith A S
Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...
Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...
Integration of Additive Manufacturing (AM) with IoT : A Smart Manufacturing A...
ASHISHDESAI85
Mathematics behind machine learning INT255 INT255__Unit 3__PPT-1.pptx
Mathematics behind machine learning INT255 INT255__Unit 3__PPT-1.pptxMathematics behind machine learning INT255 INT255__Unit 3__PPT-1.pptx
Mathematics behind machine learning INT255 INT255__Unit 3__PPT-1.pptx
ppkmurthy2006
Taykon-Kalite belgeleri
Taykon-Kalite belgeleriTaykon-Kalite belgeleri
Taykon-Kalite belgeleri
TAYKON

Binary-Arithmeticcccccccccccccccccc.pptx

  • 2. Binary operations Binary addition Binary subtraction Binary multiplication Binary division
  • 3. Binary addition Rules for binary addition:
  • 5. Addition of large binary numbers
  • 7. Solve 1. (12)10 + (8)10 2. (15)10 + (10)10 3. (35)10 + (48)10 4. (10101)2 + (10110)2 5. (10111)2 + (11000)2
  • 9. Rules for binary subtraction
  • 11. Subtraction of large binary numbers 11001 - 10111 = 00010
  • 13. Binary subtraction Example 1: 0011010 001100 Solution: 1 1 Borrow 0 0 1 1 0 1 0 (-) 0 0 1 1 0 0 0 0 0 1 1 1 0 Decimal Equivalent : 0 0 1 1 0 1 0 = 26 0 0 1 1 0 0 = 12 Therefore, 26 12 = 14 The binary resultant 0 0 0 1 1 1 0 is equivalent to the 14
  • 14. Logic for binary to decimal 0 0 1 1 0 1 0 =26 26 25 24 23 22 21 20 64 32 16 8 4 2 1 16 8 2 =26
  • 15. Binary Subtraction Example 2: 0100010 0001010 Solution: 1 1 Borrow 0 1 0 0 0 1 0 = 3410 (-) 0 0 0 1 0 1 0 = 1010 0 0 1 1 0 0 0 = 2410
  • 16. Binary subtraction subtract 1010101.10 from 1111011.11 1 borrow 1111011.11 1010101.10 0100110.01
  • 17. Binary subtraction using 1s and 2s complement method
  • 18. How to find 1s Complement of given number 1s complement of a number is found by changing all 1s to 0s and all 0s to 1s. Ex: 1s complement of a number 10111 is = 01000 Solve---- Find 1s complement of a. 11010 = 00101 b. 101101= 010010 c. 1010= 0101 d. 1111=0000 e. 1011001=0100110
  • 19. How to find 2s Complement of given number The 2s complement of a number is obtained by adding 1 to the LSB of 1s complement of that number 2s complement = 1s complement + 1 Ex: obtain 2s complement of a number (10110010)2 Solution:
  • 20. Solve Find 2s complement of following numbers. a. (1101)2 0010=1=0011 b. (10111)2 01000+1=01001 c. (101101)2 010010+1=010011 d. (1011111)2 010000+1=010001 e. (101111101)2 010000010+1=010000011
  • 21. Subtraction using 1s complement A) For subtracting a smaller number from a larger number, the 1s complement method is as follows: 1. Determine the 1s complement of the smaller number. 2. Add the 1s complement to the larger number. 3. Remove the final carry and add it to the result. This is called the end-around carry.
  • 22. Binary subtraction using 1s complement method To perform subtraction (A)2 - (B)2 Step 1: convert number to be subtracted (B)2 to its 1s complement. Step 2: Add first number (A)2 and 1s complement of (B)2 using rules of binary addition. Step 3: if final carry is 1 then add it to the result of addition obtained in step 2 to get final result. **If final carry in step 2 is 1 then result obtained in step 2 is Positive and in its true form no conversion required. Step 4: if final carry in step 2 is 0 then result obtained in step 2 is negative and in 1s complement form. So convert it to its true form.
  • 23. Binary subtraction using 1s complement 10---------------------------------- 10 -3 - 11-----1complement of 11 +00 --- ----- -1 10 result 1s complement of result 01 final result carry 0 so result sign is negative 0
  • 24. 3 11 11 -2 10---------01 ---------- 1 0 0 1 ------------ 01
  • 25. Binary subtraction using 1s complement 9 1001 1001 - 15 1111 1s complement +0000 ------- ------- -6 1001 1s complement of result 0110 ---6 carry is 0 so result sign is negative 0
  • 26. Binary Subtraction Questions Using 1s Complement Question 1: (110101)2 (100101)2 Solution: (1 1 0 1 0 1)2 = 5310------- minuend. (1 0 0 1 0 1)2 = 3710 subtrahend Now take the 1s complement of the subtrahend and add with minuend. 1 carry 1 1 0 1 0 1 (+) 0 1 1 0 1 0 0 0 1 1 1 1 + 1 carry 0 1 0 0 0 0 Therefore, the solution is 010000 (010000)2 = 1610 1
  • 27. Binary Subtraction Questions Using 1s Complement Question 2: (101011)2 (111001)2 43-57= -14 Solution: Take 1s complement of the subtrahend 1 1 1 1 0 1 0 1 1 (+) 0 0 0 1 1 0 (1s complement) 1 1 0 0 0 1 Now take the 1s complement of the resultant since it does not carry 1 The resultant becomes 0 0 1 1 1 0 Now, add the negative sign to the resultant value Therefore the solution is (001110)2.
  • 28. Binary subtraction using 2s complement method To perform subtraction (A)2 - (B)2 Step 1: convert number to be subtracted (B)2 to its 2s complement. Step 2: Add first number (A)2 and 2s complement of (B)2 using rules of binary addition. Step 3: if final carry is 1 then the result Positive and in its true form no conversion required. Step 4: if final carry in step 2 is 0 then result obtained in step 2 is negative and in 2s complement form. So convert it to its true form. ** Carry always be discarded.
  • 29. Binary subtraction using 2s complement 5 101 -7 111 1s comple.---000 ---- + 1 -2 ------ 2s complement 001 +101 ------- result 110 1s complement 001 + 1 -------- 2s complement 010 final result Carry is 0 so result is negative 0
  • 30. 13 1101 -10 1010 0101 ------- 1 03 --------- 0110 1101 -------------- 1 0011
  • 31. Subtraction using 2s complement 33 100001 -45 101101 1s 010010 ----- + 1 -12 ------------ 2s 010011 +100001 ------------ 110100 result 1s 001011 + 1 ------------- 2s 001100 final result 0
  • 32. Solve the following binary subtraction using 1s and 2s complement method 15-23 25-18 23-18 18-9
  • 34. 10111 10111 -10010 01101 1s 1 --------- 01110 10111 ----------- 100101
  • 36. Multiplication (1 of 3) Decimal (just for fun) 35 x 105 175 000 35 3675
  • 37. Multiplication Binary, two 1-bit values A B A B 0 0 0 0 1 0 1 0 0 1 1 1
  • 38. Example Binary Multiplication A = 910 = 10012 A3A2A1A0 B = 810 = 10002 B3B2B1B0 1001 1000 ------------------ 0000 multiply by B0 + 0000 multiply by B1 + 0000 multiply by B2 + 1001 multiply by B3 -------------- 1001000 Cross check 1 0 0 1 0 0 0 64 32 16 8 4 2 1 place value of result bits 64+8=72
  • 39. Perform the following multiplication in binary number system: 10112 1012 1 0 1 1 1 0 1 --------- 1 0 1 1 + 0 0 0 0 + 1 0 1 1 carry 1 ------------------- 1 1 0 1 1 1
  • 40. Perform the following multiplication in binary number system: 101.12 11.12 1 0 1 .1 1 1 .1 ---------------- 1 0 1 1 + 1 0 1 1 + 1 0 1 1 Carry 1 1 1 1 --------------------- 1 0 0 1 1. 0 1
  • 41. Multiplication Binary, two n-bit values As with decimal values E.g., 1110 x 1011 1110 1110 0000 1110 10011010
  • 42. Binary Multiplication Perform the following multiplication in binary number system: 1510 810 Perform the following multiplication in binary number system: 10012 11012 Perform the following multiplication in binary number system: 111.112 101.12
  • 43. Solve (205)10 x (3)10 (1110101)2 x (1001)2 (110)2 x (10)2 (1111101)2 x (101)2 (15)10 x (8)10
  • 45. Binary Division:110 歎10 10) 110 ( 11 - 10 ---------- 010 - 10 ------------ 000
  • 47. Perform the division 111110.1 歎101 1100.1 quotient 101) 111110.1 5)62.5(12.5 -101 -5 -------------- --------- 0101 12.5 - 101 - 10 ------------- -------- 0000101 02.5 - 101 - 2.5 -------------- -------- 0000000 remainder 000
  • 48. Solve (205)10 歎 (3)10 (1110101)2 歎 (1001)2 (110)2 歎 (10)2 (1111101)2 歎 (101)2
  • 50. 100)1100(11 100 --------------- 0100 100 ---------------- 0000
  • 51. END