Decoder
- A decoder is a combinational circuit that decodes input code and activates a corresponding output line
- Takes in inputs
- Has outputs
- Each input activates a single output
Each output is a minterm:
- Implementing decoder only requires AND gates + inverters

Implementing Boolean Functions with Decoders
- Any Boolean function of input variables can be implemented using a -to- decoder and a logic gate
- Decoders can generate all minterms
- Decoder is particularly advantageous when multiple Boolean functions of the same input variables need to be implemented
Avoid large fan-in output gates:
- When there are fewer 1’s, use OR gate to implement function
- OR output lines for which function is equal to 1
- When there are fewer 0’s, use NOR gate to implement function
- NOR output lines for which function is equal to 0

Enable Input
- Enable input controls the operation of the decoder
- If is not active, then all outputs have zeroes
- Ignores the inputs
- To add enable input to a decoder circuit, you just AND just before the output
NAND Decoders
- Decoders can also be implemented using NAND gates
- Each output becomes a maxterm
- These decoders behave differently than the ones above
- It causes all outputs but one to be activated for each input
- Essentially, these decoders work in reverse

Avoid large fan-in output gates:
- When there are fewer 1’s, use NAND gate to implement function
- NAND output lines for which function is equal to 1
- When there are fewer 0’s, use AND gate to implement function
- AND output lines for which function is equal to 0
Larger Decoders
- Larger decoders can be built by cascading smaller decoders
- Use as many decoders needed to provide desired # of outputs
- Connect Enable inputs of decoders of a given stage to the outputs of the previous stage
- In a given stage, the decoders should decode the same input bit
