SlideShare a Scribd company logo
Binary Arithmetic Using
Signed Complement
Notation
Akshay Kumar
1
Reference: Block 1 Unit 2 Section 2.6.1
of MCS-012
2
Data Representation for
Computation
The most common representation is 2’s
Complement Notation. It is discussed Next:
 Positive numbers are represented as the case with
signed number, but negative numbers are
represented in 2’s complement form
 This is an efficient method for simple binary
addition and subtraction.
3
2’s Complement Notation
 Positive integers have it’s sign bit as 0
 Negative integers are represented as a 2’s
Complement.
 What is a Complement?
 English Meaning: Balance to make a group
complete.
4
Example – 1’s and 2’s Complement for 8 bit numbers
(Please note first digit is sign bit)
Decimal
Number
Equivalent Binary
Place
Value
Sign Bit
(0/1)
26 =
64
25 =
32
24 =
16
23 =
8
22=
4
21 =
2
20 =
1
+37 Value 0 0 1 0 0 1 0 1
-37 1’s 1 1 0 1 1 0 1 0
-37 2’s 1 1 0 1 1 0 1 1
•First find the magnitude of the Number in Binary as
Positive Number (+37)
•Complement each bit (1 by 0) and (0 by 1) to make 1’s
complement of the negative number (-37)
•Add 1 to 1’s complement to get 2’s complement of (-37)
5
Example 2
Decimal
Number
Equivalent Binary
Place
Value
Sign Bit
(0/1)
26 =
64
25 =
32
24 =
16
23 =
8
22=
4
21 =
2
20 =
1
+100 Value 0 1 1 0 0 1 0 0
-100 1’s 1 0 0 1 1 0 1 1
Add 1 c=1 c=1 1
-100 2’s 1 0 0 1 1 1 0 0
•Magnitude of the Number in Binary (+100)
•Complement each bit to get 1’s complement of (-100)
•Add 1 to 1’s complement to get 2’s complement of -100).
Please note the carry bit on addition shown in Orange. 6
Conversion of Binary Integers to 2’s
Complement Notation
 For positive integers – no change is needed
 For negative integers
 Method 1: Complement all the bits individually and
then add 1 to resultant, for instance complement of
65 will be:
+68 in binary (using 8 bits) 0100 0100
- 68 will be obtained as 1011 1011 + 1
= 1011 1100
 Method 2: Moving from least significant bit, leave all
bits till the first 1 as it is, then complement all the
remaining bits
7
Addition using 2’s Complement
Notation
 Four Cases:
 Addition of two positive integers:
+68 0 100 0100
+38 0 010 0110
------------------------
+106 0 110 1010
------------------------
8
Addition using 2’s Complement
Notation
Addition of one positive and one negative
integer (the positive integer is greater):
+68 0 100 0100
-38 1 101 1010
------------------------
+30 1 0 001 1110
------------------------
Carry in to sign bit = Carry out of Sign bit
=> NO OVERFLOW - ignore the carry out of sign bit
9
Addition using 2’s Complement
Notation
Addition of one positive and one negative
integer (the positive integer is smaller):
-68 1 011 1100
+38 0 010 0110
------------------------
-30 1 110 0010
------------------------
+30 0 001 1110
10
Addition using 2’s Complement
Notation
Addition of two negative integers:
-68 1 011 1100
-38 1 101 1010
------------------------
-106 1 1 001 0110
------------------------
+106 0 110 1010
11
Addition using 2’s Complement
Notation
Overflow:
+68 0 100 0100 -68 1 011 1100
+60 0 011 1100 -60 1 100 0100
------------------------ ------------------------
+128 1 000 0000 -128 1 1 000 0000
------------------------ ------------------------
OVERFLOW NO OVERFLOW
+127 0 111 1111 -127 1 000 0001
-128 1 000 0000
12
Check Your Progress
Using an 8 bit representation perform the
following additions:
 Add +92 with -85
 Add -75 and -53
 Add -92 and -39
 Add +34 and -65
 Add 75+53
You must indicate overflow, if any.
13
Queries
 For queries please send mail to specified email id
in the Programme Guide
14

More Related Content

What's hot (20)

PPT
Binary coded decimal r004
arunachalamr16
 
PPT
Integer Representation
gavhays
 
PPT
Code conversion r006
arunachalamr16
 
PPT
Representation Of Data
gavhays
 
PPT
Number system and codes
Abhiraj Bohra
 
PPT
2s complement arithmetic
Sanjay Saluth
 
PPTX
Bcd
Talha Fazal
 
PDF
Chapter 1 digital systems and binary numbers
Mohammad Bashartullah
 
PPTX
Representation of Signed Numbers - R.D.Sivakumar
Sivakumar R D .
 
PPT
Number systems r002
arunachalamr16
 
PPT
Complement
Sudheesh S Madhav
 
PPT
Digital fundamendals r001a
arunachalamr16
 
PPT
Two’s complement
mayannpolisticoLNU
 
PPTX
1 number systems-unsignedsignedintegers
irdginfo
 
PDF
Chapter 7 rohith
Rohith Shivashankar
 
DOCX
2's complement
Arvenz Gavino
 
PDF
Fixed Point Conversion
Rajesh Sharma
 
PPT
Topic 1 Data Representation
ekul
 
PDF
Binary addition
Martin Jacob
 
PPT
Lecture 06 computer arithmatic
Obaidur Rahman
 
Binary coded decimal r004
arunachalamr16
 
Integer Representation
gavhays
 
Code conversion r006
arunachalamr16
 
Representation Of Data
gavhays
 
Number system and codes
Abhiraj Bohra
 
2s complement arithmetic
Sanjay Saluth
 
Chapter 1 digital systems and binary numbers
Mohammad Bashartullah
 
Representation of Signed Numbers - R.D.Sivakumar
Sivakumar R D .
 
Number systems r002
arunachalamr16
 
Complement
Sudheesh S Madhav
 
Digital fundamendals r001a
arunachalamr16
 
Two’s complement
mayannpolisticoLNU
 
1 number systems-unsignedsignedintegers
irdginfo
 
Chapter 7 rohith
Rohith Shivashankar
 
2's complement
Arvenz Gavino
 
Fixed Point Conversion
Rajesh Sharma
 
Topic 1 Data Representation
ekul
 
Binary addition
Martin Jacob
 
Lecture 06 computer arithmatic
Obaidur Rahman
 

Similar to Arithmetic Computation using 2's Complement Notation (20)

PDF
Digital logic design of 2nd Lecture 2.pdf
SherifElGohary7
 
PPTX
Computer Architecture and Organization- arithmetic
C.Helen Sulochana
 
PPT
Computer Arithmetic_Computer_Architecture.ppt
fairuzahmed13579
 
PPT
Arithmetic circuits
Sanjay Saluth
 
PDF
Chapter 2_Number system (EEEg4302).pdf
TamiratDejene1
 
PPT
Representation of Negative Numbers
Forrester High School
 
PPT
3.Fixed-Floating Point.ppt
RavikumarR77
 
PDF
Ncp computer appls num sys2 pramod
NCP
 
PPTX
Binary-Adders-A-Deep-Dive b in dld[1].pptx
kalyandamera1706
 
DOCX
Computer organization and architecture lab manual
Shankar Gangaju
 
PPTX
DLD-Introduction.pptx
UzairAhmadWalana
 
PDF
Encoding Schemes for Multipliers
Silicon Mentor
 
PPT
Mba admission in india
Edhole.com
 
PPT
Module 4
sadhanakumble
 
PPT
Logic Design 2009
lionking
 
PPT
binary arithmetic rules
student
 
PDF
Two's complement represenation
KUNDANKUMAR932294
 
PPT
ch3a-binary-numbers.ppt
Suganthi Vasanth Raj
 
PPT
ch3a-binary-numbers.ppt
ssuser52a19e
 
Digital logic design of 2nd Lecture 2.pdf
SherifElGohary7
 
Computer Architecture and Organization- arithmetic
C.Helen Sulochana
 
Computer Arithmetic_Computer_Architecture.ppt
fairuzahmed13579
 
Arithmetic circuits
Sanjay Saluth
 
Chapter 2_Number system (EEEg4302).pdf
TamiratDejene1
 
Representation of Negative Numbers
Forrester High School
 
3.Fixed-Floating Point.ppt
RavikumarR77
 
Ncp computer appls num sys2 pramod
NCP
 
Binary-Adders-A-Deep-Dive b in dld[1].pptx
kalyandamera1706
 
Computer organization and architecture lab manual
Shankar Gangaju
 
DLD-Introduction.pptx
UzairAhmadWalana
 
Encoding Schemes for Multipliers
Silicon Mentor
 
Mba admission in india
Edhole.com
 
Module 4
sadhanakumble
 
Logic Design 2009
lionking
 
binary arithmetic rules
student
 
Two's complement represenation
KUNDANKUMAR932294
 
ch3a-binary-numbers.ppt
Suganthi Vasanth Raj
 
ch3a-binary-numbers.ppt
ssuser52a19e
 
Ad

More from vampugani (19)

PPTX
Social media presentation
vampugani
 
PPTX
Creating Quick Response(QR) Codes for the OER
vampugani
 
PPTX
Post Graduate Diploma in Computer Applications (PGDCA)
vampugani
 
PPTX
Overview of Distributed Systems
vampugani
 
PPT
Protection and Security in Operating Systems
vampugani
 
PPT
Virtual Memory
vampugani
 
PPT
Memory Management in OS
vampugani
 
PPT
Process Scheduling
vampugani
 
PPT
Processes
vampugani
 
PPT
Introduction to OS
vampugani
 
PPT
Operating Systems
vampugani
 
PPT
Distributed Systems
vampugani
 
PPT
Multiprocessor Systems
vampugani
 
PPT
File Management in Operating Systems
vampugani
 
PPT
Strings in c
vampugani
 
PPT
Arrays in c
vampugani
 
PPT
Control statements and functions in c
vampugani
 
PPT
Introduction to C Programming
vampugani
 
PPT
Introduction to C Programming - I
vampugani
 
Social media presentation
vampugani
 
Creating Quick Response(QR) Codes for the OER
vampugani
 
Post Graduate Diploma in Computer Applications (PGDCA)
vampugani
 
Overview of Distributed Systems
vampugani
 
Protection and Security in Operating Systems
vampugani
 
Virtual Memory
vampugani
 
Memory Management in OS
vampugani
 
Process Scheduling
vampugani
 
Processes
vampugani
 
Introduction to OS
vampugani
 
Operating Systems
vampugani
 
Distributed Systems
vampugani
 
Multiprocessor Systems
vampugani
 
File Management in Operating Systems
vampugani
 
Strings in c
vampugani
 
Arrays in c
vampugani
 
Control statements and functions in c
vampugani
 
Introduction to C Programming
vampugani
 
Introduction to C Programming - I
vampugani
 
Ad

Recently uploaded (20)

PDF
June 2025 Top 10 Sites -Electrical and Electronics Engineering: An Internatio...
elelijjournal653
 
PDF
Rapid Prototyping for XR: Lecture 4 - High Level Prototyping.
Mark Billinghurst
 
PPTX
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
 
PDF
Plant Control_EST_85520-01_en_AllChanges_20220127.pdf
DarshanaChathuranga4
 
PPTX
FSE_LLM4SE1_A Tool for In-depth Analysis of Code Execution Reasoning of Large...
cl144
 
PPT
SF 9_Unit 1.ppt software engineering ppt
AmarrKannthh
 
PPTX
Introduction to File Transfer Protocol with commands in FTP
BeulahS2
 
PDF
lesson4-occupationalsafetyandhealthohsstandards-240812020130-1a7246d0.pdf
arvingallosa3
 
PDF
Rapid Prototyping for XR: Lecture 2 - Low Fidelity Prototyping.
Mark Billinghurst
 
PPTX
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
AsadShad4
 
PPTX
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
AsadShad4
 
PDF
Generative AI & Scientific Research : Catalyst for Innovation, Ethics & Impact
AlqualsaDIResearchGr
 
PPTX
CST413 KTU S7 CSE Machine Learning Clustering K Means Hierarchical Agglomerat...
resming1
 
PDF
FSE-Journal-First-Automated code editing with search-generate-modify.pdf
cl144
 
PDF
Rapid Prototyping for XR: Lecture 1 Introduction to Prototyping
Mark Billinghurst
 
PPTX
Bitumen Emulsion by Dr Sangita Ex CRRI Delhi
grilcodes
 
PPT
FINAL plumbing code for board exam passer
MattKristopherDiaz
 
PPTX
Comparison of Flexible and Rigid Pavements in Bangladesh
Arifur Rahman
 
PDF
13th International Conference of Security, Privacy and Trust Management (SPTM...
ijcisjournal
 
PDF
May 2025: Top 10 Read Articles in Data Mining & Knowledge Management Process
IJDKP
 
June 2025 Top 10 Sites -Electrical and Electronics Engineering: An Internatio...
elelijjournal653
 
Rapid Prototyping for XR: Lecture 4 - High Level Prototyping.
Mark Billinghurst
 
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
 
Plant Control_EST_85520-01_en_AllChanges_20220127.pdf
DarshanaChathuranga4
 
FSE_LLM4SE1_A Tool for In-depth Analysis of Code Execution Reasoning of Large...
cl144
 
SF 9_Unit 1.ppt software engineering ppt
AmarrKannthh
 
Introduction to File Transfer Protocol with commands in FTP
BeulahS2
 
lesson4-occupationalsafetyandhealthohsstandards-240812020130-1a7246d0.pdf
arvingallosa3
 
Rapid Prototyping for XR: Lecture 2 - Low Fidelity Prototyping.
Mark Billinghurst
 
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
AsadShad4
 
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
AsadShad4
 
Generative AI & Scientific Research : Catalyst for Innovation, Ethics & Impact
AlqualsaDIResearchGr
 
CST413 KTU S7 CSE Machine Learning Clustering K Means Hierarchical Agglomerat...
resming1
 
FSE-Journal-First-Automated code editing with search-generate-modify.pdf
cl144
 
Rapid Prototyping for XR: Lecture 1 Introduction to Prototyping
Mark Billinghurst
 
Bitumen Emulsion by Dr Sangita Ex CRRI Delhi
grilcodes
 
FINAL plumbing code for board exam passer
MattKristopherDiaz
 
Comparison of Flexible and Rigid Pavements in Bangladesh
Arifur Rahman
 
13th International Conference of Security, Privacy and Trust Management (SPTM...
ijcisjournal
 
May 2025: Top 10 Read Articles in Data Mining & Knowledge Management Process
IJDKP
 

Arithmetic Computation using 2's Complement Notation

  • 1. Binary Arithmetic Using Signed Complement Notation Akshay Kumar 1
  • 2. Reference: Block 1 Unit 2 Section 2.6.1 of MCS-012 2
  • 3. Data Representation for Computation The most common representation is 2’s Complement Notation. It is discussed Next:  Positive numbers are represented as the case with signed number, but negative numbers are represented in 2’s complement form  This is an efficient method for simple binary addition and subtraction. 3
  • 4. 2’s Complement Notation  Positive integers have it’s sign bit as 0  Negative integers are represented as a 2’s Complement.  What is a Complement?  English Meaning: Balance to make a group complete. 4
  • 5. Example – 1’s and 2’s Complement for 8 bit numbers (Please note first digit is sign bit) Decimal Number Equivalent Binary Place Value Sign Bit (0/1) 26 = 64 25 = 32 24 = 16 23 = 8 22= 4 21 = 2 20 = 1 +37 Value 0 0 1 0 0 1 0 1 -37 1’s 1 1 0 1 1 0 1 0 -37 2’s 1 1 0 1 1 0 1 1 •First find the magnitude of the Number in Binary as Positive Number (+37) •Complement each bit (1 by 0) and (0 by 1) to make 1’s complement of the negative number (-37) •Add 1 to 1’s complement to get 2’s complement of (-37) 5
  • 6. Example 2 Decimal Number Equivalent Binary Place Value Sign Bit (0/1) 26 = 64 25 = 32 24 = 16 23 = 8 22= 4 21 = 2 20 = 1 +100 Value 0 1 1 0 0 1 0 0 -100 1’s 1 0 0 1 1 0 1 1 Add 1 c=1 c=1 1 -100 2’s 1 0 0 1 1 1 0 0 •Magnitude of the Number in Binary (+100) •Complement each bit to get 1’s complement of (-100) •Add 1 to 1’s complement to get 2’s complement of -100). Please note the carry bit on addition shown in Orange. 6
  • 7. Conversion of Binary Integers to 2’s Complement Notation  For positive integers – no change is needed  For negative integers  Method 1: Complement all the bits individually and then add 1 to resultant, for instance complement of 65 will be: +68 in binary (using 8 bits) 0100 0100 - 68 will be obtained as 1011 1011 + 1 = 1011 1100  Method 2: Moving from least significant bit, leave all bits till the first 1 as it is, then complement all the remaining bits 7
  • 8. Addition using 2’s Complement Notation  Four Cases:  Addition of two positive integers: +68 0 100 0100 +38 0 010 0110 ------------------------ +106 0 110 1010 ------------------------ 8
  • 9. Addition using 2’s Complement Notation Addition of one positive and one negative integer (the positive integer is greater): +68 0 100 0100 -38 1 101 1010 ------------------------ +30 1 0 001 1110 ------------------------ Carry in to sign bit = Carry out of Sign bit => NO OVERFLOW - ignore the carry out of sign bit 9
  • 10. Addition using 2’s Complement Notation Addition of one positive and one negative integer (the positive integer is smaller): -68 1 011 1100 +38 0 010 0110 ------------------------ -30 1 110 0010 ------------------------ +30 0 001 1110 10
  • 11. Addition using 2’s Complement Notation Addition of two negative integers: -68 1 011 1100 -38 1 101 1010 ------------------------ -106 1 1 001 0110 ------------------------ +106 0 110 1010 11
  • 12. Addition using 2’s Complement Notation Overflow: +68 0 100 0100 -68 1 011 1100 +60 0 011 1100 -60 1 100 0100 ------------------------ ------------------------ +128 1 000 0000 -128 1 1 000 0000 ------------------------ ------------------------ OVERFLOW NO OVERFLOW +127 0 111 1111 -127 1 000 0001 -128 1 000 0000 12
  • 13. Check Your Progress Using an 8 bit representation perform the following additions:  Add +92 with -85  Add -75 and -53  Add -92 and -39  Add +34 and -65  Add 75+53 You must indicate overflow, if any. 13
  • 14. Queries  For queries please send mail to specified email id in the Programme Guide 14