# DEPARTMENT OF TECHNICAL EDUCATION ANDHRA PRADESH

Name Designation Branch Institute Year/Semester Subject Subject Code Topic : A Rajeswara Rao. : Head of Computer Engg. : Computer Engg. : GMR Polytechnic, Karimnagar. : III Semester : Computer Architecture : CM-303 : Information Representation, Arithmetic operations : 50 Mts : Fixed point addition/subtraction basics using signed CM303.23 1 : Animation clips & Images

Duration Sub. Topic Teaching Aids to be used

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
SUBTRACTION ADDITION S.No. 1 2 3 4 5 6 7 8 Operation (+A)+(+B) (+A)+(-B) (-A)+(+B) (-A)+(-B) (+A)-(+B) (+A)-(-B) (-A)-(+B) (-A)-(-B) Add Magnitudes +(A+B) -(A+B) +(A+B) -(A+B) Subtract magnitudes A>B A<B A=B +(A-B) -(B-A) +(A-B) -(A-B) +(B-A)+(A-B) +(A-B) -(B-A) +(A-B) -

-(A-B) +(B-A)+(A-B)
6

CM303.23

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

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