Skip to main content

Encoder; 4×16 decoder from 2×4 decoders

Short answer

An encoder converts 2^n input lines to n-bit binary code. A 4×16 decoder is built with five 2×4 decoders: one uses inputs A,B to enable one of four second-level decoders, each using C,D to produce 4 outputs, yielding 16 outputs.

Define encoder. Design 4×16 Decoder using 2×4 Decoder only.

An encoder is a combinational circuit that does the reverse of a decoder: it has 2n2^n (or fewer) input lines and nn output lines, and gives the binary code of the input line that is active. Example: an 8-to-3 (octal-to-binary) encoder gives Y2Y1Y0=101Y_2Y_1Y_0 = 101 when input D5D_5 is high.

4×16 decoder using only 2×4 decoders

Inputs AA (MSB), BB, CC, DD (LSB). Each 2×4 decoder has an enable input EE. Five 2×4 decoders are needed, in two levels.

  • First level (1 decoder): inputs AA, BB. Its four outputs act as enables, selecting one of the second-level decoders.
  • Second level (4 decoders): inputs CC, DD in common. Only the enabled one gives an active output.
                       +-------+
            C,D ------>| 2x4 #1|--> Y0..Y3
                  +--->| E     |
                  |    +-------+
  +--------+  O0--+    +-------+
A-|  2x4   |  O1------>| 2x4 #2|--> Y4..Y7
B-|  (#0)  |  O2--+    +-------+
E-|        |  O3-+|    +-------+
  +--------+     |+--->| 2x4 #3|--> Y8..Y11
                 |     +-------+
                 |     +-------+
                 +---->| 2x4 #4|--> Y12..Y15
                       +-------+
 (C,D go to all four second-level decoders)
ABEnabled decoderOutputs active (by CD)
00#1Y0Y_0–Y3Y_3
01#2Y4Y_4–Y7Y_7
10#3Y8Y_8–Y11Y_{11}
11#4Y12Y_{12}–Y15Y_{15}

Example: ABCD=1101ABCD = 1101: decoder #0 makes O3 high, enabling #4; CD=01CD = 01 makes its second output high, so Y13=1Y_{13} = 1 (since 11012=131101_2 = 13).

✓ Answer checked by Claude Opus 5.5 (high effort)

All Digital Logic chapter 4 questions →