Skip to content
Digital logic (gates / K-map / truth table) templates

Physics — Logic: 4-to-2 priority encoder

Encodes the highest active input to a 2-bit code.

Template previewDigital logic (gates / K-map / truth table)
4-to-2 priority encoderI0I1I2I3N2G0G1G2Y1Y0Evaluated: 4 inputs, 2 outputs, 16 rows.`I0` is declared as an input and wired to nothing. That is deliberate in a priority encoder — the lowest line encode…Y1 = I2 + I3Y0 = I3 + I1 · ¬I2

Make it your own.

title "4-to-2 priority encoder"
type gates
input I0 at (0,0)
input I1 at (0,1.5)
input I2 at (0,3)
input I3 at (0,4.5)
gate NOT N2 at (3,3)
gate OR G0 at (5,1)
gate AND G1 at (5,3)
gate OR G2 at (7,3.5)
output Y1 at (9,1)
output Y0 at (9,3.5)
wire I2 G0
wire I3 G0
wire G0 Y1
wire I2 N2
wire I1 G1
wire N2 G1
wire I3 G2
wire G1 G2
wire G2 Y0