SlideShare uma empresa Scribd logo
1 de 13
1’s and 2’s Complements
Subtraction of a number from another can be accomplished by adding the complement of the subtrahend to the minuend. Introduction
1’s Complement Subtraction Subtraction of binary numbers using the 1’s complement method allows subtraction only by addition.
The 1’s complement of a binary number can be obtained by changing all 1s to 0s and all 0s and 1s. Cont.,
To subtract a smaller number from a larger number, the 1’s complement method is as follows 1’s complement method Determine the 1’s complement of the smaller number.   Add this to the larger number  Remove the carry and add it to the result. This carry is called end-around-carry
Subtract (1010)2 from (1111)2 Example of 1’s complement 1’s complement method Direct Subtraction 1   1   1   1 1’s complement 0   1   0   1 1   1   1   1 1   0   1   0 Carry 0 0 1 1  0 1 0 1 0 1 Add Carry 1 0 1 0
Subtraction of a large number a smaller one by the 1’s complement method involves the following steps Subtraction Steps Determine the 1’s complement of  a large number Add this to the smaller number The answer is the 1’s complement of the result and is opposite in sign. There is no carry.
2’s Complement Subtraction The 2’s complement of a binary number can be obtained by adding 1 to its 1’s complement.
Subtraction of a smaller number from a larger one by the 2’s complement method involves the following steps Steps  Determine the 2’s complement of the smaller number  Add this to the larger number  Omit the carry ( there is always a carry in this case )
Example of 2’s complement Subtract (1010)2 from (1111)2 2’s complement method Direct Subtraction 1   1   1   1 1   1   1   1 0   1   1   0 2’s complement 1   0   1   0 1 1  0 0 1 0 Carry 1 0 1
The carry is discarded. Thus answer is (0101)2 The 2’s complement  method for subtraction of a large number from a smaller one is as follows. Subtraction Steps Determine the 2’s complement of the larger number Add the 2’s complement to the smaller number There is no carry . The result is in 2’s complement form is negative To get an answer in true form, take the 2’s complement and change the sign.
Comparison between 1’s and 2’s complements
….. Thank You …… The End

Mais conteúdo relacionado

Mais procurados

Half adder & full adder
Half adder & full adderHalf adder & full adder
Half adder & full adderGaditek
 
Types of Addressing modes- COA
Types of Addressing modes- COATypes of Addressing modes- COA
Types of Addressing modes- COARuchi Maurya
 
Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes VandanaPagar1
 
Encoder & Decoder
Encoder & DecoderEncoder & Decoder
Encoder & DecoderSyed Saeed
 
BCD,GRAY and EXCESS 3 codes
BCD,GRAY and EXCESS 3 codesBCD,GRAY and EXCESS 3 codes
BCD,GRAY and EXCESS 3 codesstudent
 
Chapter 03 arithmetic for computers
Chapter 03   arithmetic for computersChapter 03   arithmetic for computers
Chapter 03 arithmetic for computersBảo Hoang
 
Decimal to binary number
Decimal to binary numberDecimal to binary number
Decimal to binary numberguestd8696a
 
What are Flip Flops and Its types.
What are Flip Flops and Its types.What are Flip Flops and Its types.
What are Flip Flops and Its types.Satya P. Joshi
 
De Morgan Theorem B[1]
De Morgan Theorem B[1]De Morgan Theorem B[1]
De Morgan Theorem B[1]Mr. Bullerman
 
binary number system
 binary number system binary number system
binary number systemvishal gupta
 
Error detection & correction codes
Error detection & correction codesError detection & correction codes
Error detection & correction codesRevathi Subramaniam
 
Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital ElectronicsJanki Shah
 

Mais procurados (20)

Half adder & full adder
Half adder & full adderHalf adder & full adder
Half adder & full adder
 
Types of Addressing modes- COA
Types of Addressing modes- COATypes of Addressing modes- COA
Types of Addressing modes- COA
 
Complements
ComplementsComplements
Complements
 
Two’s complement
Two’s complementTwo’s complement
Two’s complement
 
Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes
 
Encoder & Decoder
Encoder & DecoderEncoder & Decoder
Encoder & Decoder
 
BCD,GRAY and EXCESS 3 codes
BCD,GRAY and EXCESS 3 codesBCD,GRAY and EXCESS 3 codes
BCD,GRAY and EXCESS 3 codes
 
Chapter 03 arithmetic for computers
Chapter 03   arithmetic for computersChapter 03   arithmetic for computers
Chapter 03 arithmetic for computers
 
Decimal to binary number
Decimal to binary numberDecimal to binary number
Decimal to binary number
 
What are Flip Flops and Its types.
What are Flip Flops and Its types.What are Flip Flops and Its types.
What are Flip Flops and Its types.
 
Subtractor
SubtractorSubtractor
Subtractor
 
Counters
CountersCounters
Counters
 
Bcd
BcdBcd
Bcd
 
Number Systems
Number SystemsNumber Systems
Number Systems
 
De Morgan Theorem B[1]
De Morgan Theorem B[1]De Morgan Theorem B[1]
De Morgan Theorem B[1]
 
binary number system
 binary number system binary number system
binary number system
 
Error detection & correction codes
Error detection & correction codesError detection & correction codes
Error detection & correction codes
 
Binary arithmetic
Binary arithmeticBinary arithmetic
Binary arithmetic
 
Logic gates
Logic gatesLogic gates
Logic gates
 
Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital Electronics
 

Semelhante a 1s and 2s complement

1's and 2's complement.pptx
1's and 2's complement.pptx1's and 2's complement.pptx
1's and 2's complement.pptxHKShab
 
1sand2scomplement r004
1sand2scomplement  r0041sand2scomplement  r004
1sand2scomplement r004arunachalamr16
 
1sand2scomplement.pptx
1sand2scomplement.pptx1sand2scomplement.pptx
1sand2scomplement.pptxHKShab
 
558196807-1-s-and-2-s-complement-Lecture-3.ppt
558196807-1-s-and-2-s-complement-Lecture-3.ppt558196807-1-s-and-2-s-complement-Lecture-3.ppt
558196807-1-s-and-2-s-complement-Lecture-3.pptEMMANUEL932242
 
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...Arti Parab Academics
 
binary arithmetic rules
binary arithmetic rulesbinary arithmetic rules
binary arithmetic rulesstudent
 
L3 ARITHMETIC OPERATIONS.pptx
L3 ARITHMETIC OPERATIONS.pptxL3 ARITHMETIC OPERATIONS.pptx
L3 ARITHMETIC OPERATIONS.pptxHarish257692
 
B sc3 unit 2 number system
B sc3  unit 2 number systemB sc3  unit 2 number system
B sc3 unit 2 number systemMahiboobAliMulla
 
Number system
Number systemNumber system
Number systemaviban
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representationgavhays
 
Binaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesBinaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesDr. Anita Goel
 
Digital logic design lecture 02
Digital logic design   lecture 02 Digital logic design   lecture 02
Digital logic design lecture 02 FarhatUllah27
 

Semelhante a 1s and 2s complement (20)

1sand2scomplement.pdf
1sand2scomplement.pdf1sand2scomplement.pdf
1sand2scomplement.pdf
 
1's and 2's complement.pptx
1's and 2's complement.pptx1's and 2's complement.pptx
1's and 2's complement.pptx
 
1sand2scomplement r004
1sand2scomplement  r0041sand2scomplement  r004
1sand2scomplement r004
 
1sand2scomplement.pptx
1sand2scomplement.pptx1sand2scomplement.pptx
1sand2scomplement.pptx
 
unit-2_DL.pdf
unit-2_DL.pdfunit-2_DL.pdf
unit-2_DL.pdf
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
 
Arithmetic Logic
Arithmetic LogicArithmetic Logic
Arithmetic Logic
 
2's complement
2's complement2's complement
2's complement
 
558196807-1-s-and-2-s-complement-Lecture-3.ppt
558196807-1-s-and-2-s-complement-Lecture-3.ppt558196807-1-s-and-2-s-complement-Lecture-3.ppt
558196807-1-s-and-2-s-complement-Lecture-3.ppt
 
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
 
binary arithmetic rules
binary arithmetic rulesbinary arithmetic rules
binary arithmetic rules
 
L3 ARITHMETIC OPERATIONS.pptx
L3 ARITHMETIC OPERATIONS.pptxL3 ARITHMETIC OPERATIONS.pptx
L3 ARITHMETIC OPERATIONS.pptx
 
B sc3 unit 2 number system
B sc3  unit 2 number systemB sc3  unit 2 number system
B sc3 unit 2 number system
 
Number system
Number systemNumber system
Number system
 
B sc ii sem unit 2(a) ns
B sc ii sem  unit 2(a) nsB sc ii sem  unit 2(a) ns
B sc ii sem unit 2(a) ns
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representation
 
ch2.pdf
ch2.pdfch2.pdf
ch2.pdf
 
Binaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesBinaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemes
 
CA UNIT II.pptx
CA UNIT II.pptxCA UNIT II.pptx
CA UNIT II.pptx
 
Digital logic design lecture 02
Digital logic design   lecture 02 Digital logic design   lecture 02
Digital logic design lecture 02
 

Mais de Then Murugeshwari (20)

Traffic safety
Traffic safetyTraffic safety
Traffic safety
 
P h indicators
P h indicatorsP h indicators
P h indicators
 
Avogadro's law
Avogadro's lawAvogadro's law
Avogadro's law
 
Resonance
ResonanceResonance
Resonance
 
Microwave remote sensing
Microwave remote sensingMicrowave remote sensing
Microwave remote sensing
 
Newton's law
Newton's lawNewton's law
Newton's law
 
Surface tension
Surface tensionSurface tension
Surface tension
 
Hook's law
Hook's lawHook's law
Hook's law
 
Hook's law
Hook's lawHook's law
Hook's law
 
ERP components
ERP componentsERP components
ERP components
 
Database fundamentals
Database fundamentalsDatabase fundamentals
Database fundamentals
 
Mosfet
MosfetMosfet
Mosfet
 
Operators
OperatorsOperators
Operators
 
Hiperlan
HiperlanHiperlan
Hiperlan
 
Bluetooth profile
Bluetooth profileBluetooth profile
Bluetooth profile
 
Router
RouterRouter
Router
 
Operators in java
Operators in javaOperators in java
Operators in java
 
Thread priorities
Thread prioritiesThread priorities
Thread priorities
 
Threads
ThreadsThreads
Threads
 
Identifiers
Identifiers Identifiers
Identifiers
 

1s and 2s complement

  • 1. 1’s and 2’s Complements
  • 2. Subtraction of a number from another can be accomplished by adding the complement of the subtrahend to the minuend. Introduction
  • 3. 1’s Complement Subtraction Subtraction of binary numbers using the 1’s complement method allows subtraction only by addition.
  • 4. The 1’s complement of a binary number can be obtained by changing all 1s to 0s and all 0s and 1s. Cont.,
  • 5. To subtract a smaller number from a larger number, the 1’s complement method is as follows 1’s complement method Determine the 1’s complement of the smaller number. Add this to the larger number Remove the carry and add it to the result. This carry is called end-around-carry
  • 6. Subtract (1010)2 from (1111)2 Example of 1’s complement 1’s complement method Direct Subtraction 1 1 1 1 1’s complement 0 1 0 1 1 1 1 1 1 0 1 0 Carry 0 0 1 1 0 1 0 1 0 1 Add Carry 1 0 1 0
  • 7. Subtraction of a large number a smaller one by the 1’s complement method involves the following steps Subtraction Steps Determine the 1’s complement of a large number Add this to the smaller number The answer is the 1’s complement of the result and is opposite in sign. There is no carry.
  • 8. 2’s Complement Subtraction The 2’s complement of a binary number can be obtained by adding 1 to its 1’s complement.
  • 9. Subtraction of a smaller number from a larger one by the 2’s complement method involves the following steps Steps Determine the 2’s complement of the smaller number Add this to the larger number Omit the carry ( there is always a carry in this case )
  • 10. Example of 2’s complement Subtract (1010)2 from (1111)2 2’s complement method Direct Subtraction 1 1 1 1 1 1 1 1 0 1 1 0 2’s complement 1 0 1 0 1 1 0 0 1 0 Carry 1 0 1
  • 11. The carry is discarded. Thus answer is (0101)2 The 2’s complement method for subtraction of a large number from a smaller one is as follows. Subtraction Steps Determine the 2’s complement of the larger number Add the 2’s complement to the smaller number There is no carry . The result is in 2’s complement form is negative To get an answer in true form, take the 2’s complement and change the sign.
  • 12. Comparison between 1’s and 2’s complements
  • 13. ….. Thank You …… The End