SlideShare a Scribd company logo
1 of 14
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

Binary coded decimal r004
Binary coded decimal   r004Binary coded decimal   r004
Binary coded decimal r004arunachalamr16
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representationgavhays
 
Representation Of Data
Representation Of DataRepresentation Of Data
Representation Of Datagavhays
 
Number system and codes
Number system and codesNumber system and codes
Number system and codesAbhiraj Bohra
 
2s complement arithmetic
2s complement arithmetic2s complement arithmetic
2s complement arithmeticSanjay Saluth
 
Chapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbersChapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbersMohammad Bashartullah
 
Representation of Signed Numbers - R.D.Sivakumar
Representation of Signed Numbers - R.D.SivakumarRepresentation of Signed Numbers - R.D.Sivakumar
Representation of Signed Numbers - R.D.SivakumarSivakumar R D .
 
Digital fundamendals r001a
Digital fundamendals r001aDigital fundamendals r001a
Digital fundamendals r001aarunachalamr16
 
1 number systems-unsignedsignedintegers
1 number systems-unsignedsignedintegers1 number systems-unsignedsignedintegers
1 number systems-unsignedsignedintegersirdginfo
 
Fixed Point Conversion
Fixed Point ConversionFixed Point Conversion
Fixed Point ConversionRajesh Sharma
 
Topic 1 Data Representation
Topic 1 Data RepresentationTopic 1 Data Representation
Topic 1 Data Representationekul
 
Lecture 06 computer arithmatic
Lecture 06 computer arithmaticLecture 06 computer arithmatic
Lecture 06 computer arithmaticObaidur Rahman
 

What's hot (20)

Binary coded decimal r004
Binary coded decimal   r004Binary coded decimal   r004
Binary coded decimal r004
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representation
 
Code conversion r006
Code conversion r006Code conversion r006
Code conversion r006
 
Representation Of Data
Representation Of DataRepresentation Of Data
Representation Of Data
 
Number system and codes
Number system and codesNumber system and codes
Number system and codes
 
2s complement arithmetic
2s complement arithmetic2s complement arithmetic
2s complement arithmetic
 
Bcd
BcdBcd
Bcd
 
Chapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbersChapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbers
 
Representation of Signed Numbers - R.D.Sivakumar
Representation of Signed Numbers - R.D.SivakumarRepresentation of Signed Numbers - R.D.Sivakumar
Representation of Signed Numbers - R.D.Sivakumar
 
Number systems r002
Number systems  r002Number systems  r002
Number systems r002
 
Complement
ComplementComplement
Complement
 
Digital fundamendals r001a
Digital fundamendals r001aDigital fundamendals r001a
Digital fundamendals r001a
 
Two’s complement
Two’s complementTwo’s complement
Two’s complement
 
1 number systems-unsignedsignedintegers
1 number systems-unsignedsignedintegers1 number systems-unsignedsignedintegers
1 number systems-unsignedsignedintegers
 
Chapter 7 rohith
Chapter 7 rohithChapter 7 rohith
Chapter 7 rohith
 
2's complement
2's complement2's complement
2's complement
 
Fixed Point Conversion
Fixed Point ConversionFixed Point Conversion
Fixed Point Conversion
 
Topic 1 Data Representation
Topic 1 Data RepresentationTopic 1 Data Representation
Topic 1 Data Representation
 
Binary addition
Binary additionBinary addition
Binary addition
 
Lecture 06 computer arithmatic
Lecture 06 computer arithmaticLecture 06 computer arithmatic
Lecture 06 computer arithmatic
 

Similar to Arithmetic Computation using 2's Complement Notation

Chapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfChapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfTamiratDejene1
 
3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.pptRavikumarR77
 
Ncp computer appls num sys2 pramod
Ncp computer appls  num sys2 pramodNcp computer appls  num sys2 pramod
Ncp computer appls num sys2 pramodNCP
 
Computer organization and architecture lab manual
Computer organization and architecture lab manual Computer organization and architecture lab manual
Computer organization and architecture lab manual Shankar Gangaju
 
Encoding Schemes for Multipliers
Encoding Schemes for MultipliersEncoding Schemes for Multipliers
Encoding Schemes for MultipliersSilicon Mentor
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in indiaEdhole.com
 
Logic Design 2009
Logic Design 2009Logic Design 2009
Logic Design 2009lionking
 
binary arithmetic rules
binary arithmetic rulesbinary arithmetic rules
binary arithmetic rulesstudent
 
Two's complement represenation
Two's complement represenationTwo's complement represenation
Two's complement represenationKUNDANKUMAR932294
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.pptssuser52a19e
 
Review on Number Systems: Decimal, Binary, and Hexadecimal
Review on Number Systems: Decimal, Binary, and HexadecimalReview on Number Systems: Decimal, Binary, and Hexadecimal
Review on Number Systems: Decimal, Binary, and HexadecimalUtkirjonUbaydullaev1
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.pptRAJKUMARP63
 
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsChapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsSSE_AndyLi
 

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

Alu1
Alu1Alu1
Alu1
 
Arithmetic circuits
Arithmetic circuitsArithmetic circuits
Arithmetic circuits
 
Chapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfChapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdf
 
Representation of Negative Numbers
Representation of Negative NumbersRepresentation of Negative Numbers
Representation of Negative Numbers
 
3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt
 
Ncp computer appls num sys2 pramod
Ncp computer appls  num sys2 pramodNcp computer appls  num sys2 pramod
Ncp computer appls num sys2 pramod
 
Computer organization and architecture lab manual
Computer organization and architecture lab manual Computer organization and architecture lab manual
Computer organization and architecture lab manual
 
DLD-Introduction.pptx
DLD-Introduction.pptxDLD-Introduction.pptx
DLD-Introduction.pptx
 
Encoding Schemes for Multipliers
Encoding Schemes for MultipliersEncoding Schemes for Multipliers
Encoding Schemes for Multipliers
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
 
Module 4
Module 4Module 4
Module 4
 
Logic Design 2009
Logic Design 2009Logic Design 2009
Logic Design 2009
 
binary arithmetic rules
binary arithmetic rulesbinary arithmetic rules
binary arithmetic rules
 
Two's complement represenation
Two's complement represenationTwo's complement represenation
Two's complement represenation
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
 
binary-numbers.ppt
binary-numbers.pptbinary-numbers.ppt
binary-numbers.ppt
 
Review on Number Systems: Decimal, Binary, and Hexadecimal
Review on Number Systems: Decimal, Binary, and HexadecimalReview on Number Systems: Decimal, Binary, and Hexadecimal
Review on Number Systems: Decimal, Binary, and Hexadecimal
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
 
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsChapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
 

More from vampugani

Social media presentation
Social media presentationSocial media presentation
Social media presentationvampugani
 
Creating Quick Response(QR) Codes for the OER
Creating Quick Response(QR) Codes for the OERCreating Quick Response(QR) Codes for the OER
Creating Quick Response(QR) Codes for the OERvampugani
 
Post Graduate Diploma in Computer Applications (PGDCA)
Post Graduate Diploma in Computer Applications (PGDCA)Post Graduate Diploma in Computer Applications (PGDCA)
Post Graduate Diploma in Computer Applications (PGDCA)vampugani
 
Overview of Distributed Systems
Overview of Distributed SystemsOverview of Distributed Systems
Overview of Distributed Systemsvampugani
 
Protection and Security in Operating Systems
Protection and Security in Operating SystemsProtection and Security in Operating Systems
Protection and Security in Operating Systemsvampugani
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memoryvampugani
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OSvampugani
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Schedulingvampugani
 
Introduction to OS
Introduction to OSIntroduction to OS
Introduction to OSvampugani
 
Operating Systems
Operating SystemsOperating Systems
Operating Systemsvampugani
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systemsvampugani
 
Multiprocessor Systems
Multiprocessor SystemsMultiprocessor Systems
Multiprocessor Systemsvampugani
 
File Management in Operating Systems
File Management in Operating SystemsFile Management in Operating Systems
File Management in Operating Systemsvampugani
 
Strings in c
Strings in cStrings in c
Strings in cvampugani
 
Control statements and functions in c
Control statements and functions in cControl statements and functions in c
Control statements and functions in cvampugani
 
Introduction to C Programming
Introduction to C Programming Introduction to C Programming
Introduction to C Programming vampugani
 
Introduction to C Programming - I
Introduction to C Programming - I Introduction to C Programming - I
Introduction to C Programming - I vampugani
 

More from vampugani (19)

Social media presentation
Social media presentationSocial media presentation
Social media presentation
 
Creating Quick Response(QR) Codes for the OER
Creating Quick Response(QR) Codes for the OERCreating Quick Response(QR) Codes for the OER
Creating Quick Response(QR) Codes for the OER
 
Post Graduate Diploma in Computer Applications (PGDCA)
Post Graduate Diploma in Computer Applications (PGDCA)Post Graduate Diploma in Computer Applications (PGDCA)
Post Graduate Diploma in Computer Applications (PGDCA)
 
Overview of Distributed Systems
Overview of Distributed SystemsOverview of Distributed Systems
Overview of Distributed Systems
 
Protection and Security in Operating Systems
Protection and Security in Operating SystemsProtection and Security in Operating Systems
Protection and Security in Operating Systems
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Scheduling
 
Processes
ProcessesProcesses
Processes
 
Introduction to OS
Introduction to OSIntroduction to OS
Introduction to OS
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systems
 
Multiprocessor Systems
Multiprocessor SystemsMultiprocessor Systems
Multiprocessor Systems
 
File Management in Operating Systems
File Management in Operating SystemsFile Management in Operating Systems
File Management in Operating Systems
 
Strings in c
Strings in cStrings in c
Strings in c
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
Control statements and functions in c
Control statements and functions in cControl statements and functions in c
Control statements and functions in c
 
Introduction to C Programming
Introduction to C Programming Introduction to C Programming
Introduction to C Programming
 
Introduction to C Programming - I
Introduction to C Programming - I Introduction to C Programming - I
Introduction to C Programming - I
 

Recently uploaded

Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
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
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 

Recently uploaded (20)

Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
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
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 

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