A decoder activates an output corresponding to an input code. An encoder performs the reverse role: it produces a code for an active input. A simple encoder assumes at most one valid active input; multiple simultaneous requests need an explicit rule such as priority.

Worked example

For an active-high 2-to-4 decoder, input AB = 10 activates output Y2 and leaves Y0, Y1 and Y3 low. A 4-to-2 encoder receiving only input I2 high returns code 10. An additional valid output can distinguish no request from a request at input zero.

What to watch for

Many physical decoders use active-low outputs or enable pins. Also, an ordinary encoder's behavior with several active inputs may be unspecified.

Try it yourself

How many outputs does a full 3-to-8 decoder have?

Answer: Eight, one for each possible three-bit code. Exactly one is active when the decoder is enabled under the stated convention.

How to study this topic

Name each input and define its active level before drawing gates. Follow one data path at a time, then check the other combinations. A complete specification is the best starting point for a reliable circuit.

Explore related programmes

These recorded programmes are upcoming. This article is general educational content, not a syllabus or course sample.

Digital Electronics