Skip to content
BetterDL

Decoder implementation

Also called: decoder-based implementation, decoder and OR gate, decoder plus OR, implementing a function with a decoder, complement trick

Building a function from a decoder, which supplies every minterm, plus an OR gate on the outputs for the function's 1-rows (or a NOR on its 0-rows).

A decoder with n inputs produces every minterm of those inputs, one per output line. The canonical sum of minterms of a function is an OR of some of those minterms. So:

F = OR of the decoder outputs whose numbers are in F's Σm list.

  1. Get F's minterm list.
  2. Wire the variables to the decoder inputs in order: MSB variable to the MSB pin.
  3. OR together outputs Yᵢ for each i in the list.

No simplification is needed, and every row is right by construction.

The complement trick. If F has more 1s than 0s, collect the 0-rows instead. Their OR is , so a NOR gate gives F back with fewer inputs. F = Σm(0, 1, 2, 3, 4, 5) is 0 only on rows 6 and 7, so F = : a 2-input NOR instead of a 6-input OR.

Sharing. One decoder serves any number of functions of the same inputs. Each needs only its own OR gate, and one output can feed several gates.

Active-low outputs. Many decoder chips have active low outputs (the selected line goes to 0). Then a NAND gate on the chosen outputs does the OR's job, by De Morgan.

A ROM is this same circuit, mass-produced: an address decoder plus an OR array.

00001
00111
01001
01101
10011
10101
11010
11101

Worked example

Example

Two functions from one 3-to-8 decoder

Inputs A, B, C (A is the MSB). F = Σm(1, 4, 6) and G = Σm(0, 1, 2, 3, 4, 5, 7).

  1. 1.

    F has three 1-rows: F = Y1 + Y4 + Y6, a 3-input OR.

  2. 2.

    G has seven 1-rows but only one 0-row, row 6. Use the complement trick: G = , a single inverter on Y6.

  3. 3.

    Y6 now feeds both the OR for F and the inverter for G.

  4. 4.

    Verify input 110: only Y6 is on, so F = 1 (6 is in F's list) and G = 0 (6 is missing from G's list). ✓

  5. 5.

    Verify input 011: only Y3 is on, so F = 0 and G = 1. ✓

Common mistakes

  • Using the complement trick with an OR gate. ORing the 0-rows gives ; you need a NOR to get F.

  • Wiring the variables to the wrong pins. If A goes to the LSB pin, output Y1 means A = 1, B = 0, C = 0, which is your row 4.

  • Sizing the OR by the number of variables. It needs one input per minterm in the list.

Practice Decoder implementation

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Decoder implementation is taught in Combinational Logic.