You are on page 1of 13

DEPARTMENT OF TECHNICAL EDUCATION

ANDHRA PRADESH
Name : A Rajeswara Rao.

Designation : Head of Computer Engg.

Branch : Computer Engg.

Institute : GMR Polytechnic, Karimnagar.


Year/Semester : III Semester
Subject : Computer Architecture
Subject Code : CM-303
Topic : Information Representation, Arithmetic

operations
Duration : 50 Mts
Sub. Topic : Fixed point addition/subtraction basics using
signed
CM303.23 1
Teaching Aids to be used : Animation clips & Images
Objective

On completion of this period, you would be able


to know

• How fixed point addition & subtraction can be performed

using signed magnitude representation

CM303.23 2
Recap

In the previous class, we have learnt about :


• Various addressing modes

CM303.23 3
Representation of fixed point numbers
operations
Let the operations be performed on fixed point
numbers in signed magnitude representation
Let the two n-bit numbers are represented in two registers
AR,BR

AR: As.A
BR: Bs.B

Where As,, Bs are sign bits and A,B are (n-1) bit magnitudes

CM303.23 4
OBSERVATIONS

Let different situations of signs As,Bs be considered

for operations of addition and subtraction.


The results can be tabulated as stated in the table
below.

CM303.23 5
Addition and subtraction of signed magnitude
numbers
Add Subtract magnitudes
S.No. Operation Magnitudes A>B A<B A=B
SUBTRACTION ADDITION

1 (+A)+(+B) +(A+B) - - -
2 (+A)+(-B) - +(A-B) -(B-A) +(A-B)
3 (-A)+(+B) - -(A-B) +(B-A)+(A-B)
4 (-A)+(-B) -(A+B) - - -
5 (+A)-(+B) - +(A-B) -(B-A) +(A-B)
6 (+A)-(-B) +(A+B) - - -

7 (-A)-(+B) -(A+B) - - -
8 (-A)-(-B) - -(A-B) +(B-A)+(A-B)

CM303.23 6
Addition and subtraction of signed magnitude
numbers
It can be observed that during addition
•If signs of AR and BR are same magnitudes A,B are added
and sign As of AR is retained

•If signs of AR and BR are different the difference is found

and sign As of AR is retained if A>B


or
sign As of AR is complemented if A<B
CM303.23 7
Addition and subtraction of signed magnitude
numbers
It can be observed that during subtraction

•If signs of AR and BR are different magnitudes A,B are


added and sign As of AR is retained.

•If signs of AR and BR are same the difference is found and


sign As of AR is retained if A>B.
or
sign As of AR is complemented if A<B.

CM303.23 8
Addition and subtraction of signed magnitude
numbers
• It can be concluded for case of sign of result that
• if a sum is calculated between magnitudes the sign of AR (As)

is retained.
•if a difference is calculated between magnitudes the sign of
AR (As) is retained if A>B, and complemented if A<B

CM303.23 9
Summary
In this class , you have learnt …

• Basics of addition,subtraction of signed magnitude


numbers

CM303.23 10
Frequently asked questions

1. Describe the procedure how two fixed point


numbers are added in signed magnitude
representation.
2. Describe the procedure how two fixed point
numbers are subtracted in signed magnitude
representation.

CM303.23 11
Quiz

1. If both the signs are same, ________ can be


done in a fixed point addition of two numbers.
b) Addition
c) Subtraction
d) Multiplication
e) None

CM303.23 12
2. If the signs are different, _________ can be
done in a fixed point subtraction of two
numbers.
b) Addition
c) Subtraction
d) Multiplication
e) None

CM303.23 13

You might also like