ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    Digital Logic Design
    CC-110
    Progress0 / 63 topics
    Topics
    1. Introduction to Digital Systems2. Number Systems3. Introduction to Boolean Algebra4. Basic theorems and properties of Boolean Algebra5. Boolean Functions6. Logic Gates7. NAND and NOR Implementation8. Representation of Function in Sum of Minterms or Product of Maxterms9. Simplification of Boolean function using Karnaugh Map10. Don't care Conditions11. The Tabulation Method12. Introduction to Combinational Logic13. Design of Adders14. Design of Subtractors15. Code Convertors16. Analysis Procedure of Combinational Circuits17. Binary Parallel Adders18. Decimal Adders19. Magnitude Comparator20. Decoders and its applications21. Multiplexers22. Demultiplexers23. Encoders24. ROM25. Programmable Logic Array (PLA)26. Introduction to Sequential Circuits27. Basic Flip Flop28. Clocked RS Flip Flop29. Clocked D Flip Flop30. Clocked JK Flip Flop31. Clocked T Flip Flop32. Analysis of Clocked Sequential Circuits33. State Reduction and Assignment34. Flip Flop Excitation tables35. Design Procedure36. Design of Counters37. Design with State Equations38. Introduction to Registers39. Shift Registers40. Ripple Counters41. Synchronous Counters42. Timing Sequences43. Memory Unit44. Random Access Memory45. Introduction to Programmable Logic Devices (CPLD, FPGA)46. Lab Assignments using tools such as Verilog HDL/VHDL, MultiSim47. Familiarization with Digital Electronic Trainer48. Logic gates operations49. Half Adder Operation50. Full Adder Operation51. Half Subtractor Operation52. Full Subtractor Operation53. 7-Segment Display Operation54. Decoder Operation55. BCD To 7-Segment Display56. Multiplexer Operation57. Using Multiplexer and Demultiplexer/Decoder58. Multiplexing 7-Segment Displays59. Comparator Operations60. D Latch and Flip-Flop Operation61. Latching BCD Data for Displaying On 7-Segment Display62. JK Flip-Flop Operation63. Random Access Memories
    CC-110›Full Subtractor Operation
    Digital Logic DesignTopic 52 of 63

    Full Subtractor Operation

    9 minread
    1,489words
    Intermediatelevel

    Full Subtractor Operation

    A Full Subtractor is a digital circuit that performs the subtraction of three binary bits: two significant bits and a borrow-in bit (from a previous subtraction). It is an extension of the Half Subtractor, which can only subtract two bits and does not handle a borrow-in input. The Full Subtractor takes into account the borrow from previous stages of subtraction and produces two outputs: the Difference (D) and the Borrow-out (B_out).


    Inputs and Outputs of a Full Subtractor

    • Inputs:

      • A: The minuend (the bit from which we subtract).
      • B: The subtrahend (the bit that we subtract).
      • Borrow-in (B_in): The borrow bit from a previous subtraction (if any).
    • Outputs:

      • Difference (D): The result of the subtraction of A, B, and Borrow-in.
      • Borrow-out (B_out): The borrow bit that indicates whether a borrow is needed when subtracting (i.e., if A - B - Borrow-in results in a negative number).

    Truth Table of a Full Subtractor

    The Full Subtractor performs binary subtraction based on the following truth table:

    A B Borrow-in (B_in) Difference (D) Borrow-out (B_out)
    0 0 0 0 0
    0 0 1 1 1
    0 1 0 1 1
    0 1 1 0 1
    1 0 0 1 0
    1 0 1 0 0
    1 1 0 0 0
    1 1 1 1 0

    Explanation of the Truth Table:

    • When A = 0, B = 0, and Borrow-in = 0:
      The Difference (D) is 0, and there is no borrow, so Borrow-out = 0.

    • When A = 0, B = 0, and Borrow-in = 1:
      The Difference (D) is 1, and there is a borrow, so Borrow-out = 1.

    • When A = 0, B = 1, and Borrow-in = 0:
      The Difference (D) is 1, and there is a borrow, so Borrow-out = 1.

    • When A = 0, B = 1, and Borrow-in = 1:
      The Difference (D) is 0, and there is a borrow, so Borrow-out = 1.

    • When A = 1, B = 0, and Borrow-in = 0:
      The Difference (D) is 1, and there is no borrow, so Borrow-out = 0.

    • When A = 1, B = 0, and Borrow-in = 1:
      The Difference (D) is 0, and there is no borrow, so Borrow-out = 0.

    • When A = 1, B = 1, and Borrow-in = 0:
      The Difference (D) is 0, and there is no borrow, so Borrow-out = 0.

    • When A = 1, B = 1, and Borrow-in = 1:
      The Difference (D) is 1, and there is no borrow, so Borrow-out = 0.


    Boolean Equations for Difference and Borrow-out

    The outputs of the Full Subtractor can be expressed using Boolean algebra as follows:

    1. Difference (D):

      • The Difference output is equivalent to the XOR of the three input bits A, B, and Borrow-in.
      D=A⊕B⊕BinD = A \oplus B \oplus B_{\text{in}}D=A⊕B⊕Bin​

      This equation shows that the difference is 1 when an odd number of the inputs (A, B, and B_in) are 1.

    2. Borrow-out (B_out):

      • The Borrow-out output is 1 if a borrow is required from previous stages. The borrow condition occurs when B and Borrow-in are 1, or when A is less than B (and possibly needs a borrow).
      Bout=(A‾⋅B)+(A‾⋅Bin)+(B⋅Bin)B_{\text{out}} = (\overline{A} \cdot B) + (\overline{A} \cdot B_{\text{in}}) + (B \cdot B_{\text{in}})Bout​=(A⋅B)+(A⋅Bin​)+(B⋅Bin​)

      This equation indicates that a borrow occurs if:

      • A = 0 and B = 1, or
      • A = 0 and Borrow-in = 1, or
      • B = 1 and Borrow-in = 1.

    Logic Gate Implementation of Full Subtractor

    The Full Subtractor can be implemented using a combination of XOR, AND, and OR gates:

    1. Difference (D):

      • First, XOR the inputs A and B: Temp1=A⊕B\text{Temp1} = A \oplus BTemp1=A⊕B
      • Then, XOR Temp1 with Borrow-in to get the final Difference (D): D=Temp1⊕BinD = \text{Temp1} \oplus B_{\text{in}}D=Temp1⊕Bin​
    2. Borrow-out (B_out):

      • Use AND gates and OR gates to calculate the borrow:
        • AND NOT A and B: A‾⋅B\overline{A} \cdot BA⋅B
        • AND NOT A and Borrow-in: A‾⋅Bin\overline{A} \cdot B_{\text{in}}A⋅Bin​
        • AND B and Borrow-in: B⋅BinB \cdot B_{\text{in}}B⋅Bin​
      • Finally, OR the results to produce Borrow-out: Bout=(A‾⋅B)+(A‾⋅Bin)+(B⋅Bin)B_{\text{out}} = (\overline{A} \cdot B) + (\overline{A} \cdot B_{\text{in}}) + (B \cdot B_{\text{in}})Bout​=(A⋅B)+(A⋅Bin​)+(B⋅Bin​)

    Circuit Diagram:

    • The XOR gates calculate the Difference.
    • The AND gates and OR gates calculate the Borrow-out.

    Full Subtractor Example

    Let’s walk through an example to better understand how the Full Subtractor works.

    Example 1:

    • Inputs: A = 1, B = 0, Borrow-in = 1
      • Difference (D): D=A⊕B⊕Bin=1⊕0⊕1=0D = A \oplus B \oplus B_{\text{in}} = 1 \oplus 0 \oplus 1 = 0D=A⊕B⊕Bin​=1⊕0⊕1=0
      • Borrow-out (B_out): Bout=(A‾⋅B)+(A‾⋅Bin)+(B⋅Bin)=(0⋅0)+(0⋅1)+(0⋅1)=0B_{\text{out}} = (\overline{A} \cdot B) + (\overline{A} \cdot B_{\text{in}}) + (B \cdot B_{\text{in}}) = (0 \cdot 0) + (0 \cdot 1) + (0 \cdot 1) = 0Bout​=(A⋅B)+(A⋅Bin​)+(B⋅Bin​)=(0⋅0)+(0⋅1)+(0⋅1)=0
      • Result: Difference = 0, Borrow-out = 0

    Example 2:

    • Inputs: A = 0, B = 1, Borrow-in = 1
      • Difference (D): D=A⊕B⊕Bin=0⊕1⊕1=0D = A \oplus B \oplus B_{\text{in}} = 0 \oplus 1 \oplus 1 = 0D=A⊕B⊕Bin​=0⊕1⊕1=0
      • Borrow-out (B_out): Bout=(A‾⋅B)+(A‾⋅Bin)+(B⋅Bin)=(1⋅1)+(1⋅1)+(1⋅1)=1B_{\text{out}} = (\overline{A} \cdot B) + (\overline{A} \cdot B_{\text{in}}) + (B \cdot B_{\text{in}}) = (1 \cdot 1) + (1 \cdot 1) + (1 \cdot 1) = 1Bout​=(A⋅B)+(A⋅Bin​)+(B⋅Bin​)=(1⋅1)+(1⋅1)+(1⋅1)=1
      • Result: Difference = 0, Borrow-out = 1

    Applications of Full Subtractor

    1. Multi-bit Subtraction:

      • Full subtractors are used in multi-bit binary subtractors. By chaining Full Subtractors together, subtraction of multi-bit numbers can be achieved, much like in addition circuits.
    2. Arithmetic Logic Units (ALUs):

      • Full Subtractors are part of ALUs in processors, where they perform subtraction operations in addition to other arithmetic and logic operations.
    3. Digital Signal Processing:

      • Full Subtractors are used in applications like signal comparison, error detection, and digital filters, where binary subtraction is necessary.
    4. Counters and Digital Systems:

      • Full Subtractors are useful in digital counters, data comparison systems, and systems requiring binary subtraction with carry/borrow handling.

    Conclusion

    The Full Subtractor is a crucial component in digital electronics that allows the subtraction of three binary digits: two significant bits and a borrow-in. It produces two outputs: the Difference and the Borrow-out. The Full Subtractor is used in multi-bit binary subtraction circuits, Arithmetic Logic Units (ALUs), and many other digital systems, where handling borrow conditions from previous operations is essential for accurate subtraction.

    Previous topic 51
    Half Subtractor Operation
    Next topic 53
    7-Segment Display Operation

    Past Papers

    Open this section to load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time9 min
      Word count1,489
      Code examples0
      DifficultyIntermediate