# How to build a 4 to 16 decoder using ONLY TWO 2 to 4 decoders?

Help please, I am new to circuits and decoders and I need some serious help.

How to build a 4x16 decoder using ONLY two 2x4 decoders?

Following the steps we took in the lecture, we are supposed to build a 4x16 decoder. So here taking k to be 4, k is even, so we will have $2^k$ so $2^4 = 16$ AND gates & 2 decoders each of size $2^{k/2}$ so $2^2 = 4$.

So we have 16 AND gates & two 2x4 decoders. Each 2x4 decoder has 4 AND gates so we have 8 AND gates that should be connected to the 16 AND gates, how do I do that?

• You are allowed to use any number of AND gates and 2 2x4 decoders? – dext0rb Nov 29 '12 at 20:11
• we are supposed to use 16 AND gates and two 2x4 decoders.. – dondon93 Nov 29 '12 at 20:21
• With 2 decoders and 16 ANDs it is easy. – starblue Nov 29 '12 at 21:13

A $2$-by-$4$ decoder has two input lines and four output lines, only one of which is logical $1$ at any time. Which line is $1$ depends on the input bit pair which can be $00, 01, 10, 11$.

So take two such $2$-by-$4$ decoders which give you four input lines. Let the output lines be $a_0, a_1, a_2, a_3$ for one decoder and $b_0, b_1, b_2, b_3$ for the other. Use the $16$ AND gates to compute the $16$ functions $a_i \wedge b_j, 0 \leq i \leq 3, 0 \leq j \leq 3$. We now have a $4$-by-$16$ circuit with the property that only one output is a logical $1$ at any time: which one depends on the values of $i$ and $j$ which in turn depend on the $4$ input bits. In other words, we have a $4$-by-$16$ decoder constructed from two $2$-by-$4$ decoders and $16$ AND gates.

• An easy way to visualize this is as a matrix: the first decoder selects the column, the second decoder selects the rows, and the AND gates - one at each junction of the matrix - are enabled if and only if the row and column are both selected. – Nick Johnson Nov 30 '12 at 10:50
• If the decoders are used to operate LEDs, one could omit the gates if one decoder has active-high outputs that are capable of sourcing current sufficient for the LEDs, and the other has active-low outputs. Simply wire the LEDs in a matrix, and each LED will only light when the "active-high-output" decoder is outputting high and the "active-low-output" decoder is outputting low. – supercat Nov 30 '12 at 16:20
• @supercat As the saying goes, there is more than one way to skin a cat. In this case, the desired solution was required to use 16 AND gates (and presumably two identical $2$-by-$4$ decoders) ..... – Dilip Sarwate Nov 30 '12 at 16:54

you would need 5 such decoders. re-check your notes The question does not prohibit use of logic other than decoders so using 16 2-input and gates we have the following circuit that fulfils the requirement (Muzammal Baig) • i checked them again , and it says we must use only two 2 to 4 decoders knowing that we won't use the E ( enable input ) because it is a beginner course. – dondon93 Nov 29 '12 at 20:08
• pretty hard to create 16 outputs with only 2x4=8 – Tony Stewart Sunnyskyguy EE75 Nov 29 '12 at 20:16
• exactly that is my point ... I kept trying but to no use .. – dondon93 Nov 29 '12 at 20:18
• I guess your assumptions need to be validated – Tony Stewart Sunnyskyguy EE75 Nov 29 '12 at 20:25
• Tony Stewart what software did you use to make those diagrams? – Long Doan Nov 5 '16 at 12:45

## protected by Tom CarpenterNov 5 '16 at 22:13

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).