top of page

How to Implement a Subtractor in Combinational Circuits


Half subtractor in digital electronics
Half subtractor in digital electronics

Subtractors are digital circuits that perform binary subtraction on two binary numbers. They operate on bits (0s and 1s) and produce a difference (result of subtraction) and a borrow (indication of borrowing from the next higher-order bit). 


1) Half Subtractor 

A half subtractor is a basic circuit that subtracts two single-bit binary numbers (A and B) and produces two outputs: 

  • Difference (D): The result of subtracting B from A (A - B). 

  • Borrow (Borrow): A flag indicating whether a borrow was needed from the next higher-order bit (1 if borrow occurred, 0 otherwise). 

Difference (D) 

Borrow (B) 

 

Implementation: 

A half subtractor can be implemented using two basic logic gates: 

  • XOR (Exclusive OR) gate: Calculates the difference (A - B) by performing an XOR operation on the two input bits. 

  • AND gate: Determines the borrow by calculating the AND of the two input bits. 

Circuit Diagram: 


Half adder implementation in digital electronics
Half adder implementation in digital electronics

Explanation: 

  • The XOR gate calculates the difference (D) by performing bitwise XOR on A and B. 

  • If A is 1 and B is 0, or if A is 0 and B is 1, the XOR result is 1 (indicating a difference of 1). 

  • If both A and B are the same (0 or 1), the XOR result is 0 (no difference). 

  • The AND gate calculates the borrow (Borrow) by checking if both A and B are 1. This indicates that we need to borrow 1 from the next higher-order bit for subtraction. 

2) Full Subtractor 

A full subtractor is a more complex circuit that subtracts two single-bit binary numbers (A and B) while considering a borrow (BorrowIn) from the previous higher-order bit subtraction. It produces two outputs: 

  • Difference (D): The final result of the subtraction (A - B - BorrowIn). 

  • BorrowOut (Borrow): A flag indicating whether a borrow needs to be propagated to the next higher-order bit (1 if borrow occurs, 0 otherwise). 

Truth Table: 

B 

Borrow in 

Difference  

Borrow 

 

Implementation: 

A full subtractor can be built using two half subtractors and an OR gate: 

  • Half subtractor 1: Subtracts B from A, generating a difference (D1) and a borrow (Borrow1). 

  • Half subtractor 2: Subtracts BorrowIn from D1, providing the final difference (D) and a borrow (BorrowOut). 

  • OR gate: Combines Borrow1 and the BorrowIn to determine the BorrowOut signal sent to the next higher-order bit.  


Circuit diagram :-


Full subtractor implementation
Full subtractor implementation

Expression for full subtractor:-

D(difference ) = A xor B xor Bin

B(out) = (!A and B) or ((!A or B) and Bin)


Explanation: 

  • Half subtractor 1 performs the initial subtraction of B from A, giving a difference (D1) and a borrow (Borrow1). 

  • Half subtractor 2 takes D 

 Check out our Latest Training & Internship, Courses, and NI Jobs Alert.


Check out our DIY Kits & Sensors, Electronics Projects & Assistance Plan.


2 views0 comments

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page