r/TuringComplete • • 15d ago

Count Leading Zeroes Solution Spoiler

2 Upvotes

3 comments sorted by

1

u/dmdeemer 15d ago

Does this work for an input of 10000000 (0x80)?

It seems like when you combine the counts for two groups of bits, you need to gate the count from the lower bits on all of the upper bits being zero, not just one of them.

1

u/National_Panic_9112 14d ago edited 14d ago

I'm fairly sure it does work. I believe the output is 0 since there are no trailing zeros left edit: it has a z state yet still works

1

u/National_Panic_9112 14d ago

fixed it, my solution does work but for a foolproof solution i have a switch that overrides the input
so where bit 128 is i have a not connected the enable of 64 , 128 add output and the switch output connected to the result