Minecraft – Analog redstone signal amplifier/multiplier

minecraft-java-editionminecraft-redstone

Is there a redstone circuit that could alter redstone signal strength by multiplying it by a constant factor? For example, my circuit produces signal in range 1-8 strength, and I'd like to get 2-16 signal strength on output.

Best Answer

Looking at the problem mathematically: The basic analog operation we have is a - b, and the values must be between 0 and 15. How can we produce 2·a using that?

2·a = a + a                    no multiplication, but addition
    = a - (-a)                 no addition, but uses negative numbers
    = 8 + a - (8 - a)          in range, but has a + operation
    = 8 - (-a) - (8 - a)       almost there...
    = 15 - (7 - a) - (8 - a)   this can be redstone!

Note that we are finally using 15 and 7, not 16 and 8, because there is no signal strength 16. The output for input 8 will be 15, not 16, because (7 - a) can only go down to 0 rather than -1.


This is a “physical” implementation of the above formula. The two furnaces are used as signal sources, containing 64+32 and 64+24 items each, causing the comparators to their left (set to subtraction mode) to have input signals of 8 and 7 respectively (which is which doesn't matter). The torch at the bottom provides the constant 15, and the two comparators on the left side subtract the two intermediate results from 15 to produce the final output on the top left.

The middle right comparator is not actually necessary; it just simplifies seeing where the input to the circuit is and what the signal strength at that point is. It does nothing but repeat the signal (it doesn't interact with the furnaces). Thus, this circuit can be built with only 4 comparators.

Note that since the output comes from two subtractions in sequence, when the input changes, the output will change in two equally-sized steps. This could be good if you want a smooth change (e.g. if the input goes from 2 to 3 the output will go through 4, 5, 6) but bad if you're looking for only “correct” outputs (e.g. only even-numbered ones).


The circuit can be compacted by one more block as follows, requiring an additional comparator (which merely repeats the signal, because the input to its right is always weaker and it is not in subtraction mode).

enter image description here

(Another possible compacting is to bring the top and bottom rows right next to each other; this would require feeding the input signal to the two input comparators separately, which might happen to be convenient for some 3D build. Note that you can compensate for signal losses by changing the furnace fill, if your original input's lowest value is above 0.)


These circuits were built and tested in Minecraft 1.6.2 and should work back to version 1.5, but not before 1.5 as comparators did not exist then.

This was an interesting problem to work on and I found what I think is an elegant solution — thanks for asking!