Decoders are another type of Digital Logic device that has inputs of 2-bit, 3-bit or 4-bit codes depending upon the number of data input lines, so a decoder that has a set of two or more bits will be defined as having an n-bit code, and therefore it will be possible to represent 2n possible values. Thus, a decoder generally decodes a binary value into a non-binary one by setting exactly one of its n outputs to logic "1".
In this circuit the two input lines can be set to any one of four binary values, 00, 01, 10 or 11. Resulting from this input, the output line corresponding to the binary value at inputs A and B changes to logic 1. The other output lines remain at logic 0.