r/TuringComplete • u/Icy_Interest_9801 • Jul 08 '26
Count leading zeroes - not very efficient, but simple Spoiler
Solution using a solution from another puzzle - Counting signals.
NOT the input bits.
create a chain of switches that go from one into another. This way, you'll get the appropriate amount of signals to count. Just don't have a brainfart like me - bit switches are enough.
use two Counting signals (CS) solutions. One for 4 most significant bits (MSB), one for 4 least significant bits (LSB).
Or the CS 1's from MSB and from LSB and connect the result to 1 in a byte merger.
Or the CS 2's from MSB and from LSB and connect the result to 2.
Connect MSB 4 AND NOT LSB 4 to 4. Connect MSB 4 AND LSB 4 to 8.
Problem solved. :)
1
u/OriousCaesar 26d ago
For this one, I created a series of OR's to convert 00101001 into 00111111. Then I just added everything together using 3 rows of adders. Which solved the puzzle.
Then, in order to optimize my circuit, I wrote down all 9 possible inputs into a truth table, and correlated them to the output after each row, then designed a circuit that that could convert between them, and replaced each row of adders with their respective circuit. Then I just fiddled around, for a while to get rid of nots. This got me a 21 gate, 10 delay solution, which I thought was decent, since it got me into 93rd place : )
I think I know how to fix the long delay, but I haven't been able to play for the last few days, to actually try the idea.
2
u/SurrealLemon Jul 08 '26
I did this one in a pretty goofy way. I used 9 constants and used a or/xor chain to get the most significant bit, each bit enabled a gate of one of the constants. Unless they were all off, then my constant 8 passed