SlideShare a Scribd company logo
1 of 45
Software Developers
View of Hardware
Binary Arithmetic
Binary Addition
The steps used for a computer to complete
addition are usually greater than a human,

but
their processing speed is far superior.
RULES
0
0
1
1
1
+
+
+
+
+
0
1
0
1
1
=
=
=
=
+
0
1
1
0
1





(With 1 to carry)
= 1 (With 1 to carry)
Binary Addition
EXAMPLE
1
1
0
0
0
1
1
1
+
Binary Addition
EXAMPLE
1
1
0
0
01
1
1
1
+
0
Binary Addition
EXAMPLE
1
1
01 01 1
1
+
0 1
0 0
Binary Addition
EXAMPLE
1
1
01
0
01
1
1
1
+
1 0 0
Binary Addition
EXAMPLE
11 01 01
1
1
1
+
1 0
0 1 0 0
Binary Addition
EXAMPLE
11
1
01
0
01
1
1
1
+
1 0 1 0 0
Binary Addition
CHECKTHEANSWER
9
11
+
20
Activity 1
Perform the following additions in binary.
10110
32010
+ 4010
+ 1810
=
=
=


7610 + 27110

Binary Subtraction
Computers have trouble performing

subtractions
employed:
so the following rule should be
“X – X is
X
the same as
+ -X”
This is where two’s complement is used.

Binary Subtraction
RULES
Convert the number to binary.
Perform two’s complement on the second
number.
Add both numbers together.
2.
3.
4.
Binary Subtraction
EXAMPLE1
Convert 12 - 8 using two’s complement.
Convert to binary
12 = 000011002
3.
8 = 000010002
Perform one’s complement
000010002
111101112
on the 810

Binary Subtraction
EXAMPLE1
Perform two’s complement.
1 1 1 1 0 1 1 12
0 0 0 0 0 0 0 12
2.
+
1 1 1 1 1 0 0 02
Add the two numbers together.
= 1 0 0 0 0 0 1 0 02 (Ignore insignificant
6.
bits)
Binary Subtraction
EXAMPLE2
What happens
the second?
if the first number is larger than
Try 610 - 1010
Binary Subtraction
EXAMPLE2
Convert to binary
6 = 000001102
2.
10 = 000010102
Perform one’s complement
000010102
111101012
on the 1010

Binary Subtraction
EXAMPLE2
Perform two’s complement.
1 1 1 1 0 1 0 12
0 0 0 0 0 0 0 12
2.
+
= 1 1 1 1 0 1 1 02
Binary Subtraction
EXAMPLE2
Add the two numbers together.
0 0 0 0 0 1 1 02
1 1 1 1 0 1 1 02
2.
+
= 1 1 1 1 1 0 02 (Ends with a negative bit)
1
Binary Subtraction
EXAMPLE2
Perform one’s complement
1 1 1 1 1 1 0 02
0 0 0 0 0 0 1 12
Add 1 to the result.
0 0 0 0 0 0 1 12
0 0 0 0 0 0 0 12
on the result
2.
5.
+
= 0 0 0 0 0 1 0 02
Binary Subtraction
EXAMPLE2
We then add the sign bit
0 0 0 0 0 1 0 02
= 1 0 0 0 0 1 0 02
back.
2.
Activity 2
Perform the following subtractions.
22
76
6 -
- 8 =
- 11 =
44 =
3.
4.
5.
Binary Multiplication
Multiplication follows
shift and add.
The rules include:
the general principal of


0
0
1
1
*
*
*
*
0
1
0
1
=
=
=
=
0
0
0
1




0000
00000
Binary Multiplication
EXAMPLE1
Complete 15 * 5 in binary.
Convert to binary
15 = 000011112
3.
5 = 000001012
Ignore any insignificant
11112
zeros.
6.
x
1012
Binary Multiplication
EXAMPLE1
Multiply the first number.
2.
1 1
1
1
0
12
x
1111 x 1 = 1111
2
1 1 1 1
Now this is where the shift and takes place.
7.
1
Binary Multiplication
EXAMPLE1
Shift one place
second digit.
to the left and multiple the
2.
1 1
1
1 12 1111 x 0 = 0000
x
0 1 2
1 1 1 1
0 0 0 0 Shift One Place
0
Binary Multiplication
EXAMPLE1
Shift one place
third digit.
to the left and multiple the
2.
1 1 1
0
12 1111 x 1 = 1111
x
1 1 2
1 1
0 0 0
1 1 1
1 1
1 Shift One Place
0 0
0 0
Binary Multiplication
EXAMPLE1
Add the total of
1 1 1 1
all the steps.
2.
0
1 1
0
1
0
1
0
0
0
0
+
1 0 0 1 0 1 1
Convert back to decimal to check.
8.
Activity 3
Calculate the following
multiplication shift and
using
add.
binary
12
13
97
*
*
*
3 = 1 0 0 1 0 02
5 = 1 0 0 0 0 0 12
20 = 1 1 1 1 0 0 1 0 1 0


02

121 * 67 = 1 1 1 1 1 1 0 1 0 1 0 1 12

Binary Division
Division in binary is similar to long division in
decimal.
It uses what is called a shift and subtract
method.


Binary Division
EXAMPLE1
Complete 575 / 25 using long division.
0
2. 25 575
 Take the first digit of 575 (5) and see if 25
will go into it.
 If it can not put a zero above and take the
next number.
02
2. 25 575
 How many times does 25 go into 57?
TWICE
Binary Division
02
2. 25 575
50
7
 How much is left over?
 57 – (25 * 2) = 7
02
2. 25 575
50
75
 Drop down the next value
Binary Division
75 – (3 * 25) = 0

023
2. 25 575
50
75
 Divide 75 by 25
 Result = 3
023
2. 25 575
50
75
75
0
 Check for remainder
 FINISH!
Binary Division
Complete the following:

25/5

Step 1: Convert both numbers
25 = 1 1 0 0 1
to binary.
5 = 1
Step
1 0 1
0 1
2: Place the numbers accordingly:
1 1 0 0 1
Binary Division
Step 3: Determine if
first bit of dividend.
1 0 1 (5) will fit into the
1 0 1 1 0 0 1
1 0 1(5) will not fit into 1(1)
Step 4: Place a zero above the first bit and try
the next bit.
1 1 0 0
Binary Division
Step 5: Determine if 1 0 1 (5) will fit into the
next two bits of
0
dividend.
1 0 1 0 0 1
1 0 1(5) will not fit into 1 1(3)
Step 6: Place a zero above the second bit and
try the next bit.
1 1 0 0
Binary Division
Step 7: Determine if 1 0 1 (5)
next three bits of dividend.
will fit into the
0 0
1 0 1 0 1
1 0 1(5) will fit into 1 1 0(6)
Step 8: Place a one above the third bit and
times it by the divisor (1 0 1)
1 1 0 0
Binary Division
Step 9: The multiplication of the divisor should
used.
be
placed under the THREE bits you have
0 0 1
1 0 1
A subtraction should take place, however you
cannot subtract in binary. Therefore, the two’s
complement of the 2nd number must be found and
the two numbers added together to get a result.
1 1 0
1 0 1
0 1
Binary Division
Step 10: The two’s complement
0 0 1
of 1 0 1 is 0 1 1
1 0 1
+
0 0 1
1 1 0
0 1 1
0 1
Binary Division
Step 11: Determine if 1 0 1 will fit into the remainder
0 0 1. The answer
next number.
0 0 1
is no so you must bring down the
1 0 1
+
0 0 1 0
1 1 0
0 1 1
0 1
Binary Division
Step 12: 1 01 does not fit into 0 0 1 0. Therefore, a
zero is placed above
is used.
the last bit. And the next number
0 0 1 0
1 0 1
+
0 0 1 0 1
1 1 0
0 1 1
0 1
Binary Division
Step 13: 1 0 1 does fit into 1 0
placed above the final number
1 so therefore, a one is
and the process of shift
and add must be continued.
0 0 1 0 1
1 0 1
+
0 0 0
0 0
+
1 0 1
0 1 1
1 1 0
0 1 1
0 1
Binary Division
Step 14: The final answer is 1 0 1 (5) remainder zero.
Activity 4
Complete the following divisions:

340 / 20
580 / 17


Activity 5
40/4

36/7


More Related Content

Similar to binary arithmetic conversion.pptx

Similar to binary arithmetic conversion.pptx (20)

2.1 data represent on cpu
2.1 data represent on cpu2.1 data represent on cpu
2.1 data represent on cpu
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
 
Alu1
Alu1Alu1
Alu1
 
2sComplementArithmetic1.ppt
2sComplementArithmetic1.ppt2sComplementArithmetic1.ppt
2sComplementArithmetic1.ppt
 
2sComplementArithmetic1.ppt
2sComplementArithmetic1.ppt2sComplementArithmetic1.ppt
2sComplementArithmetic1.ppt
 
2sComplementArithmetic1 lecture slides ppt
2sComplementArithmetic1 lecture slides ppt2sComplementArithmetic1 lecture slides ppt
2sComplementArithmetic1 lecture slides ppt
 
Comp Arithmetic Basic.ppt
Comp Arithmetic Basic.pptComp Arithmetic Basic.ppt
Comp Arithmetic Basic.ppt
 
Slide03 Number System and Operations Part 1
Slide03 Number System and Operations Part 1Slide03 Number System and Operations Part 1
Slide03 Number System and Operations Part 1
 
Arithmetic for Computers
Arithmetic for ComputersArithmetic for Computers
Arithmetic for Computers
 
Digital and Logic Design Chapter 1 binary_systems
Digital and Logic Design Chapter 1 binary_systemsDigital and Logic Design Chapter 1 binary_systems
Digital and Logic Design Chapter 1 binary_systems
 
Number system arithmetic
Number system arithmetic Number system arithmetic
Number system arithmetic
 
ARITHMETIC FOR COMPUTERS
ARITHMETIC FOR COMPUTERS	  ARITHMETIC FOR COMPUTERS
ARITHMETIC FOR COMPUTERS
 
Top schools in delhi ncr
Top schools in delhi ncrTop schools in delhi ncr
Top schools in delhi ncr
 
Top schools in delhi ncr
Top schools in delhi ncrTop schools in delhi ncr
Top schools in delhi ncr
 
digital-electronics.pptx
digital-electronics.pptxdigital-electronics.pptx
digital-electronics.pptx
 
Binary number system
Binary number systemBinary number system
Binary number system
 
CA Unit ii
CA Unit iiCA Unit ii
CA Unit ii
 
tCh10.ppt
tCh10.ppttCh10.ppt
tCh10.ppt
 
3810-08.ppt
3810-08.ppt3810-08.ppt
3810-08.ppt
 

Recently uploaded

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 

Recently uploaded (20)

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 

binary arithmetic conversion.pptx