Find 13 divided by 4 using Restoring Division Algorithm For Unsigned Integer
Solution:
Dividend = 13
Divisor = 4
First the registers are initialized with corresponding values (Q = Dividend, M = Divisor, A = 0, n = number of bits in dividend)
n | M | A | Q | Operation |
4 | 00100 | 00000 | 1101 | initialize |
4 | 00100 | 00001 | 101_ | shift left AQ |
| 00100 | 11101 | 101_ | A=A-M |
| 00100 | 00001 | 1010 | Q[0]=0 And restore A |
3 | 00100 | 00011 | 010_ | shift left AQ |
| 00100 | 11111 | 010_ | A=A-M |
| 00100 | 00011 | 0100 | Q[0]=0 And restore A |
2 | 00100 | 00110 | 100_ | shift left AQ |
| 00100 | 00010 | 100_ | A=A-M |
| 00100 | 00010 | 1001 | Q[0]=1 |
1 | 00100 | 00101 | 001_ | shift left AQ |
| 00100 | 00001 | 001_ | A=A-M |
| 00100 | 00001 | 0011 | Q[0]=1 |
register Q contain the quotient 3 and register A contain remainder 1
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then