Full adder using a 3-to-8 decoder and OR gates, live
A full adder can be built from a 3-to-8 decoder and two OR gates: the decoder turns A, B and Cin into one active line, the minterm for that row, and each output ORs the minterms where it is 1: S = m1 + m2 + m4 + m7 and Cout = m3 + m5 + m6 + m7.
A 3-to-8 decoder is a minterm generator: for inputs A B Cin it raises exactly the line numbered A B Cin. So any function of three variables is an OR of some decoder lines, read straight off its truth table, with no simplification needed. For the full adder, the sum is 1 when an odd number of inputs are 1 (rows 1, 2, 4 and 7) and the carry when at least two are (rows 3, 5, 6 and 7). One decoder can feed both ORs, which is why this is a classic exercise: it shows that decoders plus ORs implement any combinational function. Compare the gate-level full adder from two half adders and the full adder from multiplexers.
Open this circuit in the lab →
What you need
- 1× 3-to-8 decoder (3 NOT, 12 AND): one line per minterm of A B Cin
- 3× OR: S = m1 + m2 + m4 + m7
- 3× OR: Cout = m3 + m5 + m6 + m7
Step by step
- Place inputs
A,BandCinand a 3-to-8 decoder with A as the most significant select bit. - Write the full adder's truth table and note the rows where S is 1 (1, 2, 4, 7) and where Cout is 1 (3, 5, 6, 7).
- OR decoder lines 1, 2, 4 and 7 into
S, and lines 3, 5, 6 and 7 intoCout. - Step through all eight rows: exactly one decoder line is high, and the ORs pick out S and Cout.
Full adder truth table with minterms
| Row (minterm) | A | B | Cin | S | Cout |
|---|---|---|---|---|---|
| m0 | 0 | 0 | 0 | 0 | 0 |
| m1 | 0 | 0 | 1 | 1 | 0 |
| m2 | 0 | 1 | 0 | 1 | 0 |
| m3 | 0 | 1 | 1 | 0 | 1 |
| m4 | 1 | 0 | 0 | 1 | 0 |
| m5 | 1 | 0 | 1 | 0 | 1 |
| m6 | 1 | 1 | 0 | 0 | 1 |
| m7 | 1 | 1 | 1 | 1 | 1 |
All eight rows of the live circuit are checked before the page is built.
You can also read the full theory in the lesson on the full adder. Prefer to build it yourself from scratch? Open the digiwleea lab and place the gates on the canvas, or start from the logic gate simulator.
More builds: Arithmetic
All 246 build guides, by topic
Each of these is one step from a transistor to a working CPU. Build every gate from CMOS transistors and work all the way up in the free digiwleea lab, with the free theory reference alongside.
Open the Full adder using a decoder in the lab →Frequently asked
How do you implement a full adder using a decoder?
Use a 3-to-8 decoder with A, B and Cin as its inputs. Its outputs are the eight minterms. OR together outputs 1, 2, 4 and 7 for the sum, and 3, 5, 6 and 7 for the carry out.
Why can a decoder implement any Boolean function?
Each decoder output is one minterm, so any function in sum-of-minterms form is just an OR of the decoder lines for the rows where the function is 1.
Can a full subtractor be built from a decoder too?
Yes, the same way: the difference is m1 + m2 + m4 + m7 (the same as the sum), and the borrow out is m1 + m2 + m3 + m7.