Subtractor
Circuit that performs subtraction / From Wikipedia, the free encyclopedia
Dear Wikiwand AI, let's keep it short by simply answering these key questions:
Can you list the top facts and stats about Subtractor?
Summarize this article for a 10 years old
In electronics, a subtractor – a digital circuit that performs subtraction of numbers – can be designed using the same approach as that of an adder. The binary subtraction process is summarized below. As with an adder, in the general case of calculations on multibit numbers, three bits are involved in performing the subtraction for each bit of the difference: the minuend ($X_{i}$), subtrahend ($Y_{i}$), and a borrow in from the previous (less significant) bit order position ($B_{i}$). The outputs are the difference bit ($D_{i}$) and borrow bit $B_{i+1}$. The subtractor is best understood by considering that the subtrahend and both borrow bits have negative weights, whereas the X and D bits are positive. The operation performed by the subtractor is to rewrite $X_{i}Y_{i}B_{i}$ (which can take the values 2, 1, 0, or 1) as the sum $2B_{i+1}+D_{i}$.
 $D_{i}=X_{}\oplus Y_{i}\oplus B_{i}$
 $B_{i+1}=X_{i}<(Y_{i}+B_{i})$
Part of a series on  
Arithmetic logic circuits  

Quick navigation  
Components


See also 

Subtractors are usually implemented within a binary adder for only a small cost when using the standard two's complement notation, by providing an addition/subtraction selector to the carryin and to invert the second operand.
 $B={\bar {B}}+1$ (definition of two's complement notation)
 ${\begin{alignedat}{2}AB&=A+(B)\\&=A+{\bar {B}}+1\\\end{alignedat}}$