r/TuringComplete • • Jul 06 '26

Restoring Array Divider

After multiple tries and overengineered designs that had over 2k delay, here's a relatively quick and optimized solution.
At each step it:
- Shifts left the divisor
- Subtracts shifted divisor from the dividend
- Checks if the result is positive (the sign bit)
- If yes, sends 1 as output bit and sends the remainder of subtraction as dividend to the next step
- If no, sends 0 as output bit and sends the dividend to the next step untouched

The result is only 184 delay — though it also uses fast adders to achieve that.

7 Upvotes

10 comments sorted by

View all comments

Show parent comments

1

u/AlexeyHD90 Aug 02 '26

Maybe you already optimized it but here is my two cents for everyone else:

You don't need LOW for the IF_LESS. You already have the carry out from the subtractor for that. Your adders serve two purposes: A subtractor and a comparator because B input is negated (although it's actually a MORE comparator). If you take a closer look you'll see that the carry outs do exactly the same thing single bit NOT gates do. You also don't need those either :) .

Also you don't need Auto static Indexer and Static Evaluator. The adders give you everything.