PDA

View Full Version : Restoring and non restoring division algorithm


RobikShrestha
Mar14-11, 09:13 AM
Can anyone please explain to me how and why do restoring and non restoring algorithms for division work and please provide me with a correct flowchart for the non restoring division.

Mark44
Mar14-11, 10:11 AM
Can anyone please explain to me how and why do restoring and non restoring algorithms for division work and please provide me with a correct flowchart for the non restoring division.
Is this a homework problem? If so, have you done any research to find the answers to your questions?

rcgldr
Mar14-11, 03:04 PM
restoring algorithms are similar to doing long hand division by hand.

I did a web search and found that Wiki's "non-restoring" algorithm is not what was/is used in the few mini-computers that implemented it. The Wiki algorithm shows a quotient made of up -1, +1, while there's an alternaltive algorithm that produces conventional 0's and 1 for the quotient. Link to a more typcial algorithm:

http://fourier.eng.hmc.edu/e85/lectures/arithmetic_html/node8.html

For signed numbers, there is some pre and post processing (decrement of negative dividend, increment remainder, ...)

As for why it works, you should go thorugh the math (not sure if this is homework).

RobikShrestha
Mar14-11, 06:11 PM
Is this a homework problem? If so, have you done any research to find the answers to your questions?

I have already learned the algorithm but I do not know why it works.

RobikShrestha
Mar14-11, 06:13 PM
As for why it works, you should go thorugh the math (not sure if this is homework).

This is not homework. The homework was to code the program which I have already done. My main concern is why it works. I mean I want to relate the algorithm to our conventional division.

rcgldr
Mar14-11, 09:02 PM
link to a pdf with an explanation of their implementation:

http://www.freescale.com/files/microcontrollers/doc/support_info/BeyondBits2article07.pdf