How it works
The 74138 has three active-low enable inputs (G1 active-high, G2A and G2B active-low) that must all be satisfied before any output fires. For input CBA = 101, output Y5 goes LOW while all other outputs stay HIGH. The output is always active-low because the internal AND gates drive open-collector-compatible pull-downs. In the 74148 priority encoder, if both input 5 and input 3 are active simultaneously, input 5 wins because it has higher priority, and the output code becomes 010 (the complement of 5 in active-low logic).
Key points to remember
A decoder with n inputs produces 2ⁿ outputs, each representing one minterm — that's why decoders are used to implement sum-of-minterms Boolean expressions directly. The 74138 output propagation delay is about 25 ns on a 5V supply. Priority encoders like the 74148 include a GS (group select) output that goes LOW when any input is active, distinguishing a genuine zero-code output from an all-inputs-inactive state. An encoder with 2ⁿ inputs needs n output lines, while a decoder needs the opposite mapping.
Exam tip
Every Anna University paper has a question on implementing a full adder or a Boolean function using a 74138 decoder with external OR gates — draw the minterm connections clearly and label every output pin.