0% found this document useful (0 votes)
42 views

Div-1 Division Algorithm

This document describes how to perform two's complement division using a restoration technique. It shows the step-by-step process for dividing 7/3 and -7/3 as examples, tracking the dividend, divisor, quotient, and remainder at each step.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

Div-1 Division Algorithm

This document describes how to perform two's complement division using a restoration technique. It shows the step-by-step process for dividing 7/3 and -7/3 as examples, tracking the dividend, divisor, quotient, and remainder at each step.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

TWO’S COMPLEMENT DIVISION USING RESTORATION TECHNIQUE

1) Load M  Divisor, A,Q  Dividend


Dividend  2n bits
7/3
0000 0111
0011
2) Shift A,Q left 1 bit position
3) If A, M have the same sign, perform A A-M;
OTHERWISE: A A+M ( -7/3 , 7/-3)
4) If the operation is successful, if the sign of A is the same before and after the operation
a) If operation is successful, or A= 0, then set Q 0 1
b) If operation is unsuccessful or A !=0 , then set Q 0 0 , and restore the previous value
of A
5) Repeat 2-4 as many times as there are bit positions in Q
6) The Remainder  A
Quotient  Q

7/3
Dividend = A,Q => 0000 0111
M = 0011
-M = 1101

Prof. Tanvi Goswami,


D. D. University, Nadiad
A Q OPERATION
0000 0111 INITIAL VALUE
0000 111- SHIFT
1101 A<- A-M
1101
0000 1110 Q0 0, RESTORE A
0001 110- SHIFT
1101 A<- A-M
1110
0001 1100 Q0 0, RESTORE A
0011 100- SHIFT
1101 A<- A-M
0000
0000 1001 Q0 1
0001 001- SHIFT
1101 A<- A-M
1110
0001 0010 Q0 0, RESTORE A
REMAINDER QUOTIENT

7 / -3
M = 1101
+/+ => SUB
-/- => SUB
+/- => ADD
-/+ => ADD

A Q OPERATION
0000 0111 INITIAL VALUE
0000 111- SHIFT
1101 A<- A+M
1101
0000 1110 Q0 0, RESTORE A
0001 110- SHIFT
1101 A<- A+M
1110
0001 1100 Q0 0, RESTORE A
0011 100- SHIFT
1101 A<- A+M
Prof. Tanvi Goswami,
D. D. University, Nadiad
0000
0000 1001 Q0 1
0001 001- SHIFT
1101 A<- A+M
1110
0001 Q0 0, RESTORE A
0010

-7/ 3
7 = 0000 0111
A,Q = > -7 = 1111 1001
M= 0011

A Q OPERATION
1111 1001 INITIAL VALUE
1111 001- SHIFT
0011 A<- A+M
0010
1111 0010 Q0 0, RESTORE A
1110 010- SHIFT
0011 A<- A+M
0001
1110 0100 Q0 0, RESTORE A
1100 100- SHIFT
0011 A<- A+M
1111 1001 Q0 1
1111 001- SHIFT
0011 A<- A+M
0010
1111 0010 Q0 0, RESTORE A
REMAINDER QUOTIENT

D=Q*V+R

-7/-3

=> SUB

SIGN OF DIVIDEND = SIGN OF REMAINDER

Prof. Tanvi Goswami,


D. D. University, Nadiad
Prof. Tanvi Goswami,
D. D. University, Nadiad

You might also like