Sunteți pe pagina 1din 14

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 : Basics of division of fixed point numbers
Teaching Aids to be used : ppts, flow Charts
CM303.28 1
RECAP

In the previous lesson, you have learnt about


• How to perform fixed point multiplication of two
numbers with suitable examples

CM303.28 2
Objective

On completion of this period, you would be able to know

The basics of division of numbers in signed

magnitude representation.

Explanation with the help of flowchart

CM303.28 3
Division of fixed point binary numbers

• Division of two fixed point binary numbers in


signed magnitude representation is done by a
process of successive shift and subtract
operations

CM303.28 4
Division of fixed point binary numbers
Contd..
Example:
Consider division of decimal nos.

dividend

divisor3)198(15 quotient
13
68
65
remainder 3

CM303.28 5
Division of fixed point binary numbers
Contd..
Similarly for binary numbers
1011)1 0 0 1 0 1 0 0(1101
1011
01111
1011
01000 0
101 1
10 1

After division 1101 will be Q (Quotient) and 1101 will be A


(remainder)

CM303.28 6
Division of fixed point binary numbers
Contd..
Let the divisor and dividend be loaded in register BR,AR.Q
Here Bs is sign of divisor and As is sign of dividend
BR=Bs.B AR=As.A QR=Qs.Q
The length of B,A,Q registers is n bits (4 here)
So sequence counter is set to 4

A0 A1A2A3 An B0 B1B2B3 Bn
B0=Bs

A0=As Q0=Qs
Q0 Q1Q2Q3 QN
The subtraction of divisor B from dividend A.Q can be performed
by 2’s complement method
Now the following steps can be written for division
CM303.28 7
B=1011
B’+1=0101 A.Q=1001 0100

SC Action E A Q Qn
initialization - 1001 0100 0
3 Shift left E.A.Q 1 0010 100X X
add B’+1 0101
1 0111 100X X
E=1,set Qn=1 1 0111 1001 1
7 Shift left E.A.Q 0 1111 001X X
add B’+1 0101
1 0100 001X X
E=1,set Qn=1 1 0100 0011 1
11 Shift left E.A.Q 0 1000 011X X
add B’+1 0101
0 1101 011X X
E=0,restore (add B) 1011
set Qn=0 1000 0110 0
16 Shift left E.A.Q 1 0000 110X X
add B’+1 0101
1 0101 110X X
E=1,set Qn=1 1 0101 1101 1
0 stop CM303.28 remainder Quotient 8
The sign of the quotient

Sign of Sign of
dividend divisor Sign of quotient
As Bs Qs
+ + +
+ - -
- + -
- - +

In signed magnitude representation + is shown by 1


and - is shown by 0
Hence we can infer sign of quotient as As ⊕ Bs

CM303.28 9
The Flowchart For Fixed Point Division
CM303.28 10
Summary

In this class , you have learnt …

• How to derive sign of Quotient from signs of


dividend and divisor

• How to divide two binary numbers

CM303.28 11
Frequently asked questions

1. Perform division for


dividend=-100 010
divisor =+101
Assuming the registers of 3-bit length for magnitude
(1st bit is sign and rest 3 are magnitude)

2.Explain the fixed point division of two numbers with


the help of flowchart.
CM303.28 12
Quiz

1. After fixed point division, the remainder will be


in ________ register.
b) Q
c) A
d) B
e) None

CM303.28 13
Quiz

2. After fixed point division, the quotient will be in


________ register.
b) Q
c) A
d) B
e) None

CM303.28 14

S-ar putea să vă placă și