# Designing of Half Subtractor and Full Subtractor

In this tutorial, we are going to learn **how to design Half Subtractor and Full Subtractor in digital electronics?**

Submitted by Saurabh Gupta, on January 19, 2020

A **Subtractor** is a digital circuit which performs subtraction operation.

## Half Subtractor

It is a combinational circuit that performs subtraction of two binary bits. It has two inputs (minuend and subtrahend) and two outputs Difference (**D**) and Borrows (**B _{out}**). We use half-subtractor to subtract the LSB of the subtrahend to the LSB of the minuend when one binary number is subtracted from another. Subtraction is done according to the rule of binary subtraction and the operations can be summarized in a truth table as,

A | B | Difference (D) | Borrow (B_{out}) |
---|---|---|---|

0 | 0 | 0 | 0 |

0 | 1 | 1 | 1 |

1 | 0 | 1 | 0 |

1 | 1 | 0 | 0 |

**K-Map Simplification**: We use K-Map to obtain the expression for Difference and Borrow bit which is as,

On solving the K-Map and getting the simplified Boolean Expressions we can observe that Boolean expression for Difference (**D**) is the same as the XOR operation and which is the same as what we get as the expression of Sum in Half Adder and Boolean expression for Borrow (**B _{out}**) is

**A.B**

Hence, Logic circuit diagram for Half-Adder can be drawn as,

## Full Subtractor

Full Subtractor also belongs to the class of a combinational circuit and is used to perform subtraction of two binary bits. The half-subtractor can only be used for subtraction of LSB bits, but if there occurs a case of borrow during subtraction of LSB bits, then it can have affected over subtraction in higher columns. Thus, we have a total of three inputs (two original bits and third is considering the borrow (**B _{in}**) of the previous stage) and two outputs Difference (

**D**) and Borrow (

**B**) respectively. The Truth Table of Full Subtractor can be written as,

_{out}A | B | B_{in} |
Difference (D) | Borrow (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 | 1 |

**K-Map Simplification**: We use K-Map to obtain the expression for Difference and Borrow bit which is as,

After solving K-Map, simplified Boolean Expressions for Difference is **A ⊕ B ⊕ B _{in}** and for Borrow it is

**A.B + A.B**, thus, logic circuit diagram for full-subtractor can be drawn as

_{in}+ B. B_{in}### Designing of Full Subtractor using Half-Subtractors

A Full-Subtractor can also be implemented using two half-subtractors and one OR gate. The circuit diagram for this can be drawn as,

The Boolean expressions for Difference and Borrow are,

Difference = A ⊕ B ⊕ B_{in}Borrow = ( (A ⊕ B) ). B_{in}+ A. B = (A. B + A.B). B_{in}+ A. B = A. B. B_{in}+ A.B. B_{in}+ A. B = A. B. B_{in}+ B (A. B_{in}+ A ) [Since, A + BC = (A+B) (A+C)] = A. B. B_{in}+ B. [(A + A) (B_{in}+ A)] [Since, A + A = 1] = A. B. B_{in}+B. B_{in}+ B. A = B_{in}( A. B + B) + B. A [Since, A + BC = (A+B) (A+C)] = B_{in}[(A + B) (B + B)] + B. A [Since, B + B = 1] = A. B_{in}+ B. B_{in}+ B. A

TOP Interview Coding Problems/Challenges

- Run-length encoding (find/print frequency of letters in a string)
- Sort an array of 0's, 1's and 2's in linear time complexity
- Checking Anagrams (check whether two string is anagrams or not)
- Relative sorting algorithm
- Finding subarray with given sum
- Find the level in a binary tree with given sum K
- Check whether a Binary Tree is BST (Binary Search Tree) or not
- 1[0]1 Pattern Count
- Capitalize first and last letter of each word in a line
- Print vertical sum of a binary tree
- Print Boundary Sum of a Binary Tree
- Reverse a single linked list
- Greedy Strategy to solve major algorithm problems
- Job sequencing problem
- Root to leaf Path Sum
- Exit Point in a Matrix
- Find length of loop in a linked list
- Toppers of Class
- Print All Nodes that don't have Sibling
- Transform to Sum Tree
- Shortest Source to Destination Path

Comments and Discussions

**Ad:**
Are you a blogger? Join our Blogging forum.