Anda di halaman 1dari 17

DEPARTMENT OF TECHNICAL EDUCATION

ANDHRA PRADESH
Name : A Rajeswara Rao
Designation : Head
Branch : Computer Engg
Institute : GMR Polytechnic, Karimnagar
Year/Semester : III Semester
Subject : Computer Architecture
Subject Code : CM-303
Topic : Arithmetic operations
Duration : 50 Mts
Sub. Topic : Explain the flow chart for division of fixed point
numbers
Teaching Aids to be used : Ppts, flow Charts

1
CM303.29
Recap

In the previous class, it is learnt that

• How division of two fixed point binary numbers in

signed magnitude representation in done.

• The process used in successive shift and subtract

operations.

CM303.29 2
Objective

On completion of this class , you would be able to


learn
The steps for division of numbers in signed
magnitude representation.

CM303.29 3
Now we can write steps for fixed point
division in the form of a flow chart as
follows.

CM303.29 4
Divide operation DIVIDE MAGNITUDES

Shl EAQ
Dividend in A.Q
Divisor in B =0 =1
E
DIVISION


OF
Qs=As Bs EA A+B’+1 MAGNITUD
EA A+B’+1 ES
SC n-1

E =1
EA A+B’+1 A<B =0 A>=B
TESTING
OF DIVIDE EA A+B Qn 1
OVERFLOW =1 =0
CONDITION
A>=B E
A<B SC SC-1

EA A+B EA A+B =0 <>0


DVF 1 DVF 0 SC

END
END (QUOTIENT IN QR
(DIVIDE REMAINDER IN A)
OVERFLOW) Fig.1 CM303.29
5
Analysis

• The dividend is in A.Q

• The divisor is in B
•The sign of the result is transferred into Qs to
be part of the quotient.
•SC is set to specify the no. of shift & subtract
operations(n-1)

CM303.29 6
Analysis
Contd..

Divide overflow condition is tested by


subtracting divisor in B from half the bits of
the dividend stored in A

CM303.29 7
Analysis
Contd..

If carry flag is set (E=0) then A>=B and


divide overflow (DVF) is set and the
operation is terminated

Else (E=0) no divide overflow occurs, so


the value of dividend is restored by adding
B to A. CM303.29 8
Analysis
Contd..

The division of magnitudes starts by shifting the


dividend in A.Q to the left with the hig order bit
shifted into E.

CM303.29 9
Analysis
Contd..

If the bit shifted into E is 1, EA>B because

EA consists of a 1 followed by (n-1) bits.

while B consists of only (n-1) bits.

In this case ,B must be subtracted

from EA and 1 inserted into Qn for quotient

bit.
CM303.29 10
Analysis
Contd..

If the left shift operation inserts a 0 into E, the


divisor is subtracted by adding its 2’s
complement value and the carry is transferred
into E.
If E=1, it indicates that A>=B,
and hence Qn is set to 1
If E=0, it indicates that A<B and the
original number is restored by adding B to A.
In this case a 0 is inserted into Qn.
CM303.29 11
Analysis
Contd..

This process is repeated with register A


holding the partial remainder.
After (n-1) times,
the quotient is formed in Q
the remainder is formed in A

CM303.29 12
Analysis
Contd..

Finally the Remainder is in register - A


Quotient in register - Q.

CM303.29 13
Summary

In this class , you have learnt …

• The steps for fixed point division with the help of


flow chart

CM303.29 14
Frequently asked
questions

• Draw flowchart for fixed point division and


explain

CM303.29 15
QUIZ

1. Divide overflow condition is treated by


b) Subtracting divisor from dividend
c) Subtracting divisor from half the bit of dividend
d) Subtracting dividend from divisor
e) None

CM303.29 16
QUIZ
Contd..

1. Divide overflow condition is treated by


• Subtracting divisor from dividend
• Subtracting divisor from half the bit of
dividend
• Subtracting dividend from divisor
• None

CM303.29 17

Anda mungkin juga menyukai