The Wayback Machine - https://web.archive.org/web/20240723130013/https://www.geeksforgeeks.org/full-subtractor-in-digital-logic/
Open In App

Full Subtractor in Digital Logic

Last Updated : 13 May, 2023
Improve
Suggest changes
Post a comment
Like Article
Like
Save
Share
Report

A full subtractor is a combinational circuit that performs subtraction of two bits, one is minuend and other is subtrahend, taking into account borrow of the previous adjacent lower minuend bit. This circuit has three inputs and two outputs. The three inputs A, B and Bin, denote the minuend, subtrahend, and previous borrow, respectively. The two outputs, D and Bout represent the difference and output borrow, respectively. Although subtraction is usually achieved by adding the complement of subtrahend to the minuend, it is of academic interest to work out the Truth Table and logic realisation of a full subtractor; x is the minuend; y is the subtrahend; z is the input borrow; D is the difference; and B denotes the output borrow. The corresponding maps for logic functions for outputs of the full subtractor namely difference and borrow.

  

Here’s how a full subtractor works:

1. First, we need to convert the binary numbers to their two’s complement form if we are subtracting a negative number.
2. Next, we compare the bits in the minuend and subtrahend at the corresponding positions. If the subtrahend bit is greater than or equal to the minuend bit, we need to borrow from the previous stage (if there is one) to subtract the subtrahend bit from the minuend bit.
3. We subtract the two bits along with the borrow-in to get the difference bit. If the minuend bit is greater than or equal to the subtrahend bit along with the borrow-in, then the difference bit is 1, otherwise it is 0.
4. We then calculate the borrow-out bit by comparing the minuend and subtrahend bits. If the minuend bit is less than the subtrahend bit along with the borrow-in, then we need to borrow for the next stage, so the borrow-out bit is 1, otherwise it is 0.

The circuit diagram for a full subtractor usually consists of two half-subtractors and an additional OR gate to calculate the borrow-out bit. The inputs and outputs of the full subtractor are as follows:

Inputs:

A: minuend bit
B: subtrahend bit
Bin: borrow-in bit from the previous stage
Outputs:

Diff: difference bit
Bout: borrow-out bit for the next stage

Truth Table –

  

From above table we can draw the K-Map as shown for “difference” and “borrow”.  

Logical expression for difference –

D   = A’B’Bin + A’BBin’ + AB’Bin’ + ABBin
    = Bin(A’B’ + AB)  + Bin’(AB’ + A’B)
    = Bin( A XNOR B) + Bin’(A XOR B)
    = Bin (A XOR B)’  +  Bin’(A XOR B)
    = Bin XOR (A XOR B)
    = (A XOR B) XOR Bin

Logical expression for borrow –

Bout = A’B’Bin + A’BBin’ + A’BBin + ABBin      
     = A’B’Bin +A’BBin’ + A’BBin + A’BBin + A’BBin + ABBin
     = A’Bin(B + B’) + A’B(Bin + Bin’) + BBin(A + A’)
     = A’Bin + A’B + BBin

OR

Bout = A’B’Bin + A’BBin’ + A’BBin + ABBin      
     = Bin(AB + A’B’) + A’B(Bin + Bin’)
     = Bin( A XNOR B) + A’B
     = Bin (A XOR B)’ + A’B

Logic Circuit for Full Subtractor –

  

Implementation of Full Subtractor using Half Subtractors – 2 Half Subtractors and an OR gate is required to implement a Full Subtractor.

  


Previous Article
Next Article

Similar Reads

Half Subtractor in Digital Logic
A half subtractor is a digital logic circuit that performs binary subtraction of two single-bit binary numbers. It has two inputs, A and B, and two outputs, DIFFERENCE and BORROW. The DIFFERENCE output is the difference between the two input bits, while the BORROW output indicates whether borrowing was necessary during the subtraction. The half sub
3 min read
Python Program to implement Full Subtractor
Prerequisite -Full Subtractor in Digital Logic In this, we will discuss the overview of the full subtractor and will implement the full subtractor logic in the python language. Also, we will cover with the help of examples. Let's discuss it one by one. Given three inputs of Full Subtractor A, B, Bin. The task is to implement the Full Subtractor cir
4 min read
C++ program to implement full subtractor
Prerequisite : Full SubtractorGiven three inputs of Full Subtractor A, B, Bin. The task is to implement the Full Subtractor circuit and Print output states difference (D) and Bout of three inputs. Introduction :The full subtractor is used to subtract three 1-bit numbers which are minuend, subtrahend, and borrow, respectively. The full subtractor ha
2 min read
Full Adder in Digital Logic
Full Adder is the adder that adds three inputs and produces two outputs. The first two inputs are A and B and the third input is an input carry as C-IN. The output carry is designated as C-OUT and the normal output is designated as S which is SUM. The C-OUT is also known as the majority 1's detector, whose output goes high when more than one input
4 min read
Parallel Adder and Parallel Subtractor
Prerequisite - Full adder, Full Subtractor Parallel Adder - A single full adder performs the addition of two one bit numbers and an input carry. But a Parallel Adder is a digital circuit capable of finding the arithmetic sum of two binary numbers that is greater than one bit in length by operating on corresponding pairs of bits in parallel. It cons
3 min read
4-bit binary Adder-Subtractor
In Digital Circuits, A Binary Adder-Subtractor is capable of both the addition and subtraction of binary numbers in one circuit itself. The operation is performed depending on the binary value the control signal holds. It is one of the components of the ALU (Arithmetic Logic Unit). This Circuit Requires prerequisite knowledge of Exor Gate, Binary A
3 min read
Size of ROM for n-bit Adder/Subtractor
ROM is a read-only memory which is used to store the data. The memory in the ROM is organized as a two-dimensional array of memory cells. The memory will read or write the contents of one of the rows of the array. This row is specified by an Address which are bits. The value read or written is called Data. Figure a) shows a memory array with two ad
3 min read
Python program to implement Half Subtractor
Prerequisite: Half Subtractor in Digital Logic Given two inputs of Half Adder A, B. The task is to implement the Half Subtractor circuit and Print output i.e Difference and Borrow of two inputs. The half subtractor is also a building block for subtracting two binary numbers. It has two inputs and two outputs. This circuit is used to subtract two si
2 min read
C++ program to implement Half Subtractor
Prerequisite : Half SubtractorWe are given with two inputs A and B. Our task is to implement Half Subtractor circuit and print the outputs difference and borrow of two inputs. Introduction : The half subtractor is used to subtract two 1-bit numbers which are minuend, and subtrahend . The half subtractor has two input states and two output states. T
3 min read
Half Adder and Half Subtractor using NAND NOR gates
Introduction:Advantages of using NAND and NOR gates to implement Half Adder and Half Subtractor:Universality: NAND and NOR gates are considered universal gates because they can be used to implement any logical function, including binary arithmetic functions such as addition and subtraction.Cost-effectiveness: NAND and NOR gates are relatively simpl
2 min read
Article Tags :
three90RightbarBannerImg