Skip to main content

Full adder using a 2×4 decoder

Short answer

Use a 2×4 decoder with A,B as inputs to produce minterms Y0–Y3. Sum S = C_in XOR (Y1 + Y2) and carry C_o = Y3 + C_in·(Y1 + Y2). This requires one XOR, two OR, and one AND gate.

Realize Full Adder Circuit using a 2×4 decoder and using logic gates.

A full adder adds three bits A, B and carry-in CinC_{in} and gives sum S and carry-out CoC_o.

Truth table

ABCinC_{in}SCoC_o
00000
00110
01010
01101
10010
10101
11001
11111
S=Σm(1,2,4,7),Co=Σm(3,5,6,7)S = \Sigma m(1,2,4,7), \qquad C_o = \Sigma m(3,5,6,7)

Realization with logic gates

From K-maps / algebra:

S=A⊕B⊕CinCo=AB+BCin+ACin=AB+Cin(A⊕B)\begin{aligned} S &= A \oplus B \oplus C_{in} \\ C_o &= AB + BC_{in} + AC_{in} = AB + C_{in}(A \oplus B) \end{aligned}
A, B ────────[XOR]── P = A⊕B
P, Cin ──────[XOR]──────────────── S

P, Cin ──────[AND]── Cin·P ──┐
                             ├─[OR]── Co
A, B ────────[AND]── AB ─────┘

(Two XOR, two AND and one OR gate.)

Realization with a 2×4 decoder

A 2×4 decoder has only two inputs, so it cannot generate all 8 minterms. Feed A and B to the decoder; its outputs are the minterms of A, 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

Write S and CoC_o for each AB combination in terms of CinC_{in}:

ABDecoder outputSCoC_o
00Y0Y_0CinC_{in}0
01Y1Y_1Cin‾\overline{C_{in}}CinC_{in}
10Y2Y_2Cin‾\overline{C_{in}}CinC_{in}
11Y3Y_3CinC_{in}1
S=Cin(Y0+Y3)+Cin‾(Y1+Y2)=Cin⊕(Y1+Y2)Co=Y3+Cin(Y1+Y2)\begin{aligned} S &= C_{in}(Y_0+Y_3) + \overline{C_{in}}(Y_1+Y_2) = C_{in} \oplus (Y_1+Y_2) \\ C_o &= Y_3 + C_{in}(Y_1+Y_2) \end{aligned}

(Y1+Y2=A⊕BY_1 + Y_2 = A \oplus B, so these are the same equations as the gate realization.)

          +----------+
 A ──────>| I1    Y0 |── (not used)
 B ──────>| I0    Y1 |── Y1
          |  2x4  Y2 |── Y2
          |  DEC  Y3 |── Y3
          +----------+

Y1, Y2 ──────[OR]── P (= A⊕B)
P, Cin ──────[XOR]─────────────── S

P, Cin ──────[AND]── Cin·P ──┐
                             ├─[OR]── Co
Y3 ──────────────────────────┘

Gates needed besides the decoder: two OR gates, one XOR gate and one AND gate.

Check: A=1, B=1, CinC_{in}=0: Y3=1Y_3 = 1, P=0P = 0, so S=0⊕0=0S = 0 \oplus 0 = 0 and Co=Y3=1C_o = Y_3 = 1; correct (1+1=1021+1 = 10_2).

(With a 3×8 decoder, the usual method S=Y1+Y2+Y4+Y7S = Y_1+Y_2+Y_4+Y_7, Co=Y3+Y5+Y6+Y7C_o = Y_3+Y_5+Y_6+Y_7 would need no XOR gate.)

✓ Answer checked by Claude Opus 5.5 (high effort)

All Digital Logic chapter 4 questions →