r/TuringComplete • • 1d ago

Solution: Divide Spoiler

Here's my working design for the Divider level. I have two custom components:

  • 0f: Non-Zero Switch: If the input is not zero, the output is 1
  • eq_o: Outputs 1 if A is equal to or greater than B. The design is shown at the top of the first picture.

The first section is to weed out anything that won't work, and would output a simple 0 or a 1. If the two values are completely even, it will output a 1. If one of the numbers is 0, it will output a 0. If the denominator is bigger than the numerator, it will output a 0.

The next section does long division with binary, multiplying each digit of the numerator with the denominator, and if it's equal or bigger it outputs a 1, and subtracts the value from the next step.

The second picture is the half-divider. It only works if the exceptions mentioned in step 1 have been removed.

7 Upvotes

3 comments sorted by

4

u/Crispy1961 1d ago

Smooth wiring. Looks great. Little tip, never use NEG to subtract. It already has ADDer in it. Use NOT instead and activate the carry in bit of the ADDer to turn the NOT to NEG.

2

u/Impossible_Eggies 1d ago

Thanks for the tip!

2

u/Lagfoundry 1d ago

Good tip. Doing that knocks a ton of delay off for the later AND gates in the campaign that allows you to pass to the next stage