SlideShare a Scribd company logo
Computer Arithmetic
Nazmun Nessa Moon
Assistant Professor
Department of CSE
Daffodil International University
Learning Objectives
 In this lecture you will learn about:
Reasons for using binary instead of decimal numbers
Basic arithmetic operations using binary numbers
Addition (+)
Subtraction (-)
Multiplication (*)
Division (/)
Binary over Decimal
 Information is handled in a computer by electronic/ electrical
components
 Electronic components operate in binary mode (can only
indicate two states – ON (1) or OFF (0)
 Binary number system has only two digits (0 and 1), and is
suitable for expressing two possible states
 In binary system, computer circuits only have to handle two
binary digits rather than ten decimal digits causing:
 Simpler internal circuit design
 Less expensive
 More reliable circuits
 Arithmetic rules/processes possible with binary numbers
Examples of a Few Devices that
work in Binary Mode Binary
Binary Number System
 System Digits: 0 and 1
 Bit (short for binary digit): A single binary digit
 LSB (least significant bit): The rightmost bit
 MSB (most significant bit): The leftmost bit
 Upper Byte (or nybble): The right-hand byte (or
nybble) of a pair
 Lower Byte (or nybble): The left-hand byte (or nybble)
of a pair
 The term nibble used for 4 bits being a subset of byte.
Binary Number System
Binary Equivalents
 1 Nybble (or nibble) = 4 bits
 1 Byte = 2 nybbles = 8 bits
 1 Kilobyte (KB) = 1024 bytes
 1 Megabyte (MB) = 1024 kilobytes = 1,048,576 bytes
 1 Gigabyte (GB) = 1024 megabytes = 1,073,741,824
bytes
Binary Arithmetic
Binary arithmetic is simple to learn as binary
number system has only two digits – 0 and 1
Following slides show rules and example for
the four basic arithmetic operations using
binary numbers
Binary Addition
Rule for binary addition is as follows:
① 0 + 0 = 0
② 0 + 1 = 1
③ 1 + 0 = 1
④ 1 + 1 = 0 plus a carry of 1 to next higher
column
 Example 1: 000110102 + 000011002 = 001001102
Binary Addition
 Example 2: 000100112 + 001111102 = 010100012
Binary Addition
Binary Addition (Example 3)
Binary Subtraction
Rule for binary subtraction is as follows:
① 0 - 0 = 0
② 0 - 1 = 1 with a borrow from the next
column
③ 1 - 0 = 1
④ 1 - 1 = 0
Binary Subtraction
 Example 1: 001001012 - 000100012 = 000101002
 Example 2: 001100112 - 000101102 = 000111012
Binary Subtraction
Binary Multiplication
Table for binary multiplication is as
follows:
① 0 x 0 = 0
② 0 x 1 = 0
③ 1 x 0 = 0
④ 1 x 1 = 1
 Example 1: 001010012 × 000001102 = 111101102
Binary Multiplication
 Example 2: 000101112 × 000000112 = 010001012
Binary Multiplication
Binary Multiplication
 Example 3:
Binary Multiplication
 Example 4:
Binary Division
Table for binary division is as follows:
① 0 ÷ 0 = Divide by zero error
② 0 ÷ 1 = 0
③ 1 ÷ 0 = Divide by zero error
④ 1 ÷ 1 = 1
As in the decimal number system (or in any
other number system), division by zero is
meaningless
The computer deals with this problem by raising
an error condition called ‘Divide by zero’ error
Rules for Binary Division
① Start from the left of the dividend
② Perform a series of subtractions in which the divisor is
subtracted from the dividend
③ If subtraction is possible, put a 1 in the quotient and
subtract the divisor from the corresponding digits of
dividend
④ If subtraction is not possible (divisor greater than
remainder), record a 0 in the quotient
⑤ Bring down the next digit to add to the remainder
digits. Proceed as before in a manner similar to long
division
Binary Division (Example 1)
Binary Division (Example 2)
 Example: 001010102 ÷ 000001102 = 000001112
 Example: 100001112 ÷ 000001012 = 000110112
Binary Division (Example 3)
Complement of a Number
Complement of a Decimal
Number
Complement of a Octal
Number
Complement of a Binary
Number
Complementary Method of
Subtraction
Involves following 3 steps:
 Step 1: Find the complement of the number you
are subtracting (subtrahend)
 Step 2: Add this to the number from which you are
taking away (minuend)
 Step 3: If there is a carry of 1, add it to obtain the
result; if there is no carry, recomplement the sum
and attach a negative sign
Complementary subtraction is an additive
approach of subtraction
Complementary Subtraction
(Example 1)
Complementary Subtraction
(Example 2)
Binary Subtraction Using
Complementary Method (Example 1)
Binary Subtraction Using
Complementary Method
(Example 2)
Addition/Subtraction of Numbers
in 2’s Complement Notation
35
 Represent all negative numbers in 2’s complement
form.
 Now we have the same procedure for addition and
subtraction.
 Subtraction of a number is achieved by adding the 2’s
complement of the number.
 This is illustrated in the following example where the
carry, if any, from the most significant bit, during
addition, should be ignored.
 The result has to be interpreted appropriately using the
same convention.
Addition/Subtraction of Numbers
in 2’s Complement Notation…
Key Words/Phrases
 Additive method of division
 Additive method of multiplication
 Additive method of subtraction Binary addition
 Binary arithmetic Binary division
 Binary multiplication Binary subtraction
 Complementary subtraction Complement
 Computer arithmetic

More Related Content

PPTX
Binary Arithmetic
PPTX
Introduction-to-Binary-Arithmetic by Prince Singh roll no.-24.pptx
PPTX
Binary Arithmetic that is used in Computer Programming.pptx
PPTX
Computer Arithmetic(add,sub,multiply,div).pptx
PPTX
Binary true ppt
PDF
Digital logic design of 2nd Lecture 2.pdf
PPTX
Binary arithmetic
PPT
Binary Arithmetic
Binary Arithmetic
Introduction-to-Binary-Arithmetic by Prince Singh roll no.-24.pptx
Binary Arithmetic that is used in Computer Programming.pptx
Computer Arithmetic(add,sub,multiply,div).pptx
Binary true ppt
Digital logic design of 2nd Lecture 2.pdf
Binary arithmetic
Binary Arithmetic

Similar to Computer Arithmetic and Binary Math.pptx (20)

PDF
Computer Arithmetic computer fundamentals.pdf
PDF
Chapter 05 computer arithmetic
PDF
Chapter 05 computer arithmetic
PPTX
Digital Electronics: UNIT-I DIGITAL FUNDAMENTALS
PPTX
binary arithmetic conversion.pptx
PPSX
Binary arithmetic and algebra basics.ppsx
PDF
Chapter 05 computer arithmetic 2o-p
PPTX
Computer Architecture
PPTX
Computer Architecture
PPTX
UNIT - I.pptx
PPTX
UNIT - I.pptx
PPT
Number Systems.ppt
PDF
unit-2_DL.pdf
PPTX
Binary-Arithmeticcccccccccccccccccc.pptx
PPTX
L3 ARITHMETIC OPERATIONS.pptx
PDF
Computer Architecture: ARITHMETIC FOR COMPUTERS
PPTX
CA Unit ii
PDF
Slide03 Number System and Operations Part 1
PPTX
Binary Arithmetic - R.D.Sivakumar
PPSX
Number system (Binary Number)
Computer Arithmetic computer fundamentals.pdf
Chapter 05 computer arithmetic
Chapter 05 computer arithmetic
Digital Electronics: UNIT-I DIGITAL FUNDAMENTALS
binary arithmetic conversion.pptx
Binary arithmetic and algebra basics.ppsx
Chapter 05 computer arithmetic 2o-p
Computer Architecture
Computer Architecture
UNIT - I.pptx
UNIT - I.pptx
Number Systems.ppt
unit-2_DL.pdf
Binary-Arithmeticcccccccccccccccccc.pptx
L3 ARITHMETIC OPERATIONS.pptx
Computer Architecture: ARITHMETIC FOR COMPUTERS
CA Unit ii
Slide03 Number System and Operations Part 1
Binary Arithmetic - R.D.Sivakumar
Number system (Binary Number)
Ad

More from fizarcse (20)

PPTX
Big Data for computer science student.pptx
PDF
Blockchain for Computer science Students.pdf
PPTX
Introduction of deep learning in cse.pptx
PPTX
Tensor Flow for Deep Learning in CSE.pptx
PDF
Networking Basic in Computer Science.pdf
PDF
Machine Learning Basic in Computer Science.pdf
PPTX
L-15.4 Intellectual Property, ICT ACT and Digital security act.pptx
PPTX
L-1 Introduction about the fundamental of computer.pptx
PPT
ClassificationOfMachineLearninginCSE.ppt
PPT
DataTestsComputerScienceAndEngineering.ppt
PPT
HypothesisTestForMachineLearningInCSE.ppt
PDF
Presentation- Introduction to Cybersecurity.pdf
PDF
Boolean Algebra for Computer Science Student.pdf
PPTX
IoT, Data Analytics and Big Data Security.pptx
PPTX
BIG DATA ANALYTICS an Machine Learning.pptx
PPTX
Secondary Storage for a microcontroller system
PDF
Computer Systems Quiz Presentation in Purple Bold Style (4).pdf
PPTX
CSE112 Presentation (Binary Brains).pptx
PPTX
Presentaion About Processor and Memory.pptx
PPTX
STM32 Networking for Embedded Technology.pptx
Big Data for computer science student.pptx
Blockchain for Computer science Students.pdf
Introduction of deep learning in cse.pptx
Tensor Flow for Deep Learning in CSE.pptx
Networking Basic in Computer Science.pdf
Machine Learning Basic in Computer Science.pdf
L-15.4 Intellectual Property, ICT ACT and Digital security act.pptx
L-1 Introduction about the fundamental of computer.pptx
ClassificationOfMachineLearninginCSE.ppt
DataTestsComputerScienceAndEngineering.ppt
HypothesisTestForMachineLearningInCSE.ppt
Presentation- Introduction to Cybersecurity.pdf
Boolean Algebra for Computer Science Student.pdf
IoT, Data Analytics and Big Data Security.pptx
BIG DATA ANALYTICS an Machine Learning.pptx
Secondary Storage for a microcontroller system
Computer Systems Quiz Presentation in Purple Bold Style (4).pdf
CSE112 Presentation (Binary Brains).pptx
Presentaion About Processor and Memory.pptx
STM32 Networking for Embedded Technology.pptx
Ad

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Approach and Philosophy of On baking technology
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Unlocking AI with Model Context Protocol (MCP)
MYSQL Presentation for SQL database connectivity
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Network Security Unit 5.pdf for BCA BBA.
Reach Out and Touch Someone: Haptics and Empathic Computing
Approach and Philosophy of On baking technology
Programs and apps: productivity, graphics, security and other tools
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Mobile App Security Testing_ A Comprehensive Guide.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
MIND Revenue Release Quarter 2 2025 Press Release
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Chapter 3 Spatial Domain Image Processing.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Agricultural_Statistics_at_a_Glance_2022_0.pdf
NewMind AI Weekly Chronicles - August'25 Week I
The Rise and Fall of 3GPP – Time for a Sabbatical?
Encapsulation_ Review paper, used for researhc scholars
Unlocking AI with Model Context Protocol (MCP)

Computer Arithmetic and Binary Math.pptx

  • 1. Computer Arithmetic Nazmun Nessa Moon Assistant Professor Department of CSE Daffodil International University
  • 2. Learning Objectives  In this lecture you will learn about: Reasons for using binary instead of decimal numbers Basic arithmetic operations using binary numbers Addition (+) Subtraction (-) Multiplication (*) Division (/)
  • 3. Binary over Decimal  Information is handled in a computer by electronic/ electrical components  Electronic components operate in binary mode (can only indicate two states – ON (1) or OFF (0)  Binary number system has only two digits (0 and 1), and is suitable for expressing two possible states  In binary system, computer circuits only have to handle two binary digits rather than ten decimal digits causing:  Simpler internal circuit design  Less expensive  More reliable circuits  Arithmetic rules/processes possible with binary numbers
  • 4. Examples of a Few Devices that work in Binary Mode Binary
  • 5. Binary Number System  System Digits: 0 and 1  Bit (short for binary digit): A single binary digit  LSB (least significant bit): The rightmost bit  MSB (most significant bit): The leftmost bit  Upper Byte (or nybble): The right-hand byte (or nybble) of a pair  Lower Byte (or nybble): The left-hand byte (or nybble) of a pair  The term nibble used for 4 bits being a subset of byte.
  • 7. Binary Equivalents  1 Nybble (or nibble) = 4 bits  1 Byte = 2 nybbles = 8 bits  1 Kilobyte (KB) = 1024 bytes  1 Megabyte (MB) = 1024 kilobytes = 1,048,576 bytes  1 Gigabyte (GB) = 1024 megabytes = 1,073,741,824 bytes
  • 8. Binary Arithmetic Binary arithmetic is simple to learn as binary number system has only two digits – 0 and 1 Following slides show rules and example for the four basic arithmetic operations using binary numbers
  • 9. Binary Addition Rule for binary addition is as follows: ① 0 + 0 = 0 ② 0 + 1 = 1 ③ 1 + 0 = 1 ④ 1 + 1 = 0 plus a carry of 1 to next higher column
  • 10.  Example 1: 000110102 + 000011002 = 001001102 Binary Addition
  • 11.  Example 2: 000100112 + 001111102 = 010100012 Binary Addition
  • 13. Binary Subtraction Rule for binary subtraction is as follows: ① 0 - 0 = 0 ② 0 - 1 = 1 with a borrow from the next column ③ 1 - 0 = 1 ④ 1 - 1 = 0
  • 14. Binary Subtraction  Example 1: 001001012 - 000100012 = 000101002
  • 15.  Example 2: 001100112 - 000101102 = 000111012 Binary Subtraction
  • 16. Binary Multiplication Table for binary multiplication is as follows: ① 0 x 0 = 0 ② 0 x 1 = 0 ③ 1 x 0 = 0 ④ 1 x 1 = 1
  • 17.  Example 1: 001010012 × 000001102 = 111101102 Binary Multiplication
  • 18.  Example 2: 000101112 × 000000112 = 010001012 Binary Multiplication
  • 21. Binary Division Table for binary division is as follows: ① 0 ÷ 0 = Divide by zero error ② 0 ÷ 1 = 0 ③ 1 ÷ 0 = Divide by zero error ④ 1 ÷ 1 = 1 As in the decimal number system (or in any other number system), division by zero is meaningless The computer deals with this problem by raising an error condition called ‘Divide by zero’ error
  • 22. Rules for Binary Division ① Start from the left of the dividend ② Perform a series of subtractions in which the divisor is subtracted from the dividend ③ If subtraction is possible, put a 1 in the quotient and subtract the divisor from the corresponding digits of dividend ④ If subtraction is not possible (divisor greater than remainder), record a 0 in the quotient ⑤ Bring down the next digit to add to the remainder digits. Proceed as before in a manner similar to long division
  • 24. Binary Division (Example 2)  Example: 001010102 ÷ 000001102 = 000001112
  • 25.  Example: 100001112 ÷ 000001012 = 000110112 Binary Division (Example 3)
  • 26. Complement of a Number
  • 27. Complement of a Decimal Number
  • 28. Complement of a Octal Number
  • 29. Complement of a Binary Number
  • 30. Complementary Method of Subtraction Involves following 3 steps:  Step 1: Find the complement of the number you are subtracting (subtrahend)  Step 2: Add this to the number from which you are taking away (minuend)  Step 3: If there is a carry of 1, add it to obtain the result; if there is no carry, recomplement the sum and attach a negative sign Complementary subtraction is an additive approach of subtraction
  • 35. Addition/Subtraction of Numbers in 2’s Complement Notation 35  Represent all negative numbers in 2’s complement form.  Now we have the same procedure for addition and subtraction.  Subtraction of a number is achieved by adding the 2’s complement of the number.  This is illustrated in the following example where the carry, if any, from the most significant bit, during addition, should be ignored.  The result has to be interpreted appropriately using the same convention.
  • 36. Addition/Subtraction of Numbers in 2’s Complement Notation…
  • 37. Key Words/Phrases  Additive method of division  Additive method of multiplication  Additive method of subtraction Binary addition  Binary arithmetic Binary division  Binary multiplication Binary subtraction  Complementary subtraction Complement  Computer arithmetic