quixilver87
Terrarian
just what it says on the tin. Was looking it up earlier today and realized how crazy and complicated the hoiktronics binary adders were and I couldn't find a single person using the xor and method... so I figured I'd throw my hand into the ring. My original goal was to count the number of mobs coming from multiple spawning lanes I had setup in my dungeon farm. With these results my expectations are tempered. I'd need like 4 of these mechanisms per lane to be able to get accurate overnight counts without overflow.
Figured it'd take me a day or two to come up with a workable design, since I couldn't find an example of one that didn't take up half a screen.
20 minutes later I had this.
being this simple, I doubt I'm the first person to come up with it or even to post it here, but I couldn't find a thread about anything close to this efficient.
the red wire from the lever is the incrementor, and switches the first bit. the rest of the bits are built on XOR flip and and output. I switched the logic blocks order every other one so I can eliminate wire paths between modules.
In each XOR AND pair, the 'input' (or 'carry' in some parlance) activates the top 2 lamps in the pair. The xor toggles all 4 lamps in the pair. the and only outputs to the bit indicator and the next input lamps.
Logic flow- First press toggles lone gemspark block on, toggles top 2 lamps on XOR/AND module (LAMP STATE on-on over off-off) XOR activates and toggles all lamps (off-off over on-on). 2nd press toggles gemspark off, toggles top 2 lamps on, AND activates and XOR turns off. XOR flips all lamps leaving you back at all lamps off (AND deactivates but cannot send more than one signal per tick so the 'off' signal is dropped')
The AND's input to the next module can be considered that module's "first press".
each bit can be individually toggled by activating the wire on the AND block coresponding to that bit indicator and the proper carry circtuitry will be activated automatically, making an in-place binary adder just a link between lanes with a manual AND gate.
Tl/DR: smallest binary counter and adder possible- This is how CPU's do it. 30x5 per 8 bits
bump this if you want to see this actually made into a 9 bit full adder with video.
Figured it'd take me a day or two to come up with a workable design, since I couldn't find an example of one that didn't take up half a screen.
20 minutes later I had this.
being this simple, I doubt I'm the first person to come up with it or even to post it here, but I couldn't find a thread about anything close to this efficient.
the red wire from the lever is the incrementor, and switches the first bit. the rest of the bits are built on XOR flip and and output. I switched the logic blocks order every other one so I can eliminate wire paths between modules.
In each XOR AND pair, the 'input' (or 'carry' in some parlance) activates the top 2 lamps in the pair. The xor toggles all 4 lamps in the pair. the and only outputs to the bit indicator and the next input lamps.
Logic flow- First press toggles lone gemspark block on, toggles top 2 lamps on XOR/AND module (LAMP STATE on-on over off-off) XOR activates and toggles all lamps (off-off over on-on). 2nd press toggles gemspark off, toggles top 2 lamps on, AND activates and XOR turns off. XOR flips all lamps leaving you back at all lamps off (AND deactivates but cannot send more than one signal per tick so the 'off' signal is dropped')
The AND's input to the next module can be considered that module's "first press".
each bit can be individually toggled by activating the wire on the AND block coresponding to that bit indicator and the proper carry circtuitry will be activated automatically, making an in-place binary adder just a link between lanes with a manual AND gate.
Tl/DR: smallest binary counter and adder possible- This is how CPU's do it. 30x5 per 8 bits
bump this if you want to see this actually made into a 9 bit full adder with video.