4-to-2 Priority Encoder
Digital Priority Encoder
A priority encoder takes several data lines and outputs the binary index of the highest-priority active line, ignoring lower-priority lines even if they're also active. With D3 as highest priority down to D0 as lowest, the circuit encodes which line won into Y1Y0, and raises V to flag that at least one input is active — Y1 = D3+D2, Y0 = D3+D2'·D1, V = D3+D2+D1+D0. The D2'·D1 term needs an inverter, so the critical path is a three gate delay circuit (NOT, AND, OR).
Data inputs (D3 = highest priority)
Y1 = D3+D2 Y0 = D3+D2'·D1 V = D3+D2+D1+D0 (3 gate delay — NOT, AND, OR)
Higher-index inputs always override lower ones; V is low only when no input is active.
Priority table (don't-cares collapse lower-priority lines)| D3 | D2 | D1 | D0 | Winner | Y1 | Y0 | V |
|---|