SlideShare a Scribd company logo
1 of 25
KL 2164
DIGITAL ELECTRONICS
ADDER / SUBSTRACTER
              Pn. Wan Nurdiana Wan Ibrahim
                      nurdiana@eng.ukm.my
Contents

Half Adder
Full Adder
Subtracter




             2
Adder
The result of adding two binary digits could produce a carry value
Recall that 1 + 1 = 10
in base two

Half adder
A circuit that computes the sum of two bits
and produces the correct carry bit

Full Adder
A circuit that takes the carry-in value into account




                                                                     3
Contents

Half Adder
Full Adder
Subtracter




             4
Example of 1-bit Adder

Design a simple binary adder that adds two 1-bit binary
numbers, a and b, to give a 2-bit sum. The numeric
values for the adder inputs and outputs are as follows:




                                                          5
Represent inputs to the adder by the logic
   variables A and B and the 2-bit sum by the logic
   variables X and Y, and the truth table:




Because a numeric value of 0 is represented by a logic
0 and a numeric value of 1 by a logic 1, the 0’s and 1’s
in the truth table are exactly the same as in the previous
table.
Boolean expression :



                                                             6
Half Adder




 Circuit diagram representing a half adder
 Boolean expressions
     sum = A B
     carry = AB
                                              7
2-bits Binary Adder

Design an adder which adds two 2-bit binary
numbers to give a 3-bit binary sum. Find the truth
table for the circuit. The circuit has four inputs and
three outputs as shown:




                                                         8
9
Contents

Half Adder
Full Adder
Subtracter




             10
Full Adder

The logic equations for the full adder
derived from the truth table are:
     (X=A & Y = B)




                                         11
Implementation of Full Adder




                               12
Design of Binary Adders and Subtracters


    Design a parallel adder that adds two
    4-bit unsigned binary numbers and a
    carry input to give a 4-bit sum and a
    carry output.




                                            13
Parallel Adder for 4-Bit Binary Numbers




                                          14
One approach would be to construct a truth
table with nine inputs and five outputs and
then derive and simplify the five output
equations.


A better method is to design a logic module
that adds two bits and a carry, and then
connect four of these modules together to
form a 4-bit adder.


                                              15
Parallel Adder Composed of Four Full
Adders
    Example : 1011+ 1011 = ?




                                       16
One’s complement addition
     To add one’s complement numbers:
      ◦ First do unsigned addition on the numbers, including the sign bits.
      ◦ Then take the carry out and add it to the sum.
     Two examples:

    0111      (+7)                            0011       (+3)
+   1011    + (-4)                        +   0010     + (+2)
  1 0010                                    0 0101

   0010                                        0101
 +    1                                      +    0
   0011       (+3)                             0101       (+5)
     This is simpler and more uniform than signed magnitude
      addition.


                                                                              17
Two’s complement addition
 Negating a two’s complement number takes a bit of work, but
  addition is much easier than with the other two systems.
 To find A + B, you just have to:
    ◦ Do unsigned addition on A and B, including their sign bits.
    ◦ Ignore any carry out.
   For example, to find 0111 + 1100, or (+7) + (-4):
    ◦ First add 0111 + 1100 as unsigned numbers:

                  01 1 1
               + 1 1 00
                1 001 1
    ◦ Discard the carry out (1).
    ◦ The answer is 0011 (+3).



                                                                    18
Unsigned numbers overflow
 Carry-out can be used to detect overflow
 The largest number that we can represent with 4-bits
  using unsigned numbers is 15
 Suppose that we are adding 4-bit numbers: 9 (1001) and
  10 (1010).

            1 001    (9)
         + 1 0 10   (10)
          1 001 1   (19)



   The value 19 cannot be represented with 4-bits
   When operating with unsigned numbers, a carry-out of
    1 can be used to indicate overflow
                                                           19
Overflow for Signed Binary Numbers
An overflow has occurred if adding two numbers gives a negative result
or adding two negative numbers gives a positive result.
• Negative number  in compliment form
define an overflow signal, V = 1 if an overflow occurs.
V = A3′B3′S3 + A3B3S3′




                                                                         20
Contents

Half Adder
Full Adder
Subtracter




             21
Binary Subtracter Using Full Adders

  Full Adders may be used to form A – B using the 2’s complement
  representation for negative numbers. The 2’s complement of B can be
  formed by first finding the 1’s complement and then adding 1.




                                                                        22
Parallel Subtracter
  Alternatively, direct subtraction can be
  accomplished by employing a full subtracter in a
  manner analogous to a full adder.




d = difference
bi = borrow
                                                     23
Consider xi = 0, yi = 1, and bi = 1:




Step 1 : (if b=1) X= Xi – 1= 0 – 1 Need to borrow from column i+1
                                    bi+1 =1 & adding 10 (210) to Xi
Step 2 : X = 10 – 1 = 1
Step 3 : X -Y = 1 – 1  d = 0


                                                                       24
Truth Table for Binary Full Subtracter




                                         25

More Related Content

What's hot

Comparators in DLD.
Comparators in DLD.Comparators in DLD.
Comparators in DLD.Zain Jafri
 
Design half ,full Adder and Subtractor
Design half ,full Adder and SubtractorDesign half ,full Adder and Subtractor
Design half ,full Adder and SubtractorJaimin@prt.ltd.
 
Combinational circuits
Combinational circuits Combinational circuits
Combinational circuits DrSonali Vyas
 
1.ripple carry adder, full adder implementation using half adder.
1.ripple carry adder, full adder implementation using half adder.1.ripple carry adder, full adder implementation using half adder.
1.ripple carry adder, full adder implementation using half adder.MdFazleRabbi18
 
Digital and logic designs presentation
Digital and logic designs presentationDigital and logic designs presentation
Digital and logic designs presentationHaya Butt
 
decoder and encoder
 decoder and encoder decoder and encoder
decoder and encoderUnsa Shakir
 
Digital electronics logic families
Digital electronics logic familiesDigital electronics logic families
Digital electronics logic familiesBLESSINAR0
 
Digital logic gate and its application
Digital logic gate and its applicationDigital logic gate and its application
Digital logic gate and its applicationAbdullah Al Masud
 
Decoders
DecodersDecoders
DecodersRe Man
 
JK flip flop in Digital electronics
JK flip flop in Digital electronicsJK flip flop in Digital electronics
JK flip flop in Digital electronicsEasy n Inspire L
 
Adder Presentation
Adder PresentationAdder Presentation
Adder PresentationMoeez Ahmad
 
Encoder and decoder
Encoder and decoderEncoder and decoder
Encoder and decoderAbid Ali
 

What's hot (20)

Comparators in DLD.
Comparators in DLD.Comparators in DLD.
Comparators in DLD.
 
Design half ,full Adder and Subtractor
Design half ,full Adder and SubtractorDesign half ,full Adder and Subtractor
Design half ,full Adder and Subtractor
 
Combinational circuits
Combinational circuits Combinational circuits
Combinational circuits
 
Adder ppt
Adder pptAdder ppt
Adder ppt
 
full subtractor
full subtractorfull subtractor
full subtractor
 
Subtractor
SubtractorSubtractor
Subtractor
 
Combinational circuit
Combinational circuitCombinational circuit
Combinational circuit
 
1.ripple carry adder, full adder implementation using half adder.
1.ripple carry adder, full adder implementation using half adder.1.ripple carry adder, full adder implementation using half adder.
1.ripple carry adder, full adder implementation using half adder.
 
Digital and logic designs presentation
Digital and logic designs presentationDigital and logic designs presentation
Digital and logic designs presentation
 
Parallel Adder
Parallel Adder Parallel Adder
Parallel Adder
 
decoder and encoder
 decoder and encoder decoder and encoder
decoder and encoder
 
Digital electronics logic families
Digital electronics logic familiesDigital electronics logic families
Digital electronics logic families
 
Half subtracter
Half subtracterHalf subtracter
Half subtracter
 
Digital logic gate and its application
Digital logic gate and its applicationDigital logic gate and its application
Digital logic gate and its application
 
Decoders
DecodersDecoders
Decoders
 
Subtractor (1)
Subtractor (1)Subtractor (1)
Subtractor (1)
 
JK flip flop in Digital electronics
JK flip flop in Digital electronicsJK flip flop in Digital electronics
JK flip flop in Digital electronics
 
Digital Logic Design
Digital Logic DesignDigital Logic Design
Digital Logic Design
 
Adder Presentation
Adder PresentationAdder Presentation
Adder Presentation
 
Encoder and decoder
Encoder and decoderEncoder and decoder
Encoder and decoder
 

Viewers also liked

Half adder and full adder
Half adder and full adderHalf adder and full adder
Half adder and full adderKamil Hussain
 
Digital Electronics( half adders and full adders)
Digital Electronics( half adders and full adders)Digital Electronics( half adders and full adders)
Digital Electronics( half adders and full adders)Bosa Theophilus Ntshole
 
Explain Half Adder and Full Adder with Truth Table
Explain Half Adder and Full Adder with Truth TableExplain Half Adder and Full Adder with Truth Table
Explain Half Adder and Full Adder with Truth Tableelprocus
 
Half Subtractor : Combiational Circuit
Half Subtractor : Combiational CircuitHalf Subtractor : Combiational Circuit
Half Subtractor : Combiational CircuitDoCircuits
 
Half adder & full adder
Half adder & full adderHalf adder & full adder
Half adder & full adderGaditek
 
logical circuits substractors
logical circuits substractors logical circuits substractors
logical circuits substractors Fâhém Ähmêd
 
Number System
Number SystemNumber System
Number Systemitutor
 
Multiplexer & de multiplexer
Multiplexer & de multiplexerMultiplexer & de multiplexer
Multiplexer & de multiplexervishalgohel12195
 
COMPUTER ORGANIZATION -Multiplexer,Demultiplexer, Encoder
COMPUTER ORGANIZATION -Multiplexer,Demultiplexer, EncoderCOMPUTER ORGANIZATION -Multiplexer,Demultiplexer, Encoder
COMPUTER ORGANIZATION -Multiplexer,Demultiplexer, EncoderVanitha Chandru
 
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational CircuitsCOMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational CircuitsVanitha Chandru
 
Cuentos 2008 De Cristian Carcamo
Cuentos 2008 De Cristian CarcamoCuentos 2008 De Cristian Carcamo
Cuentos 2008 De Cristian Carcamoguestefe2634
 
Mobile Security 7.0
Mobile Security 7.0Mobile Security 7.0
Mobile Security 7.0khaled sayed
 
Monogram Necklace by timeless jewelry collection
Monogram Necklace by timeless jewelry collectionMonogram Necklace by timeless jewelry collection
Monogram Necklace by timeless jewelry collectionTimeless Jewelry
 

Viewers also liked (20)

Half adder and full adder
Half adder and full adderHalf adder and full adder
Half adder and full adder
 
Digital Electronics( half adders and full adders)
Digital Electronics( half adders and full adders)Digital Electronics( half adders and full adders)
Digital Electronics( half adders and full adders)
 
Explain Half Adder and Full Adder with Truth Table
Explain Half Adder and Full Adder with Truth TableExplain Half Adder and Full Adder with Truth Table
Explain Half Adder and Full Adder with Truth Table
 
Half Subtractor : Combiational Circuit
Half Subtractor : Combiational CircuitHalf Subtractor : Combiational Circuit
Half Subtractor : Combiational Circuit
 
Half adder & full adder
Half adder & full adderHalf adder & full adder
Half adder & full adder
 
Adder Presentation
Adder PresentationAdder Presentation
Adder Presentation
 
Adders
AddersAdders
Adders
 
BCD ADDER
BCD ADDER BCD ADDER
BCD ADDER
 
Multiplexer
MultiplexerMultiplexer
Multiplexer
 
My Report on adders
My Report on addersMy Report on adders
My Report on adders
 
logical circuits substractors
logical circuits substractors logical circuits substractors
logical circuits substractors
 
Number System
Number SystemNumber System
Number System
 
Multiplexer & de multiplexer
Multiplexer & de multiplexerMultiplexer & de multiplexer
Multiplexer & de multiplexer
 
COMPUTER ORGANIZATION -Multiplexer,Demultiplexer, Encoder
COMPUTER ORGANIZATION -Multiplexer,Demultiplexer, EncoderCOMPUTER ORGANIZATION -Multiplexer,Demultiplexer, Encoder
COMPUTER ORGANIZATION -Multiplexer,Demultiplexer, Encoder
 
multiplexer and d-multiplexer
multiplexer and d-multiplexermultiplexer and d-multiplexer
multiplexer and d-multiplexer
 
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational CircuitsCOMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
 
Cuentos 2008 De Cristian Carcamo
Cuentos 2008 De Cristian CarcamoCuentos 2008 De Cristian Carcamo
Cuentos 2008 De Cristian Carcamo
 
Mobile Security 7.0
Mobile Security 7.0Mobile Security 7.0
Mobile Security 7.0
 
ENTERTAINMENT in TOKYO
ENTERTAINMENT in TOKYOENTERTAINMENT in TOKYO
ENTERTAINMENT in TOKYO
 
Monogram Necklace by timeless jewelry collection
Monogram Necklace by timeless jewelry collectionMonogram Necklace by timeless jewelry collection
Monogram Necklace by timeless jewelry collection
 

Similar to Adder substracter

Chapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfChapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfTamiratDejene1
 
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdfCDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdfshubhangisonawane6
 
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
 
Arithmatic Ch 10 (4).pdf
Arithmatic Ch 10 (4).pdfArithmatic Ch 10 (4).pdf
Arithmatic Ch 10 (4).pdfSahilSarda2
 
FYBSC IT Digital Electronics Unit III Chapter II Arithmetic Circuits
FYBSC IT Digital Electronics Unit III Chapter II Arithmetic CircuitsFYBSC IT Digital Electronics Unit III Chapter II Arithmetic Circuits
FYBSC IT Digital Electronics Unit III Chapter II Arithmetic CircuitsArti Parab Academics
 
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
 
Lecture 06 computer arithmatic
Lecture 06 computer arithmaticLecture 06 computer arithmatic
Lecture 06 computer arithmaticObaidur Rahman
 
W3 Chapter 2B Notes CCB1223 Digital Logic.pdf
W3 Chapter 2B Notes CCB1223 Digital Logic.pdfW3 Chapter 2B Notes CCB1223 Digital Logic.pdf
W3 Chapter 2B Notes CCB1223 Digital Logic.pdfMOHDZAMRIBINIBRAHIM1
 
Number system
Number systemNumber system
Number systemaviban
 
DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and BCD Add...
DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and  BCD Add...DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and  BCD Add...
DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and BCD Add...SaveraAyub2
 
module 1_class_numbers.pptx
module 1_class_numbers.pptxmodule 1_class_numbers.pptx
module 1_class_numbers.pptxssuser2efca7
 
Arithmetic logic units
Arithmetic logic unitsArithmetic logic units
Arithmetic logic unitsowaisahmad125
 

Similar to Adder substracter (20)

tCh10.ppt
tCh10.ppttCh10.ppt
tCh10.ppt
 
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
 
combinational-circuit (1).ppt
combinational-circuit (1).pptcombinational-circuit (1).ppt
combinational-circuit (1).ppt
 
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdfCDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
 
Binaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesBinaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemes
 
Arithmatic Ch 10 (4).pdf
Arithmatic Ch 10 (4).pdfArithmatic Ch 10 (4).pdf
Arithmatic Ch 10 (4).pdf
 
FYBSC IT Digital Electronics Unit III Chapter II Arithmetic Circuits
FYBSC IT Digital Electronics Unit III Chapter II Arithmetic CircuitsFYBSC IT Digital Electronics Unit III Chapter II Arithmetic Circuits
FYBSC IT Digital Electronics Unit III Chapter II Arithmetic Circuits
 
2's complement
2's complement2's complement
2's complement
 
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
 
Lecture 06 computer arithmatic
Lecture 06 computer arithmaticLecture 06 computer arithmatic
Lecture 06 computer arithmatic
 
ch2.pdf
ch2.pdfch2.pdf
ch2.pdf
 
W3 Chapter 2B Notes CCB1223 Digital Logic.pdf
W3 Chapter 2B Notes CCB1223 Digital Logic.pdfW3 Chapter 2B Notes CCB1223 Digital Logic.pdf
W3 Chapter 2B Notes CCB1223 Digital Logic.pdf
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
Number system
Number systemNumber system
Number system
 
CA UNIT II.pptx
CA UNIT II.pptxCA UNIT II.pptx
CA UNIT II.pptx
 
Representation of Negative Numbers
Representation of Negative NumbersRepresentation of Negative Numbers
Representation of Negative Numbers
 
DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and BCD Add...
DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and  BCD Add...DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and  BCD Add...
DLD Lecture No 20 Look Ahead Carry Generator, Binary Subtractors and BCD Add...
 
module 1_class_numbers.pptx
module 1_class_numbers.pptxmodule 1_class_numbers.pptx
module 1_class_numbers.pptx
 
Arithmetic logic units
Arithmetic logic unitsArithmetic logic units
Arithmetic logic units
 

Adder substracter

  • 1. KL 2164 DIGITAL ELECTRONICS ADDER / SUBSTRACTER Pn. Wan Nurdiana Wan Ibrahim nurdiana@eng.ukm.my
  • 3. Adder The result of adding two binary digits could produce a carry value Recall that 1 + 1 = 10 in base two Half adder A circuit that computes the sum of two bits and produces the correct carry bit Full Adder A circuit that takes the carry-in value into account 3
  • 5. Example of 1-bit Adder Design a simple binary adder that adds two 1-bit binary numbers, a and b, to give a 2-bit sum. The numeric values for the adder inputs and outputs are as follows: 5
  • 6. Represent inputs to the adder by the logic variables A and B and the 2-bit sum by the logic variables X and Y, and the truth table: Because a numeric value of 0 is represented by a logic 0 and a numeric value of 1 by a logic 1, the 0’s and 1’s in the truth table are exactly the same as in the previous table. Boolean expression : 6
  • 7. Half Adder  Circuit diagram representing a half adder  Boolean expressions sum = A B carry = AB 7
  • 8. 2-bits Binary Adder Design an adder which adds two 2-bit binary numbers to give a 3-bit binary sum. Find the truth table for the circuit. The circuit has four inputs and three outputs as shown: 8
  • 9. 9
  • 11. Full Adder The logic equations for the full adder derived from the truth table are: (X=A & Y = B) 11
  • 13. Design of Binary Adders and Subtracters Design a parallel adder that adds two 4-bit unsigned binary numbers and a carry input to give a 4-bit sum and a carry output. 13
  • 14. Parallel Adder for 4-Bit Binary Numbers 14
  • 15. One approach would be to construct a truth table with nine inputs and five outputs and then derive and simplify the five output equations. A better method is to design a logic module that adds two bits and a carry, and then connect four of these modules together to form a 4-bit adder. 15
  • 16. Parallel Adder Composed of Four Full Adders Example : 1011+ 1011 = ? 16
  • 17. One’s complement addition  To add one’s complement numbers: ◦ First do unsigned addition on the numbers, including the sign bits. ◦ Then take the carry out and add it to the sum.  Two examples: 0111 (+7) 0011 (+3) + 1011 + (-4) + 0010 + (+2) 1 0010 0 0101 0010 0101 + 1 + 0 0011 (+3) 0101 (+5)  This is simpler and more uniform than signed magnitude addition. 17
  • 18. Two’s complement addition  Negating a two’s complement number takes a bit of work, but addition is much easier than with the other two systems.  To find A + B, you just have to: ◦ Do unsigned addition on A and B, including their sign bits. ◦ Ignore any carry out.  For example, to find 0111 + 1100, or (+7) + (-4): ◦ First add 0111 + 1100 as unsigned numbers: 01 1 1 + 1 1 00 1 001 1 ◦ Discard the carry out (1). ◦ The answer is 0011 (+3). 18
  • 19. Unsigned numbers overflow  Carry-out can be used to detect overflow  The largest number that we can represent with 4-bits using unsigned numbers is 15  Suppose that we are adding 4-bit numbers: 9 (1001) and 10 (1010). 1 001 (9) + 1 0 10 (10) 1 001 1 (19)  The value 19 cannot be represented with 4-bits  When operating with unsigned numbers, a carry-out of 1 can be used to indicate overflow 19
  • 20. Overflow for Signed Binary Numbers An overflow has occurred if adding two numbers gives a negative result or adding two negative numbers gives a positive result. • Negative number  in compliment form define an overflow signal, V = 1 if an overflow occurs. V = A3′B3′S3 + A3B3S3′ 20
  • 22. Binary Subtracter Using Full Adders Full Adders may be used to form A – B using the 2’s complement representation for negative numbers. The 2’s complement of B can be formed by first finding the 1’s complement and then adding 1. 22
  • 23. Parallel Subtracter Alternatively, direct subtraction can be accomplished by employing a full subtracter in a manner analogous to a full adder. d = difference bi = borrow 23
  • 24. Consider xi = 0, yi = 1, and bi = 1: Step 1 : (if b=1) X= Xi – 1= 0 – 1 Need to borrow from column i+1  bi+1 =1 & adding 10 (210) to Xi Step 2 : X = 10 – 1 = 1 Step 3 : X -Y = 1 – 1  d = 0 24
  • 25. Truth Table for Binary Full Subtracter 25