Binary - Non-Restoring Division Algorithm - Stack Overflow

download Binary - Non-Restoring Division Algorithm - Stack Overflow

of 3

Transcript of Binary - Non-Restoring Division Algorithm - Stack Overflow

  • 2/21/2014 binary - Non-restoring division algorithm - Stack Overflow

    http://stackoverflow.com/questions/12133810/non-restoring-division-algorithm 1/3

    Take the 2-minute tour

    Abid Rahman K

    14.6k 4 40 73

    CyberShot

    469 1 7 18

    1 Answer

    Does anyone know the steps for dividing unsigned binary integers using non-restoring division?

    It's hard to find any good sources online.

    i.e if A = 101110 and B = 010111

    how do we find A divided by B in non-restoring division? What do the registers look like in eachstep?

    Thanks!

    algorithm binary division bits addition

    edited Feb 5 '13 at 16:52 asked Aug 26 '12 at 20:51

    Look at the source code of this web page. Raymond Chen Aug 26 '12 at 21:07

    (My answer is a little late-reply. But I hope it will be useful for future visitors)

    Algorithm for Non-restoring division is given in below image :

    Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, noregistration required.

    Non-restoring division algorithm

    sign up

    log in

    tour

    help

    careers 2.0

    add comment

  • 2/21/2014 binary - Non-restoring division algorithm - Stack Overflow

    http://stackoverflow.com/questions/12133810/non-restoring-division-algorithm 2/3

    In this problem, Dividend (A) = 101110, ie 46, and Divisor (B) = 010111, ie 23.

    Initialization :

    Set Register A = Dividend = 000000Set Register Q = Dividend = 101110( So AQ = 000000 101110 , Q0 = LSB of Q = 0 )Set M = Divisor = 010111, M' = 2's complement of M = 101001Set Count = 6, since 6 digits operation is being done here.

    After this we start the algorithm, which I have shown in a table below :

    In table, SHL(AQ) denotes shift left AQ by one position leaving Q0 blank.

    Similarly, a square symbol in Q0 position denote, it is to be calculated later

  • 2/21/2014 binary - Non-restoring division algorithm - Stack Overflow

    http://stackoverflow.com/questions/12133810/non-restoring-division-algorithm 3/3

    Abid Rahman K

    14.6k 4 40 73

    Hope all the steps are clear from the table !!!

    answered Feb 5 '13 at 16:30

    Not the answer you're looking for? Browse other questions tagged algorithm binary

    division bits addition or ask your own question.

    add comment