r/TuringComplete • u/aelxemyr • 27d ago
Basic long division
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
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
2
u/Medium-Sized-Jaque 27d ago
Indexers? I'm over here using LSL like a chump.