Professional Documents
Culture Documents
ROLL NO: - 03
UID: - 121CP3292A
COMPUTER BRANCH
SUBJECT: - Digital Logic & Computer Organization and Architecture
Experiment no 4
❖ Aim
To implement non-restoring division algorithm
❖ Objective:
1. To design non- restoring with a controller and a Datapath. This will also help in
the learning of control unit design as a finite state machine
2. To understand the advantages of non-restoring division .
❖ Theory:
To perform Non-Restoring division, it is less complex than the restoring one because
simpler operation are involved i.e. addition and subtraction, also now restoring step is
performed. In the method, rely on the sign bit of the register which initially contain zero
named as A. This algorithm is different from the other algorithm because here, there is no
concept of restoration and this algorithm is less complex than the restoring division
algorithm. Let the dividend Q = 0110 and the divisor M = 0100.
The step involved:
Step-1: First the registers are initialized with corresponding values (Q = Dividend, M =
Divisor, A = 0, n = number of bits in dividend)
Step-2: Check the sign bit of register A
Step-3: If it is 1 shift left content of AQ and perform A = A+M, otherwise shift left AQ
and perform A = A-M (means add 2’s complement of M to A and store it to A)
Step-4: Again the sign bit of register A
Step-5: If sign bit is 1 Q[0] become 0 otherwise Q[0] become 1 (Q[0] means least
significant bit of register Q)
Step-6: Decrements value of N by 1
Step-7: If N is not equal to zero go to Step 2 otherwise go to next step
Step-8: If sign bit of A is 1 then perform A = A+M
Step-9: Register Q contain quotient and A contain remainder
Examples: Perform Non-Restoring Division for Unsigned Integer
Dividend =11
Divisor =3
-M =11101
N M A Q Action
Quotient = 3 (Q)
Remainder = 2 (A)
Flowchart:
Program:
comp_M = compliment(M)
if (A[0] == '1'):
flag = 'unsuccessful'
print ('A:', A, ' Q:', Q,
' -Addition in next Step')
else:
flag = 'successful'
print ('A:', A, ' Q:', Q,
' -Subtraction in next step')
count -= 1
print ('\nQuotient(Q):', Q,
' Remainder(A):', A)
# Driver code
if __name__ == "__main__":
dividend = '0111'
divisor = '0101'
nonRestoringDivision(dividend,
divisor,
accumulator)
Output:
Conclusion: Hence we have implemented non-restoring division algorithm.
QUESTIONS :
The advantage of using non-restoring arithmetic over the standard restoring division is that a
test subtraction is not required; the sign bit determines whether an addition or subtraction
is used. The disadvantage, though, is that an extra bit must be maintained in the partial
remainder to keep track of the sign
restoring method: you add the divisor back, and put 0 as your next quotient digit.
non-restoring method: you don't do that - you keep negative remainder and a digit 1, and
basically correct things by a supplementary
4.Which is the faster division algorithm?
Euclidean division
1. The dividend must be expressed as a 2n-bit 2‟s complement number. Thus, for example, the 4 bit
0111 becomes 00000111, and 1001 becomes 11111001.
3. It will not give the correct answer if the divisor is negative and the dividend is positive and vice
versa.
4. It will not give the correct answer if the both dividend and divisor are negative. Future scope of
non-restoring division algorithm is to divide two signed binary numbers.
❖ References
1. Computer Architecture and Organization - John P. Hayes
2. Computer Organization and Architecture - William Stallings
3. Digital Logic and Computer Design - M. Morris Mano. Pearson Education - Prentice
Hall.
4. Digital Principles Foundation of Circuit Design and Application - Arun Kumar Singh.
New Age Publishers.
5. The Art of Electronics - Paul Horowitz and Winfield Hill (1989). Cambridge
University Press
6. Modern Dictionary of Electronics - Rudolf F. Graf (1999). Newness
The End