PC Theoretical Smallest possible binary adder with logic gates

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.
 

Attachments

  • Screenshot (130).png
    Screenshot (130).png
    44.9 KB · Views: 130
  • Screenshot (131).png
    Screenshot (131).png
    26.8 KB · Views: 113
  • Screenshot (132).png
    Screenshot (132).png
    25.7 KB · Views: 116
  • Screenshot (133).png
    Screenshot (133).png
    23.2 KB · Views: 108
  • Screenshot (134).png
    Screenshot (134).png
    19.4 KB · Views: 112
  • Screenshot (135).png
    Screenshot (135).png
    19.1 KB · Views: 127
  • binary2.gif
    binary2.gif
    1.2 MB · Views: 161
I probably should have read the entire post before replying, ..but have you explored the possibilities of faulty lamps yet?
 
I probably should have read the entire post before replying, ..but have you explored the possibilities of faulty lamps yet?
I'd had a bunch of experience with them in the past(scrolling text on a programmable text board) but that was 3 years ago and I'd forgotten about them since.
excuse me please, I must have been very tired. I have a version with just faulty lamps that existed in my gadgets world (like 2screens away from that monstrosity in that link^^)


that said, I still am having trouble finding examples of the faulty block incrementor...
 
Back
Top Bottom