Home
LogicRoo / Combinational Gates / Encoder - Truth Table, Boolean Expression & Logic Circuit | Logicroo
Digital Encoder

Encoder - Truth Table, Boolean Expression & Logic Circuit | Logicroo

Learn about Digital Encoders with interactive circuit diagrams, truth tables, Boolean expressions, encoding logic, logic gate implementation, and digital logic examples.

4-to-2 Line Encoder

Digital Encoder

An encoder does the opposite of a decoder: it takes several input lines, of which exactly one is active, and produces the binary code of the position of that active line. With four inputs D0–D3, only one may be high at a time (one-hot); the encoder compresses that into a 2-bit code Y1Y0. Y1 = D2 + D3, Y0 = D1 + D3 — each output is a single OR gate away from the inputs, so this is a one gate delay circuit.

Inputs (one-hot)
Y1
0
Y0
0
Active line
D0
Delay
Y1 = D2 + D3, Y0 = D1 + D3 (1 gate delay — OR, OR)
Valid only when exactly one input is high; D0 is implied by Y1=Y0=0 and needs no gate at all.
Truth table
D3D2D1D0Y1Y0