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›Design of Subtractors
    Digital Logic DesignTopic 14 of 63

    Design of Subtractors

    7 minread
    1,184words
    Intermediatelevel

    Design of Subtractors in Digital Logic

    Subtractors are digital circuits used to subtract one binary number from another. Like adders, subtractors are essential components in arithmetic units (ALUs) of digital systems and processors. The basic operation of subtraction in binary involves borrowing, and subtractors are designed to handle this process.

    There are two main types of subtractors:

    1. Half Subtractor (HS)
    2. Full Subtractor (FS)

    We'll explore both types of subtractors in detail, along with their design and applications.


    1. Half Subtractor (HS)

    A half subtractor is the simplest subtractor circuit that subtracts two binary digits. It subtracts two single-bit numbers and produces two outputs:

    • Difference (D)
    • Borrow (B)

    A half subtractor does not take into account any borrow from a previous stage, hence the term "half."

    Truth Table for Half Subtractor:

    A B Difference (D) Borrow (B)
    0 0 0 0
    0 1 1 1
    1 0 1 0
    1 1 0 0

    Boolean Equations for Half Subtractor:

    • Difference: D=A⊕BD = A \oplus BD=A⊕B (XOR gate)
    • Borrow: B=¬A⋅BB = \neg A \cdot BB=¬A⋅B (AND gate)

    Circuit Diagram:

    • The difference is computed using an XOR gate, which outputs 1 when the inputs are different.
    • The borrow is computed using an AND gate, which outputs 1 when A is 0 and B is 1.

    2. Full Subtractor (FS)

    A full subtractor is a more general subtractor that can handle the subtraction of two binary digits with a borrow input. It subtracts three bits:

    • Two significant bits (A and B)
    • A borrow bit from the previous stage (Borrow_in, BinB_{in}Bin​)

    The full subtractor produces two outputs:

    • Difference (D)
    • Borrow_out (B_out)

    Truth Table for Full Subtractor:

    A B Borrow_in (Bin) Difference (D) Borrow_out (Bout)
    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

    Boolean Equations for Full Subtractor:

    • Difference: D=A⊕B⊕BinD = A \oplus B \oplus B_{in}D=A⊕B⊕Bin​ (XOR gate)
    • Borrow-out: Bout=¬A⋅B+(Bin⋅(A⊕B))B_{out} = \neg A \cdot B + (B_{in} \cdot (A \oplus B))Bout​=¬A⋅B+(Bin​⋅(A⊕B)) (AND and OR gates)

    Circuit Diagram:

    • The difference is calculated using two XOR gates: one for A⊕BA \oplus BA⊕B, and the second for (A⊕B)⊕Bin(A \oplus B) \oplus B_{in}(A⊕B)⊕Bin​.
    • The borrow-out is calculated using AND and OR gates based on the Boolean equation.

    Design Considerations for Subtractors:

    1. Handling Borrowing:

      • Subtractors must be able to handle the borrow process, which happens when the digit being subtracted is larger than the digit being subtracted from. The borrow is propagated to the next stage.
      • In the full subtractor, the borrow-out from the current stage becomes the borrow-in for the next stage.
    2. Difference Calculation:

      • The difference is typically calculated using an XOR gate since it naturally produces the result of a bitwise subtraction (considering borrow as a factor).
    3. Carry/Borrow Propagation:

      • Borrowing is a crucial aspect of binary subtraction. If a borrow is needed, it must be passed to the next lower bit.

    3. Binary Subtraction Using Borrowing (in Ripple Mode)

    In a multi-bit binary subtraction, we need to chain multiple full subtractors together. Each subtractor handles a pair of bits (from the two numbers being subtracted) and takes the borrow from the previous subtractor. This is similar to how a ripple carry adder works.

    Ripple Borrow Adder (Ripple Carry Subtractor):

    For an nnn-bit subtraction:

    1. You need n full subtractors.
    2. The borrow-out of each subtractor is fed into the borrow-in of the next subtractor.

    This process is known as ripple borrowing because the borrow bit ripples through all stages from the least significant bit to the most significant bit.

    Example for 4-bit Subtraction:

    If we want to subtract two 4-bit binary numbers A3A2A1A0A_3 A_2 A_1 A_0A3​A2​A1​A0​ and B3B2B1B0B_3 B_2 B_1 B_0B3​B2​B1​B0​, we would use four full subtractors:

    • Full subtractor 1: A0A_0A0​, B0B_0B0​, Bin0B_{in0}Bin0​ → Difference D0D_0D0​, Borrow B1B_1B1​
    • Full subtractor 2: A1A_1A1​, B1B_1B1​, B1B_1B1​ → Difference D1D_1D1​, Borrow B2B_2B2​
    • Full subtractor 3: A2A_2A2​, B2B_2B2​, B2B_2B2​ → Difference D2D_2D2​, Borrow B3B_3B3​
    • Full subtractor 4: A3A_3A3​, B3B_3B3​, B3B_3B3​ → Difference D3D_3D3​, Borrow B4B_4B4​

    The final borrow-out (B4B_4B4​) will represent whether a borrow occurred from the most significant bit.


    4. Borrow Lookahead Adder (BLA)

    To speed up the operation of subtractors, borrow lookahead logic is sometimes used. Borrow lookahead subtractors use parallel logic to generate the borrow signal for all stages simultaneously, rather than waiting for the borrow to propagate through each stage. This significantly reduces the delay in multi-bit subtractions, just as carry lookahead adders reduce delay in multi-bit additions.


    Applications of Subtractors:

    1. Arithmetic Logic Units (ALUs): Subtractors are essential components of ALUs, which perform arithmetic operations like addition, subtraction, and comparison in processors.

    2. Digital Signal Processing (DSP): Subtractors are used in DSP systems for signal manipulation, especially when performing operations like filtering or image processing.

    3. Binary Counters: Subtractors are used in digital counters and timers, where counting down is necessary.

    4. Control Systems: Subtractors are used in control systems for error detection and correction, where the difference between expected and actual values is important.


    Conclusion:

    Subtractors are fundamental circuits in digital systems, used to perform binary subtraction. From the simple half subtractor to the more complex full subtractor and borrow lookahead techniques, subtractors are essential for various applications, including processors, ALUs, and DSP systems. Understanding the design and operation of subtractors is crucial for building efficient arithmetic circuits in digital systems.

    Previous topic 13
    Design of Adders
    Next topic 15
    Code Convertors

    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 time7 min
      Word count1,184
      Code examples0
      DifficultyIntermediate