Find 13 divided by 4 using Non-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 |
| | 11101 | 101_ | A=A-M |
| | 11101 | 1010 | Q[0]=0 |
3 | 00100 | 11011 | 010_ | shift left AQ |
| | 11111 | 010_ | A=A+M |
| | 11111 | 0100 | Q[0]=0 |
2 | 00100 | 11110 | 100_ | shift left AQ |
| | 00010 | 100_ | A=A+M |
| | 00010 | 1001 | Q[0]=1 |
1 | 00100 | 00101 | 001_ | shift left AQ |
| | 00001 | 001_ | A=A-M |
| | 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