4-bit encoder
x0
x1
x1 + x3
x2
x3
one-hot
code
x2 + x3
x0 x1 x2 x3   y1 y0

1  0  0  0   0  0
0  1  0  0   0  1
0  0  1  0   1  0
0  0  0  1   1  1

y0
y1
unlisted combinations are assumed
not to occur
binary
code