NOTE: I corrected and edited this article to be clearer on my github blog.
This article isn’t up to date anymore!
Last year I used to build my stupid unfinished broken processor in Minecraft (which I finally downgraded to a weird and big adder :D), I was working on a bin to BCD converter too. Then I found the awesome Hans Lemurson’s Binary to BCD converter (who has decimals digits). For my output I copied the visible “bin input to selection rows” and made my own “selection part” and output. Because it’s impossible to see anything in the video… Anyway the most interesting and complex part was done by Hans Lemurson and it’s visible in the video. (my selector is certainly the same as him, because I don’t see any other way to make it in such a compact building.)
⒈Input & “Algorithm” part: The upper layer is the main algorithm, that will permanently light the beneath layer when no input is done. (see why in the “selector” part)
The 4 horizontal rows are the binary input. They are easily powered by a torch from above. From up to bottom they are the input of 0b0001, 0b0010, 0b0100 & 0b1000.
For example, the first input row will keep the selector rows 2, 4, 6 and 8 powered while the other will be shutdown. (ie. When there is an input, the torchs will not provide power to the selector layer, while the repeaters will.)
⒉”Selector” part: all lines of this layer must be powered when there’s no input. When a line isn’t powered it will light the output (ie. it’s just a big inverted output.)
From left to right the values of those columns are: 1001, 1000, 111, 110 101, 100, 11, 10, 1. This part is pretty easy to understand and it’s self explanatory.
N.B. torches in this level mustn’t have a bloc above, at the risk of powering a line beside, it’s the blocs where sits the repeaters that will bring problems ; I made the mistake inadvertently twice. :p (stupid mistakes)
⒊Output/BCD Line: This last layer may be the final binary coded decimal output or another converter if you want bigger input, but everything about this is really well explained in the John Loomis’ paper “Binary to BCD Converter”.
There’s nothing special in this layer that need an explanation.
In conclusion this is a really smart construction that let’s you stack a in a neat way many convertors. And the pattern it’s not too complicated to remember.
Not related: This makes me want to make a new computer thing… but I really need to read a bit more about CPU to not make useless things again. hehe!