Combinatorial/Sequential divider?
Posted: Fri Dec 28, 2007 3:09 pm
Besides the subtracting/comparing n.times and the count/multiplying/comparing is there any method to do A/B for any given A and B?
[]
[]

Sega Megadrive/Genesis development
https://gendev.spritesmind.net/forum/
An example of binary division.Jorge Nuno wrote:Besides the subtracting/comparing n.times and the count/multiplying/comparing is there any method to do A/B for any given A and B?
[]
Code: Select all
1100 remainder 1
------
101/111101
-101
------
10101
-101
-------
01
There are several methods for doing this, but all are based on the division principles for multi-digit
numbers that you learned in grade school. Line up the divisor under the left-most set of digits of the dividend,
appending an imaginary set of zeroes out to the right, and subtract as many times as possible. Record the
number of successful subtractions; then shift the divisor right one place and continue until the divisor is flush
right with the dividend, and no more subtractions are possible. Any non-subtractable value remaining is called
the remainder.