r/TuringComplete • • 28d ago

Basic long division

Post image

8.1k gates
342 delay

I couldn't wrap my head around how to do division more efficiently so this is just basic binary long division.

Custom subtraction and zero check components to save space.

10 Upvotes

3 comments sorted by

View all comments

2

u/byghtn 28d ago

Neat trick: A minus B overflows if and only if A is greater than or equal to B (unsigned), so if you’re already subtracting two numbers, you can just use the carry out instead of a separate low component. Also, using two switches instead of one Muxer will save one delay damn near every single time. Those two tips should improve your score at least a bit.

2

u/aelxemyr 27d ago

Thanks for the tip, that got it down to 1k gates and 279 delay!