Sei sulla pagina 1di 20

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 floating point addition / subtraction
Teaching Aids to be used : Ppts

CM303.30 1
RECAP

In the previous class, you have learnt


• The steps for division of numbers in signed
magnitude representation

CM303.30 2
Objective

On completion of this period , you would be able


to learn
• Normalization of floating point number.
• How to represent floating point number.
• How to perform add/subtraction operations and
floating point.

CM303.30 3
Add/subtract operation
To perform add/ subtracting operation, the floating point
numbers need two registers one holding mantissa and the
other exponent
Eg.
The number 0.1011001X2-3 is represented using two
registers as

01011001 1011

Reg A Reg a

mantissa exponent

CM303.30 4
Add/subtract operation
Contd..
Here Reg A is assumed to be 8 bit
And Reg a is assumed to be 4 bit

Mantissa+0.1011001 is represented in signed magnitude


form of 8 bits as
0.1011001

Exponent –3 (-112) is represented in signed magnitude form


of 4 bits as 1011

CM303.30 5
Add/subtract operation
Contd..
Eg:
Similarly The number
-0.1010001X24 can be represented as

11010001 0100

Reg A Reg a

mantissa exponent

CM303.30 6
Add/subtract operation
Contd..
Here Reg A is assumed to be 8 bit
And Reg a is assumed to be 4 bit

mantissa –0.1010001 is represented in signed


magnitude form of 8 bits as
1.1010001
Exponent +100 is represented in signed magnitude
form of 4 bits as 0100

CM303.30 7
Add/subtract operation
Contd..
Normalization:
The representation of a floating point number is said
to be in normalized form if it is in the form of

b0.b1b2b3b4.. Ee0e1e2e3..
Where
b0 is sign bit of mantissa
b1=1
e0 is sign of exponent
e1e2e3e4.. Is magnitude of exponent
Add/subtracting operation

CM303.30 8
Add/subtract operation
Contd..
Example:-

The number 0.001101X23 can be normalized to


0.1101X23-2=0.1101X21

CM303.30 9
Addition/subtract
Contd..

For two floating point numbers to be added their


mantissa must be aligned such that the
exponents become equal.

CM303.30 10
Addition/subtract
Contd..
Eg:
case 1: Exponents are equal
operand 1 0.1234
operand 2 0.2345*10-3
the sum is 0.9753*10-3
As
0.1234
0.2345
0.9753

CM303.30 11
Addition/subtract
Contd..
Eg:
case 2: Exponents are equal
operand 1
0.9234X10-3
operand 2 0.8345X10-3
the sum is 0.9753X10-3

operand2 has lower exponent

CM303.30 12
Addition/subtract
Contd..
Right shift its magnitude once and
increment its exponent by 1
We get
operand2 0.08345X103
the sum is 1.00685X103
0.92340
0.08345

1.00685
Which can be normalized as 0.100685X104

CM303.30 13
Addition/subtract
Contd..
Eg:
case 3:singns of operands are different
operand 1
0.1234X102
operand 2 - 0.2345X102
9’s complement of 0.2345 is 9.7654
add 1 1
10,s complement 9.7655

add to 0.1234 0.1234


9.7655
CM303.30
9.8889 14
Addition/subtract

Contd..

Carry is not produced. Find 10’s complement


And add negative sign to get result
0.1110
+ 1
-0.1111
Hence the final result is –0.1111X102

CM303.30 15
For binary numbers the same procedure is
followed

CM303.30 16
Summary

In this class , you have learnt …

• How to add/subtract floating point numbers

CM303.30 17
Quiz

• The normalized form of 0.000110101X24 is


• 0.110101X2
• 0.00110101X22
• 0.00110101X23
• 0.110101X24

CM303.30 18
Quiz

• The normalized form of 0.000110101X24 is


• 0.110101X2
• 0.00110101X22
• 0.00110101X23
• 0.110101X24

CM303.30 19
Frequently asked questions
1. Perform addition between the numbers
i) 0.1010111E0110
0.1110101E0100
ii) 1.1011000E1001
0.1000111E1110

2. Perform subtraction between the numbers


ii) 1.1000101E1001
0.1100111E0001
iv) 1.1000011E0010
1.1100010E0001
CM303.30 20

Potrebbero piacerti anche