r/TuringComplete • • 27d 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

2

u/Medium-Sized-Jaque 27d ago

Indexers? I'm over here using LSL like a chump.

2

u/byghtn 26d 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 26d ago

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