Non-Restoring Division Algorithm For Unsigned Integer
Algorithm
Non-Restoring Division Algorithm For Unsigned Integer Steps
|
Step-1:
|
Initialize registers
Q = Dividend, M = Divisor, A = 0, n = number of bits in dividend
|
Step-2:
|
If sign bit of register A is 1
then shift left content of AQ and A=A+M,
otherwise shift left content of AQ and A=A-M (means add 2's complement of M to A and store it to A)
|
Step-3:
|
If sign bit of register A is 1
then Q[0]=0
otherwise Q[0]=1 (Q[0] means LSB (least significant bit) of Q)
|
Step-4:
|
The value of counter n is decremented by 1
|
Step-5:
|
If value of n becomes 0 then goto next step otherwise repeat from step-2
|
Step-6:
|
If sign bit of register A is 1
then A=A+M
|
Step-7:
|
Now register Q contains Quotient value and A contains Remainder value
|
Example-1
1. Find 11 divided by 3 using Non-Restoring Division Algorithm For Unsigned Integer
Solution:
Dividend = 11
Divisor = 3
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 | 00011 | 00000 | 1011 | initialize |
4 | 00011 | 00001 | 011_ | shift left AQ |
| | 11110 | 011_ | A=A-M |
| | 11110 | 0110 | Q[0]=0 |
3 | 00011 | 11100 | 110_ | shift left AQ |
| | 11111 | 110_ | A=A+M |
| | 11111 | 1100 | Q[0]=0 |
2 | 00011 | 11111 | 100_ | shift left AQ |
| | 00010 | 100_ | A=A+M |
| | 00010 | 1001 | Q[0]=1 |
1 | 00011 | 00101 | 001_ | shift left AQ |
| | 00010 | 001_ | A=A-M |
| | 00010 | 0011 | Q[0]=1 |
register Q contain the quotient 3 and register A contain remainder 2
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then