Physics — Logic: 4-to-2 priority encoder
Encodes the highest active input line into two bits.
Make it your own.
title "4-to-2 priority encoder"
type gates
input I1 at (0,0)
input I2 at (0,2)
input I3 at (0,4)
gate OR G1 at (3,1)
gate OR G2 at (3,3)
output Y0 at (6,1)
output Y1 at (6,3)
wire I1 G1
wire I3 G1
wire I2 G2
wire I3 G2
wire G1 Y0
wire G2 Y1