An encoder has _________ input lines _________ output lines.
An encoder is a combinational logic circuit that performs the inverse operation of a decoder. It takes a set of input signals and converts them into a coded output signal. Typically, an encoder takes $2^n$ input lines and produces an $n$-bit binary output code. This output code corresponds to the activated input line.
In a standard binary encoder, the relationship between the number of input lines and the number of output lines is fixed. If an encoder has $n$ output lines, these $n$ lines can represent $2^n$ different binary codes (from $00...0$ to $11...1$). Therefore, a binary encoder is designed to handle up to $2^n$ distinct input lines, where each input line corresponds to one of these $2^n$ codes.
When a specific input line is activated (usually high, while others are low), the encoder generates the corresponding $n$-bit binary code on its output lines. For example, if the input line corresponding to the decimal value 5 is activated in a 3-bit encoder ($n=3$, $2^n=8$ inputs), the output would be the binary code for 5, which is 101.
So, an encoder typically has:
This structure allows the encoder to translate the position of an active input line into a concise binary representation.
Let's look at a simple example:
In both examples, the number of input lines is $2^n$ where $n$ is the number of output lines.
Based on this fundamental structure of a binary encoder, the number of input lines is $2^n$ and the number of output lines is $n$.