# Decoders

### What is decoder?

A decoder is a **combinational circuit** that converts binary information from n input lines to a maximum of 2^{n} unique output lines. If the n-bit decoded information has unused or don’t care combinations, the decoder output will have less than 2^{n} outputs.

This article explains n-to-m line decoders where m <= 2^{n}. They generate 2^{n} or less minterms of n input variables.

Consider an example where three inputs are decoded into eight outputs and each represents one of the minterms of the 3-input variables. The three inverters provide the compliment of the inputs, and each one of the eight AND gates generates one of the *minterms*.

### Truth Table

The following truth table shows the input-output relationships for the operation of the decoder.

Inputs | Outputs | |||||||||
---|---|---|---|---|---|---|---|---|---|---|

X | Y | Z | D0 | 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 |

In the above truth table, the output variables are mutually exclusive because only one output can be equal to 1 at any one time. In the first row of the table D0 is 1, in the second row D1 is 1 and so on.

### Application

An application of this decoder is binary-to-octal conversion. The input variables can represent a binary number, and the outputs will then represent the eight digits in the octal number system. However 3-to-8 line decoder can be used for decoding any 3-bit code to provide eight outputs, one for each element of the code.