Digital-electronics 简明教程
Full Subtractor in Digital Electronics
What is a Full-Subtractor?
full-subtractor 是一个组合电路,它有三个输入 A、B、bin 和两个输出 d 和 b。其中,A 是被减数,B 是减数,bin 是前一阶段产生的借位,d 是差值输出,b 是借位输出。
A full-subtractor is a combinational circuit that has three inputs A, B, bin and two outputs d and b. Where, A is the minuend, B is subtrahend, bin is borrow produced by the previous stage, d is the difference output and b is the borrow output.
众所周知,半减法器只能用于减去二进制数的 LSB(最低有效位)。如果在减去两个二进制数的 LSB 时有任何借位,那么它将影响下一阶段的减法。因此,带有借位的减法是由全加法器执行的。
As we know that the half-subtractor can only be used for subtraction of LSB (least significant bit) of binary numbers. If there is any borrow during the subtraction of the LSBs of two binary numbers, then it will affect the subtraction of next stages. Therefore, the subtraction with borrow are performed by a full subtractor.
全加法器的框图和电路图如图 1 所示。
The block diagram and circuit diagram of a full-subtractor is shown in Figure-1.

因此,我们可以使用两个异或门、两个非门、两个与门和一个或门来实现全减法器。
Therefore, we can realize the full-subtractor using two XOR gates, two NOT gates, two AND gates, and one OR gate.
Operation of Full Subtractor
现在,让我们了解全减法器的操作。全减法器根据二进制减法的规则执行其操作以找出两个二进制数的差值,如下所示:
Now, let us understand the operation of the full subtractor. Full subtractor performs its operation to find the difference of two binary numbers according to the rules of binary subtraction, which are as follows −
对于全减法器,输出变量(差值和借位)的 1 和 0 由 A - B - bin 的减法确定。
In the case of full subtractor, the 1s and 0s for the output variables (difference and borrow) are determined from the subtraction of A – B – bin.
从全减法器的逻辑电路图中可以清楚地看出,差值位 (d) 是通过两个输入 A、B 和 bin 的异或运算获得的,并且输出借位位 (b) 是通过变量 A、B 和 bin 的非、与和或运算获得的。
From the logic circuit diagram of the full subtractor, it is clear that the difference bit (d) is obtained by the XOR operation of the two inputs A, B, and bin, and the output borrow bit (b) is obtained by NOT, AND, and OR operations of variable A, B, and bin.
Truth Table of Full-Subtractor
真值表提供了一个逻辑电路的输入和输出之间的关系。以下是全减法器的真值表:
The truth table is one that gives relationship between input and output of a logic circuit. The following is the truth table of the full-subtractor −
Inputs |
Outputs |
A |
B |
Bin |
D (Difference) |
B (Borrow) |
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 |
K-Map for Full Subtractor
我们可以使用 K-Map(即卡诺图),这是一种简化布尔代数的方法,来确定差值位 (d) 和输出借位位 (b) 的方程。
We can use the K-Map (or Karnaugh Map), a method for simplifying Boolean algebra, to determine equations of the difference bit (d) and the output borrow bit (b).
半减法器的 K-Map 简化如图 2 所示。
The K-Map simplification for half subtractor is shown in Figure-2.

Characteristic Equations of Full Subtractor
全减法器的特征方程,即差值 (d) 和借位输出 (b) 的方程是通过遵循二进制减法的规则获得的。这些方程如下所示:
The characteristic equations of the full subtractor, i.e. equations of the difference (d) and borrow output (b) are obtained by following the rules of binary subtraction. These equations are given below −
全减法器的差值 (d) 是 A、B 和 bin 的异或。因此,
The difference (d) of the full subtractor is the XOR of A, B, and bin. Therefore,
\mathrm{差值,\:d \:= \:A \oplus B \oplus b_{in} \:= \:A’B’b_{in} \:+ \:AB’b' {in} \: + \: A’Bb' {in} \:+ \:ABb_{in}}
\mathrm{Difference, \: d \: = \: A \oplus B \oplus b_{in} \: = \: A’B’b_{in} \: + \: AB’b'{in} \: + \: A’Bb'{in} \: + \: ABb_{in}}
全减法器的借位 (b) 由下式给出:
The borrow (b) of the full subtractor is given by,
From the logic circuit diagram and k-map −
From the logic circuit diagram and k-map −
\mathrm{借位, \:b \: = \: A’B \: + \: \left ( A \oplus B \right ) \: 'b_{in}}
\mathrm{Borrow, \: b \: = \: A’B \: + \: \left ( A \oplus B \right ) \: 'b_{in}}
From Truth Table
From Truth Table
\mathrm{借位, \:b \: = \: A’B’b_{in} \: + \: A’Bb' {in} \: + \: A’Bb {in} \: + \: ABb_{in}}
\mathrm{Borrow, \: b \: = \: A’B’b_{in} \: + \: A’Bb'{in} \: + \: A’Bb{in} \: + \: ABb_{in}}
或
Or
\mathrm{借位, \:b \: = \: A’B \left ( b_{in} \: + \: b' {in} \right ) \: + \: \left (AB \: + \: A’B' \right )b {in} \: = \: A’B \: + \: \left (A \oplus B \right )'b_{in}}
\mathrm{Borrow, \: b \: = \: A’B \left ( b_{in} \: + \: b'{in} \right ) \: + \: \left (AB \: + \: A’B' \right )b{in} \: = \: A’B \: + \: \left (A \oplus B \right )'b_{in}}
Applications of Full Subtractor
全减法器的一些重要应用如下 −
The following are some important applications of full subtractor −
-
Full subtractors are used in ALU (Arithmetic Logic Unit) in computers CPUs.
-
Full subtractors are extensively used to perform arithmetical operations like subtraction in electronic calculators and many other digital devices.
-
Full subtractors are used in different microcontrollers for arithmetic subtraction.
-
They are used in timers and program counters (PC).
-
Full subtractors are also used in processors to compute addresses, tables, etc.
-
Full subtractors are also used in DSP (Digital Signal Processing) and networking based systems.
Conclusion
从上面的讨论中,我们可以得出结论,全减法器是一种组合逻辑电路,可以计算三个二进制数字的差。在全减法器中,前一级的借位(如果有)也会在下一级的减法运算中使用。因此,全减法器用于对具有任意位数的二进制数执行减法。
From the above discussion, we can conclude that a full-subtractor is a combinational logic circuit that can compute the difference of three binary digits. In a full subtractor, the borrow (if any) from the previous stage is also used in subtraction operation in the next stages. Therefore, full subtractors are used to perform subtraction of binary numbers having any number of digits.