SlideShare a Scribd company logo
1 of 17
Download to read offline
Mindanao Polytechnic College GSC
Mindanao Polytechnic College
General Santos City
Binary Arithmetic
Narene M. Nagares, MIT
Department of Information Technology
Mindanao Polytechnic College GSC
Binary Arithmetic
• Arithmetic operations in digital systems are
usually done in binary because design of logic
circuits to perform binary arithmetic is much
easier than for decimal.
• Binary arithmetic is carried out in much the
same manner as decimal, expect with the
addition and multiplication tables are much
simpler.
COMP1 - Computer Fundamentals & Programming 2
Mindanao Polytechnic College GSC
Binary Addition
COMP1 - Computer Fundamentals & Programming 3
• Addition table for binary numbers:
and carry 1 to the next column
Simple explanation why there is a
carry 1:
• When you do 1+1, the result in
decimal is 2, the binary number of
2 is 1 0, that is 2 bits.
• The 0 is written down and the 1 is
carried to the next column.
+
Mindanao Polytechnic College GSC
Binary Addition
• Example:
COMP1 - Computer Fundamentals & Programming 4
+
Adding three 1’s is equivalent to
1 1 in binary or 3 in decimal.
Breakdown:
1
+ 1
1 0
+ 1
1 1
Mindanao Polytechnic College GSC
Binary Addition
• Another Example:
COMP1 - Computer Fundamentals & Programming 5
*You may convert it in decimal
to check if your answer is correct.
Mindanao Polytechnic College GSC
Binary Subtraction
• Subtraction table for binary numbers:
COMP1 - Computer Fundamentals & Programming 6
and borrow 1 from the next column
When zero borrows 1 from the next
column, zero does not become 1, rather,
it becomes 1 0, the binary number of
decimal number 2. When you subtract 1
from 2, the result is 1.
Mindanao Polytechnic College GSC
Binary Subtraction
• Examples:
COMP1 - Computer Fundamentals & Programming 7
• Keep borrowing from
the next column until
you are able to find
the value 1.
• (1 0) represents the
number 2 in decimal .
When the previous
column borrows, the
value from the current
column becomes 1.
This becomes:
1 0
And 1 0 – 1 = 1.
Mindanao Polytechnic College GSC
Binary Multiplication
• The multiplication table for binary numbers:
COMP1 - Computer Fundamentals & Programming 8
Mindanao Polytechnic College GSC
Binary Multiplication
• Example: Multiplication of 1310 by 1110 in
binary:
COMP1 - Computer Fundamentals & Programming 9
Mindanao Polytechnic College GSC
Binary Multiplication
• To avoid carries greater than 1, you may add
partial products one at a time:
COMP1 - Computer Fundamentals & Programming 10
Mindanao Polytechnic College GSC
Binary Division
• Binary division is similar to decimal division,
except it is much easier because the only two
possible quotient digits are 0 and 1.
COMP1 - Computer Fundamentals & Programming 11
Mindanao Polytechnic College GSC
Binary Division
• Example: Division of 14510 by 1110 in binary:
• If we start comparing the divisor (1011) with the upper
four bits of the dividend (1001), we find that we cannot
subtract without a negative result, so we move the
divisor one place to the right and try again.
COMP1 - Computer Fundamentals & Programming 12
–
Mindanao Polytechnic College GSC
Binary Division
• Example: Division of 14510 by 1110 in binary:
• This time we can subtract 1011 from 10010 to give 111
as a result, so we put the first quotient bit of 1 above
10010. We then bring down the next dividend bit (0) to
get 1110 and shift the divisor right.
COMP1 - Computer Fundamentals & Programming 13
–
Mindanao Polytechnic College GSC
• Example: Division of 14510 by 1110 in binary:
• We then subtract 1011 from 1110 to get 11,
so the second quotient is 1.
Binary Division
COMP1 - Computer Fundamentals & Programming 14
–
Mindanao Polytechnic College GSC
• Example: Division of 14510 by 1110 in binary:
• When we bring down the next dividend bit,
the result is 110, and we cannot subtract the
shifted divisor, so the third quotient is 0.
Binary Division
COMP1 - Computer Fundamentals & Programming 15
–
Mindanao Polytechnic College GSC
• Example: Division of 14510 by 1110 in binary:
• We then bring down the last dividend bit and subtract 1011 from
1101 to get a final remainder of 10, and the last quotient bit is 1.
Binary Division
COMP1 - Computer Fundamentals & Programming 16
–
–
*The quotient is
1101 with a remainder of 10.
Mindanao Polytechnic College GSC
Exercises (Show your solution)
1. Add, subtract, and multiply in binary:
(a) 1111 and 1010
(b) 110110 and 11101
(c) 100100 and 10110
2. Divide in binary:
(a) 11101001 ÷ 101
(b) 1110010 ÷ 1001
Check your answers by multiplying out in binary and
adding the remainder.
COMP1 - Computer Fundamentals & Programming 17

More Related Content

Similar to Lesson -5 Binary Arithmetic (1).pdffngmh

Mazidi Presentation.pdf
Mazidi Presentation.pdfMazidi Presentation.pdf
Mazidi Presentation.pdfKhabibConor
 
UNIT 4 -Data Representation.pptxfghfghhggh
UNIT 4 -Data Representation.pptxfghfghhgghUNIT 4 -Data Representation.pptxfghfghhggh
UNIT 4 -Data Representation.pptxfghfghhgghKwadjoOwusuAnsahQuar
 
Module 4_Digital Electronics till complements.pdf
Module 4_Digital Electronics till complements.pdfModule 4_Digital Electronics till complements.pdf
Module 4_Digital Electronics till complements.pdfmanjunath V Gudur
 
2sComplementArithmetic1.ppt
2sComplementArithmetic1.ppt2sComplementArithmetic1.ppt
2sComplementArithmetic1.pptSathishkumar.V
 
2sComplementArithmetic1.ppt
2sComplementArithmetic1.ppt2sComplementArithmetic1.ppt
2sComplementArithmetic1.pptMeghadriGhosh4
 
2sComplementArithmetic1 lecture slides ppt
2sComplementArithmetic1 lecture slides ppt2sComplementArithmetic1 lecture slides ppt
2sComplementArithmetic1 lecture slides pptnashitahalwaz95
 
Comp Arithmetic Basic.ppt
Comp Arithmetic Basic.pptComp Arithmetic Basic.ppt
Comp Arithmetic Basic.pptskatiarrahaman
 
Dee 2034 chapter 1 number and code system (Baia)
Dee 2034 chapter 1 number and code system (Baia)Dee 2034 chapter 1 number and code system (Baia)
Dee 2034 chapter 1 number and code system (Baia)SITI SABARIAH SALIHIN
 
Digital Electronics & Fundamental of Microprocessor-I
Digital Electronics & Fundamental of Microprocessor-IDigital Electronics & Fundamental of Microprocessor-I
Digital Electronics & Fundamental of Microprocessor-Ipravinwj
 
IRJET-Design and Implementation of LNS based Approximate Multiplier using Mit...
IRJET-Design and Implementation of LNS based Approximate Multiplier using Mit...IRJET-Design and Implementation of LNS based Approximate Multiplier using Mit...
IRJET-Design and Implementation of LNS based Approximate Multiplier using Mit...IRJET Journal
 
Number Systems.pdf .
Number Systems.pdf                        .Number Systems.pdf                        .
Number Systems.pdf .happycocoman
 
ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)
ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)
ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)Dr. Mazin Mohamed alkathiri
 

Similar to Lesson -5 Binary Arithmetic (1).pdffngmh (20)

Mazidi Presentation.pdf
Mazidi Presentation.pdfMazidi Presentation.pdf
Mazidi Presentation.pdf
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
 
DLD_Chapter_2.pptx
DLD_Chapter_2.pptxDLD_Chapter_2.pptx
DLD_Chapter_2.pptx
 
UNIT 4 -Data Representation.pptxfghfghhggh
UNIT 4 -Data Representation.pptxfghfghhgghUNIT 4 -Data Representation.pptxfghfghhggh
UNIT 4 -Data Representation.pptxfghfghhggh
 
Module 4_Digital Electronics till complements.pdf
Module 4_Digital Electronics till complements.pdfModule 4_Digital Electronics till complements.pdf
Module 4_Digital Electronics till complements.pdf
 
Logic Design
Logic DesignLogic Design
Logic Design
 
Number codes students
Number codes studentsNumber codes students
Number codes students
 
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
 
Pp02
Pp02Pp02
Pp02
 
Comp Arithmetic Basic.ppt
Comp Arithmetic Basic.pptComp Arithmetic Basic.ppt
Comp Arithmetic Basic.ppt
 
Number codes
Number codesNumber codes
Number codes
 
Binary true ppt
Binary true pptBinary true ppt
Binary true ppt
 
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)
 
Digital Electronics & Fundamental of Microprocessor-I
Digital Electronics & Fundamental of Microprocessor-IDigital Electronics & Fundamental of Microprocessor-I
Digital Electronics & Fundamental of Microprocessor-I
 
IRJET-Design and Implementation of LNS based Approximate Multiplier using Mit...
IRJET-Design and Implementation of LNS based Approximate Multiplier using Mit...IRJET-Design and Implementation of LNS based Approximate Multiplier using Mit...
IRJET-Design and Implementation of LNS based Approximate Multiplier using Mit...
 
Number Systems.pdf .
Number Systems.pdf                        .Number Systems.pdf                        .
Number Systems.pdf .
 
ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)
ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)
ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)
 

Recently uploaded

Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesAmanpreetKaur157993
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesPooky Knightsmith
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxMarlene Maheu
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................MirzaAbrarBaig5
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaEADTU
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFVivekanand Anglo Vedic Academy
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSean M. Fox
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文中 央社
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMELOISARIVERA8
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportDenish Jangid
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppCeline George
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptxPoojaSen20
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...EADTU
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽中 央社
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 

Recently uploaded (20)

Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptx
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 

Lesson -5 Binary Arithmetic (1).pdffngmh

  • 1. Mindanao Polytechnic College GSC Mindanao Polytechnic College General Santos City Binary Arithmetic Narene M. Nagares, MIT Department of Information Technology
  • 2. Mindanao Polytechnic College GSC Binary Arithmetic • Arithmetic operations in digital systems are usually done in binary because design of logic circuits to perform binary arithmetic is much easier than for decimal. • Binary arithmetic is carried out in much the same manner as decimal, expect with the addition and multiplication tables are much simpler. COMP1 - Computer Fundamentals & Programming 2
  • 3. Mindanao Polytechnic College GSC Binary Addition COMP1 - Computer Fundamentals & Programming 3 • Addition table for binary numbers: and carry 1 to the next column Simple explanation why there is a carry 1: • When you do 1+1, the result in decimal is 2, the binary number of 2 is 1 0, that is 2 bits. • The 0 is written down and the 1 is carried to the next column. +
  • 4. Mindanao Polytechnic College GSC Binary Addition • Example: COMP1 - Computer Fundamentals & Programming 4 + Adding three 1’s is equivalent to 1 1 in binary or 3 in decimal. Breakdown: 1 + 1 1 0 + 1 1 1
  • 5. Mindanao Polytechnic College GSC Binary Addition • Another Example: COMP1 - Computer Fundamentals & Programming 5 *You may convert it in decimal to check if your answer is correct.
  • 6. Mindanao Polytechnic College GSC Binary Subtraction • Subtraction table for binary numbers: COMP1 - Computer Fundamentals & Programming 6 and borrow 1 from the next column When zero borrows 1 from the next column, zero does not become 1, rather, it becomes 1 0, the binary number of decimal number 2. When you subtract 1 from 2, the result is 1.
  • 7. Mindanao Polytechnic College GSC Binary Subtraction • Examples: COMP1 - Computer Fundamentals & Programming 7 • Keep borrowing from the next column until you are able to find the value 1. • (1 0) represents the number 2 in decimal . When the previous column borrows, the value from the current column becomes 1. This becomes: 1 0 And 1 0 – 1 = 1.
  • 8. Mindanao Polytechnic College GSC Binary Multiplication • The multiplication table for binary numbers: COMP1 - Computer Fundamentals & Programming 8
  • 9. Mindanao Polytechnic College GSC Binary Multiplication • Example: Multiplication of 1310 by 1110 in binary: COMP1 - Computer Fundamentals & Programming 9
  • 10. Mindanao Polytechnic College GSC Binary Multiplication • To avoid carries greater than 1, you may add partial products one at a time: COMP1 - Computer Fundamentals & Programming 10
  • 11. Mindanao Polytechnic College GSC Binary Division • Binary division is similar to decimal division, except it is much easier because the only two possible quotient digits are 0 and 1. COMP1 - Computer Fundamentals & Programming 11
  • 12. Mindanao Polytechnic College GSC Binary Division • Example: Division of 14510 by 1110 in binary: • If we start comparing the divisor (1011) with the upper four bits of the dividend (1001), we find that we cannot subtract without a negative result, so we move the divisor one place to the right and try again. COMP1 - Computer Fundamentals & Programming 12 –
  • 13. Mindanao Polytechnic College GSC Binary Division • Example: Division of 14510 by 1110 in binary: • This time we can subtract 1011 from 10010 to give 111 as a result, so we put the first quotient bit of 1 above 10010. We then bring down the next dividend bit (0) to get 1110 and shift the divisor right. COMP1 - Computer Fundamentals & Programming 13 –
  • 14. Mindanao Polytechnic College GSC • Example: Division of 14510 by 1110 in binary: • We then subtract 1011 from 1110 to get 11, so the second quotient is 1. Binary Division COMP1 - Computer Fundamentals & Programming 14 –
  • 15. Mindanao Polytechnic College GSC • Example: Division of 14510 by 1110 in binary: • When we bring down the next dividend bit, the result is 110, and we cannot subtract the shifted divisor, so the third quotient is 0. Binary Division COMP1 - Computer Fundamentals & Programming 15 –
  • 16. Mindanao Polytechnic College GSC • Example: Division of 14510 by 1110 in binary: • We then bring down the last dividend bit and subtract 1011 from 1101 to get a final remainder of 10, and the last quotient bit is 1. Binary Division COMP1 - Computer Fundamentals & Programming 16 – – *The quotient is 1101 with a remainder of 10.
  • 17. Mindanao Polytechnic College GSC Exercises (Show your solution) 1. Add, subtract, and multiply in binary: (a) 1111 and 1010 (b) 110110 and 11101 (c) 100100 and 10110 2. Divide in binary: (a) 11101001 ÷ 101 (b) 1110010 ÷ 1001 Check your answers by multiplying out in binary and adding the remainder. COMP1 - Computer Fundamentals & Programming 17