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

Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 

Recently uploaded (20)

Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 

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