![]() |
VOOZH | about |
The Restoring Division Algorithm is a method for dividing two unsigned integers in binary form, producing a quotient and remainder through iterative shifting and subtraction.
Initially, register Q contains the dividend and register A is set to 0. After completion, Q contains the quotient and A contains the remainder. Here, an n-bit dividend is loaded in Q and the divisor is loaded in M. The Value of Register is initially kept 0, and this is the register whose value is restored during iteration, due to which it is named Restoring.
Unsigned integers store only non-negative numbers. Signed integers use the first bit for the sign (0 = positive, 1 = negative), while unsigned use all bits for value. In 8-bit form, unsigned integers range from 0 to 255. They are used in computing when only positive values or a larger range is required.
Slow division algorithms include restoring, non-restoring, and SRT algorithms. Fast algorithms include Newton–Raphson and Goldschmidt methods. In this article, will be performing restoring algorithm for unsigned integer. Restoring term is due to fact that value of register A is restored after each iteration.
Perform Division Restoring Algorithm Dividend = 11 Divisor = 3
| n | M | A | Q | Operation |
|---|---|---|---|---|
| 4 | 00011 | 00000 | 1011 | initialize |
| 00011 | 00001 | 011_ | shift left AQ | |
| 00011 | 11110 | 011_ | A=A-M | |
| 00011 | 00001 | 0110 | Q[0]=0 And restore A | |
| 3 | 00011 | 00010 | 110_ | shift left AQ |
| 00011 | 11111 | 110_ | A=A-M | |
| 00011 | 00010 | 1100 | Q[0]=0 | |
| 2 | 00011 | 00101 | 100_ | shift left AQ |
| 00011 | 00010 | 100_ | A=A-M | |
| 00011 | 00010 | 1001 | Q[0]=1 | |
| 1 | 00011 | 00101 | 001_ | shift left AQ |
| 00011 | 00010 | 001_ | A=A-M | |
| 00011 | 00010 | 0011 | Q[0]=1 |
Remember to restore the value of A most significant bit of A is 1. As that register Finally, register Q contains the quotient (3) and register A contains the remainder (2).