Signal Encoder (2bit)
Once the number of furnace groups necessary for each product has been obtained, the signal must be distributed to each group. To avoid using one wire for each group I thought to compressing the signals into a single number. This also allows me to greatly simplify the number of combinators.
The idea is simple, convert each product according to this binary table:
Iron Plate = 00 (0)
Cooper Plate = 01 (1)
Brick = 10 (2)
Steel = 11 (3)
For iron plates, using the zero signal implies a great simplification that you will see later.
In the example I have a signal that requires 3 groups of furnace to make bricks and one to make iron plates. The signal creation is done by concatenating each group of furnaces in a single number, 2 bits per group.
The easiest way to get these groups of numbers for each type of product is to calculate a fairly large number (example x10 furnaces groups) and use right bit shift:
Signal 0 x10 = not necessary
Signal 1 x10 = 01 01 01 01 01 01 01 01 01 01 = 349525
Signal 2 x10 = 10 10 10 10 10 10 10 10 10 10 = 699050
Signal 3 x10 = 11 11 11 11 11 11 11 11 11 11 = 349525+699050 = 1048575
example: the number that contain 3 furnaces group for brick is
The construction of the final signal is done chaining/sum these 3 signals each moved by the left bit shift operation.
The advantage of using the zero signal for the iron plates is that an operation can be eliminated and if some furnaces are not used they are activated anyway to produce the plates. Besides, this method does not need to have the number of furnaces. The disadvantage is that if you need to use more than 10 groups of furnaces per type you have to recalculate manualy the values.
Signal Encoder (3bit)
Same, but to transmit the stop signal (zero):
Iron Plate = 001
Cooper Plate = 010
Brick = 011
Steel = 100