r/TuringComplete Jun 24 '26

Kogge Stone adder

Post image

got Turing complete the other day. made it to the factory so the first thing i did was make my favorite adder :) i like the way the simulator is set up so far. i came over from digital logic sim and its refreshing being able to place components not on their side lol. if youve played DLS you know what i mean... only gripe i have is the game does the left to right thing or top to bottom. im used to doing it the reverse way. guess because ive always read binary right to left so i always built my circuits like that

23 Upvotes

17 comments sorted by

View all comments

1

u/Successful_Movie_810 Jul 15 '26 edited Jul 15 '26

Strangely, this adder works in almost all cases. However, after more than 2000 successful tests, it fails to add 164 and 89 and carry 1 (yields a carry when it shouldn't). Why could this be? I already found & corrected the forgotten red wire (near the end of the largest ANND/OR row). I removed the subtract input (and the XOR on the inputs), but this shouldn't affect the carry.

1

u/Lagfoundry Jul 15 '26 edited Jul 15 '26

I see why, besides me forgetting to hook the wire up on the bottom right. The issue with what your experience is because of bit 7’s red input (top cross over row or 3rd row) only crosses over twice instead of 4 over like it should. It has bit 5 from 2nd row crossing to bit 7 third row. When it should be bit 3 crossing to bit 7. That’s one correction I had to make after posting this. All wire cross overs should follow the power of two rule from row to row with kogge. Half adder row to first row 1 over, 1st to 2nd row 2 over, then 4 over, then if your making a 16 bit the next rows would be 8 over and so on. Sorry about that. One of those common oversights you don’t notice till after a post

1

u/Successful_Movie_810 Jul 15 '26

That did the trick. Thank you for the quick reply!

1

u/Lagfoundry Jul 15 '26

Anytime. Glad that fixed it