9

I'd like the output signal to be half the input signal strength.

I was able to use the 'lookup table' approach, which can convert pretty much any input to any output, but is bulky, noisy, somewhat slow, and quite expensive. enter image description here

Is there a neater, more compact, or faster way to convert input signal strength 0-15 into range 0-8 (or similar, small off-by-one changes allowed, e.g. 0,1->0; 14,15->7).

Bonus: divide by a different number?

  • Interesting challenge. Do you need this for anything specific? In that case it might be easier to change how the signal gets created. – Fabian Röling Aug 7 at 9:10
  • @FabianRöling: Mostly as a challenge. "Something specific" was averaging two signals which someone else asked on Reddit. – SF. Aug 7 at 9:17
  • Well, I just accidentally built a power quadrupler. That's already something, I guess. Input->Output currently behaves like this: 1→0, 2→3, 3→7, 4→11, 5+→15 Edit: Hm, I might be able to make this into a general pulse multiplikation/division circuit… – Fabian Röling Aug 7 at 9:28
  • @FabianRöling: There's already a doubler but x+x is not that hard. I bet with some effort I could build a double fader where one half fades at single speed, the other at double, the first timing the second. It's going to be slooow, and dubiously much smaller. – SF. Aug 7 at 9:42
  • Mine can be used as an arbitrary multiplier and divider in theory, the problem is just that it gets more and more unprecise as the factor gets smaller. For quadrupling, every input strength level has its own output strength level, for doubling, it groups signals by two and for halving it groups by 8. So I now have a circuit that outputs a signal strength of 3 if the input signal strength is at least 9, otherwise it outputs nothing. And that in a very complicated way. Not quite what you wanted. :D But the idea of using the comparator fadeout time and locking repeaters might have potential. – Fabian Röling Aug 7 at 9:46
6

What about this? When you make your input two units stronger, your output increases by one.

Edit:

This is rather slow, because it takes up to 8 ticks (one for the last repeater plus one for each of the following comparators) to update the output.

Inspired by Fabian Rölling's faster (only one tick) solution, I found out that lining up the repeater's output to adjacent blocks leads to an even more compact solution for the division by two:

side image division by 2top image division by 2

Note that the redstone signal can climb up slabs but not down!

Each repeater is reached in two steps more compared to the previous repeater. The last repeater reached is crucial for the result. Because the output blocks of the repeaters are adjacent, the signal's power is reduced by one for each unused repeater passed.

From this pattern, we can derive solutions for a division by any number, for example by three:

side image division by 3top image division by 3

Please note that the input to the repeater can come from behind the adjacent solid block. Here each repeater is reached in three steps more compared to the previous one.

The division by five turns out to be very simple: division by 5

  • Not bad, but the output goes 7-14 which necessitates subtracting the 'bias' on output. – SF. Aug 8 at 8:21
  • @SF to subtract X, all you have to do is to extend the output by X redstne dusts. – Gerhard Aug 9 at 5:59
10

I built a gigantic complex circuit that converted signal strength to time using comparator fadeout and then back to signal strength using locking repeaters, then I built a simpler circuit based on Xisuma's item frame rotation detector, which was still quite bulky and complicated looking… and then I had an epiphany and just used a bit of redstone dust.

This is all. The leftmost redstone dust at the top is the input, the one on the bottom right above the sign is the output. The trick is to just snake around the redstone line more and more the weaker the signal is.
Only the repeater corresponding to the strongest detected signal (furthest to the right) matters for the power level of the output, because for example a power level of 8 overwrites all from 1 to 7 that come from the repeaters further on the left. Only every second repeater is needed in that case, because the other ones would just go to the same line anyway (thanks to Gerhard for that hint). Every pair of initial redstone dusts for two neighbouring repeaters is connected, so that the signal strength decreases by 1 when going to the output from the first pair, but not the second pair. For every pair the redstone line has to snake back and forth one block more than the last one, so that the signal strength at the output decreases by 2 from that.

This should be buildable just from the picture, but here's a structure anyway: https://drive.google.com/file/d/1SPRQaiMwT8hnbWfil-SQXnkWuRb8Iyu5

  • 4
    You can simply remove every second repeater, only eight - the 1st, 3rd, 5th, 7th, 9th, 11th, 13th and 15th are necessary. – Gerhard Aug 7 at 17:03
  • Thanks for the hint, I changed quite my answer around quite a bit now. The explanation still sounds more confusing to me than the circuit itself. :D I also updated the picture and the structure file. – Fabian Röling Aug 7 at 19:51
0

I've finally managed something that doesn't depend on a lookup table of one form or another and is somewhat neat.

Dual Fader - two fader circuits, the top one fading at 2 levels per (2rt) period, the bottom one fading by one but only while the top one still has power.

There's a reset that clears any residual power before the new input is latched, and there's output enable feature that keeps output unpowered while the calculation is in progress.

Due to timing dependencies it has a small, rather harmless quirk - maps 0->0, 1->1, 14->8, 15->9. Making the input signal 1 weaker (just adding one redstone dust on input)

enter image description here enter image description here enter image description here enter image description here

Following: top view of the entire device, and top view onto the bottom fader (top fader removed).

The right side of the image is a monostable circuit that activates on input change and passes input to the divider, then cuts it off to enable calculation. It also activates the two reset lines (above). The central part - two comparators aimed into solid blocks - create analog memory cells. Combined with comparators (bottom sides of the images) subtracting signal strength 2 or 1 respectively (produced by reading the appropriately filled composters) these comprise the fader circuits.

The composter of the lower circuit is lowered into position by a sticky piston activated by signal from the upper circuit. The left side has a piston raising a solid block to disable output while calculation is in progress and lowering it between two comparators to enable output.

enter image description here enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.