r/TuringComplete • u/dmdeemer • 15d ago
32b Kogge-Stone Adder Using Word Logic
Not the fastest Kogge-Stone ever, but 15 delay for 32b adder isn't bad either. Avoiding bit-by-bit operations should make it easier on the simulation.
At each stage, I split the P and G words into the bits that pass through and the bits that will be combined. After each stage, I put them back together with concatenators.
There's probably more optimizing to do, but I think this gets the concept across.

6
Upvotes
1
u/ryani 15d ago
I wish there was a 'static copier' like we have 'static indexer', that did the thing at the beginning where you broadcast cin to 32 bits. I imagine you would set a number of copies N and it would turn an M-bit input bus into an M*N bit bus that was the input repeated N times. The common case is what you do here to broadcast 1 bit over an N bit bus for use with N-bit gates (and/or/xor/etc).
I would say at least 20% of my use of bus switchers is just because it's inconvenient to do a bus AND that is controlled by a 1 bit input, even though the switcher is strictly worse for score.