Decoders are used to select any one bi for the given combinations of 2^n variables . These are of order 1x2,2x4, 3x8,4x16,32x5 etc.
These decoders can be made using XOR and NAND Gates.
A B C | Do D1 D2 D3 D4 D5 D6 D7
0 0 0 | 1 0 0 0 0 0 0 0
0 0 1 | 0 1 0 0 0 0 0 0
0 1 0 | 0 0 1 0 0 0 0 0
0 1 1 | 0 0 0 1 0 0 0 0
1 0 0 | 0 0 0 0 1 0 0 0
1 0 1 | 0 0 0 0 0 1 0 0
1 1 0 | 0 0 0 0 0 0 1 0
1 1 1 | 0 0 0 0 0 0 0 1
This is shown decoder 3x8.Similarly by block diagrams these can also be shown by putting an enable bit in input "E". 3x8 can be made by two 2x4 decoders and an E bit line for combining n switching data for two decoders.
Similarly for 4x16 two 3x8 decoders are used with E bit line for switching data, and for 5x32 four 3x8 decoders are required or two 2x16 and 2x4 decoder for Enable line are required.