Here is a Dec to DCB Encoder. It translate decimal digits ( 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 ) to their DCB representation :
1 - 0 0 0 1
2 - 0 0 1 0
3 - 0 0 1 1
4 - 0 1 0 0
5 - 0 1 0 1
6 - 0 1 1 0
7 - 0 1 1 1
8 - 1 0 0 0
9 - 1 0 0 1
0 - 1 1 1 1 -> Is Needed because if you represent 0 by 0 0 0 0, you have no signal as output.
CREATIONS
MINECRAFT-SCHEMATICS.COM