The module works as expected but it's not over : I could spare at least 20 to 30 diodes.

Some diodes appear to be back-to-back and there are 27 such pairs. This could save 27 diodes. However the number pairs differing by 1 go to different rails and can't be easily merged.

So it seems I must focus on diodes in the same direction. I find 27 pairs of adjacent digits (with distance 2) where the diodes could be in common. But why limit to distance 2 ?

There could be all sorts of possible permutations. There is no obligation (apart from ease of understanding) to keep the digits in order in the layout. There IS one obligation to split the number in two halves because of the bidir ROM, which reduces the number of permutations. I wanted to analyse the permutations by hand but there are way too many.

So I must write a program and run binary convolutions...

Of course there are some places where 4 diodes could be merged into 1 and it's an additional bonus I consider, but the merge-2 is a lower-hanging fruit with higher probability and better yield.

So first, the permutations are highly reduced because numbers go in pairs. This is due to the bidir diode array, and this constrains things a lot, but also reduces the search space. Numbers can only go with +1, +2, +4 or +8).

This leaves 8 codependent pairs of numbers to permute. Permutation is easy : just shuffle the wires ! This leaves "only" 2×3×4×5×6×7=5040 permutations, multiplied by 4 because of the 4 possible polarity reversals.

But there are still a lot of redundancies because the permutation 01234567 is the same as 10325476, or 14 other permutations because numbers go in pairs. This leaves us with 5040/16=315 degenerate combinations. The redundant permutations should be avoided.

But wait ! there is more ! 01234567 is the same as 67452301 because we only care about the pairings. So it's all about pairings, and how many are there ?

1 => 0

2 => 1

3 => 3

4 => 3

5 => 3 shapes × 5 rotations

6 => 5 shapes (1, 3, 3, 2 and 6 rotations), summing to 15 again

Too lazy to check for 7 and I go to OEIS to find clues : oeis.org/search?q=1%2C3%2C3%2C15%2C15 but I don't find my sequence starting with 0. So I sketch for 7 and I get 0,1,3,3,5,5,35 (=7×5)

There is a high probability that the next number is 35 again (by construction) but at most, it is 35×8=280. Still better than 315 (and without the ×4 factor). The new number gives us A086116 with a hint in the description: "*Numerator of mean deviation of a symmetrical binomial distribution on n elements.*" I don't see where the "Numerator of mean deviation" comes from but it sure looks like a "*symmetrical binomial distribution on n elements*".

Actually it's simpler than that and the only permutation that can work is the permutation of the input wires. Otherwise we'd get random numbers (and another 16×4 bits ROM for translation). This makes 2×3×4=24 permutations. Only. I suspect there could be more but the decoder would become more complex and require more relays.

There is a probability that several permutations are equally effective so their efficiencies can also be determined with the added constraint of merge-4 (two contiguous merges).

Here is how I create the recursive permutations:

function recurse(head, hl, tail) {
var h1=hl+1;
var tl=tail.length;
if (tl > 1) {
var t2=tail.slice(1);
for (var i=0; tl > i; i++) {
var c=tail[i];
head[hl]=c;
recurse(head, h1, t2);
t2[i]=c;
}
}
else
m+=head.join('')+tail[0]+"\n";
}
function start() {
PreId=document.getElementById("pre");
recurse([], 0, ['0', '1', '2', '3']);
PreId.innerHTML=m;
}

OK. It's not your basic schoolbook example but I had to deal with JS' idiosyncrasies and I like to do stuff "in place".

Now, because we only test merges of 2 or 4 diodes, there is no need to explore the full tree (it would result in duplicate values). The line "**if (tl > 1)**" thus becomes "**if (tl > 2)**" to halve the number of permutations. (I should have...

Read more »
Wow! So cool indicator, but I couldn't find enough number of them with acceptable price :( So have to use VF ones.

Interesting schema of BitToSeg encoder - you used two-polar power supply to reduce number of parts?