Restoring (conventional) binary divide, twos complement 4-bit numbers
1 1 0 0 quotient
________________
0 1 1 1 / 0 1 0 1 0 1 0 1
-0 1 1 1 may subtract by adding twos complement
_______ - 0 1 1 1 is 1 0 0 1
5 - 7 = -2 1 1 1 0
negative, add 7 +0 1 1 1
restored _______
next bit 1 0 1 0
-0 1 1 1
_______
10 - 7 = 3 0 1 1 1
quotient=1, next bit -0 1 1 1
_______
7 - 7 = 0 0 0 0 0 0
quotient=1, next bit -0 1 1 1
_______
0 - 7 = -7 1 0 0 1
negative, add 7 +0 1 1 1
quotient=0 _______
restored, next bit 0 0 0 1
-0 1 1 1
_______
1 - 7 = -6 1 0 1 0
negative, add 7 +0 1 1 1
quotient=0 _______
restored, finished 0 0 0 1 final remainder
(8 cycles using adder)
Home
Posts filed under Restoring
Showing posts with label Restoring. Show all posts
Showing posts with label Restoring. Show all posts
Saturday, 1 June 2013
Program for Restoring Division.
Program for Implementation of Non-Restoring Algorithm.
non-restoring binary divide, twos complement 4-bit numbers
note: 7 = 0 1 1 1 -7 = 1 0 0 1
1 1 0 0 quotient
________________
0 1 1 1 / 0 1 0 1 0 1 0 1
pre shift +1 0 0 1 adding twos complement of divisor
_______
10 - 7 = 3 0 0 1 1 1
quotient=1 +1 0 0 1
next bit subtract _______
7 - 7 = 0 0 0 0 0 0
quotient=1 +1 0 0 1
next bit subtract _______
0 - 7 = -7 1 0 0 1 1
quotient=0 +0 1 1 1 adding divisor
next bit add _______
2 + 7 = 9 = -7 1 0 1 0
quotient=0 +0 1 1 1
correction add _______
final remainder 0 0 0 1 remainder
(5 cycles using adder)
Subscribe to:
Posts (Atom)