Skip to main content

Full subtractor using a 1:4 DEMUX

Short answer

Set the DEMUX data input to 1, use A,B as select lines to obtain minterms Y0–Y3. Difference D = B_in XOR (Y1 + Y2) and borrow B_o = Y1 + B_in·(Y0 + Y3). Implement with OR, XOR, AND gates.

Realize a full-subtractor logic circuit using a single 1:4 demultiplexer and necessary logic gates.

A full subtractor subtracts BB and a borrow-in BinB_{in} from AA, giving difference DD and borrow-out BoB_o.

Truth table

ABBinB_{in}DBoB_o
00000
00111
01011
01101
10010
10100
11000
11111
D=Σm(1,2,4,7)=A⊕B⊕Bin,Bo=Σm(1,2,3,7)D = \Sigma m(1,2,4,7) = A \oplus B \oplus B_{in}, \qquad B_o = \Sigma m(1,2,3,7)

Using a 1:4 DEMUX as a 2-to-4 decoder

Connect the data input of the 1:4 demultiplexer to logic 1 and use A, B as its select lines S1S0S_1S_0. Each output is then one minterm of A and B:

Y0=A‾ B‾,Y1=A‾B,Y2=AB‾,Y3=ABY_0 = \overline{A}\,\overline{B},\quad Y_1 = \overline{A}B,\quad Y_2 = A\overline{B},\quad Y_3 = AB

Group the truth table by A, B and see how D and BoB_o depend on BinB_{in}:

ABActive outputDBoB_o
00Y0Y_0BinB_{in}BinB_{in}
01Y1Y_1Bin‾\overline{B_{in}}1
10Y2Y_2Bin‾\overline{B_{in}}0
11Y3Y_3BinB_{in}BinB_{in}

So:

D=Bin(Y0+Y3)+Bin‾(Y1+Y2)=Bin⊕(Y1+Y2)Bo=Y1+Bin(Y0+Y3)\begin{aligned} D &= B_{in}(Y_0+Y_3) + \overline{B_{in}}(Y_1+Y_2) = B_{in} \oplus (Y_1+Y_2) \\ B_o &= Y_1 + B_{in}(Y_0+Y_3) \end{aligned}

(Since exactly one Y is 1, Y0+Y3=Y1+Y2‾Y_0+Y_3 = \overline{Y_1+Y_2}.)

Circuit

        +------------+
 1 ────>| Din    Y0  |── Y0
        |        Y1  |── Y1
        |  1:4   Y2  |── Y2
        | DEMUX  Y3  |── Y3
        +------------+
          S1    S0
          A     B

Y1, Y2 ─────[OR]── Q
Q, Bin ─────[XOR]─────────────── D

Y0, Y3 ─────[OR]── P
P, Bin ─────[AND]── Bin·P ──┐
                            ├─[OR]── Bo
Y1 ─────────────────────────┘

Gates needed: one 1:4 DEMUX, three 2-input OR gates, one AND gate and one XOR gate.

Check: A=0, B=1, BinB_{in}=1 (minterm 3): Y1=1Y_1 = 1, so Q=1Q = 1, D=1⊕1=0D = 1 \oplus 1 = 0 and Bo=Y1=1B_o = Y_1 = 1. This matches the truth table.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Digital Logic chapter 4 questions →