REPRESENTATIONOFFLOATING – POINT Amit Jain(MCA) There are two type of arithmetic operations available in computer. These are:- 1.Integerarithmetic 2.Real or float point arithmetic Integer arithmetic deal with integer operands that is number withoutfractional part . It is usedmainly in counting and as subscripts. Real arithmetic uses numbers with fractional parts as operands and is used in most computation. Computer are usually designed such that each location called word, in memory storage only a finite no of digits .Consequently, all operands in arithmetic operations have only a finite number of digits. Let us assume a hypothetical computer having memory in which each location can store 6 digits and having provision to store one or moresigns. One method of representing real numbers in that computer would be to assume a fixed position for the decimal point. + One memory location or word

5

6

5

2

3

1

Sign

assumed decimal pt. position A memory location storing number5652.31 In such convention, the max and min. possible number to be stored are 9999.99 and 0000.01 respectively in magnitude . this range is quite inadequate in practice . Forthis, a new convention is adopted whish aims to preserve the max . number of significant digit in a real number and also increase the range of value of real number stored. This representation is called the normalised floating point mode of representing and storingreal numbers. In this mode a real number is expressed as a combination of mantissa and an exponent. The mantissa is made less 1or ≥.1 nad the exponent is the power of 10 which multiplies the mantissa . e.q. : The number43.76 x 106 is represented in this notation as 04376 E 8, where E 8 is used auto represent 108. The mantissa is .4376 and the exponent is 8. The number is stred in memory location as: Sign of mantissasize of exponent ++

4

3

7

6

0

8

Mantissaexponent implied decimal pt Moreover , the shifting of the mantissa to the left till its most significant digit is non-zero is called normalization. e.g.: :The number .006831 may be stored as .6831 E-2 because the leading zeros serve only to locate the decimal point. By doing so ,the range ofnumber that may be stored are .9999 x1099 to .1000x10-99 in magnitude which is obviously much larger than that used earlier in fixed point notation. This increment in range has been obtained by reducing the number of significant digits in a number by 2. ARITHMETIC OPERATIONS WITH NORMALISED FLOTING POINTNUMBER :- 1.Addition and Subtraction : If two numbers represented in normalised floatingpoint notation are to be added, the exponent5 of two number must be equal and the mantissa shifted appropriately. Example :- Add the following point number : .4546 E5 And .5433 E5 Sum is :-.9979 E5 If exponent power is not equal : .4546 E5And.5433 E7 Sum is:.5478 E7 Subtraction : Ex: 1).9432 E-4From .5452 E-3 Ans : .4509 E-3 Multiplication : Two numbers are multiplied in the normalised floating point mode by multiplying the mantissa and adding the exponent. After the multiplication of the mantissa, the result mantissa is normalized as in addition or subtraction operation and the exponent appropriately adjusted . Ex :- .5543 E12and.4111 E-15 Solution :.5543 E12 x.4111E-15=.2278E-3 Division : In division, the mantissa of the numerator is divided by that of the denominator. The denominator exponent is subtracted from the numerator exponent.The quotient mantissa is normalised to make the most significant digit non-zero and the exponent appropriately adjusted. The mantissa of the result is chopped down to occupy 4 digits. Example : .9998 E1 ÷ .1000 E-99== .9998 E 101

REPRESENTATION OF FLOATING – POINTAmit Jain (MCA)

There are two type of arithmetic operations available in computer. These are:-

1.Integer arithmetic2.Real or float point arithmeticInteger arithmetic deal with integer operands that is number without fractional part . It is used mainly in counting and as subscripts.

Real arithmetic uses numbers with fractional parts as operands and is used in most computation.

Computer are usually designed such that each location called

word,in memory storage only a finite no of digits .Consequently, all operands in arithmetic operations have only a finite number of digits.Let us assume a hypothetical computer having memory in which each location can store 6 digits and having provision to store one or more signs. One method of representing real numbers in that computer would be to assume a fixed position for the decimal point.

+One memory location or word

Sign

assumed

decimal pt.

position

A memory location storing number 5652.31In such convention, the max and min. possible number to be stored are 9999.99 and 0000.01 respectively in magnitude . this range is quite inadequate in practice .

For this, a new convention is adopted whish aims to preserve the max . number of significant digit in a real number and also increase the range of value of real number stored. This representation is called the

normalised floating pointmode of representing and storing real numbers.In this mode a real number is expressed as a combination of

mantissaand anexponent.The mantissa is made less 1or ≥.1 nad the exponent is the power of 10 which multiplies the mantissa .e.q.: The number 43.76 x 106 is represented in this notation as 04376E8, whereE 8is used auto represent 108. The mantissa is .4376 and the exponent is 8.The number is stred in memory location as:

Sign of mantissa size of exponent

+ +

implied

decimal pt

Moreover , the shifting of the mantissa to the left till its most significant digit is non-zero is called

normalization.e.g.: :The number .006831 may be stored as .6831 E-2 because the leading zeros serve only to locate the decimal point.By doing so ,the range of number that may be stored are .9999 x1099 to .1000x10-99 in magnitude which is obviously much larger than that used earlier in fixed point notation.

This increment in range has been obtained by reducing the number of significant digits in a number by 2.

ARITHMETIC OPERATIONS WITH NORMALISED FLOTING POINT NUMBER :-1.Addition and Subtraction :If two numbers represented in normalised floating point notation are to be added, the exponent5 of two number must be equal and the mantissa shifted appropriately.

Example :-Add the following point number :.4546 E5And .5433 E5Sum is :- .9979 E5If exponent power is not equal :

.4546 E5 And .5433 E7

Sum is: .5478 E7Subtraction :Ex: 1) .9432 E-4 From .5452 E-3Ans : .4509 E-3Multiplication :Two numbers are multiplied in the normalised floating point mode by multiplying the mantissa and adding the exponent. After the multiplication of the mantissa, the result mantissa is normalized as in addition or subtraction operation and the exponent appropriately adjusted .

Ex :- .5543 E12 and .4111 E-15Solution : .5543 E12 x.4111E-15=.2278E-3Division :In division, the mantissa of the numerator is divided by that of the denominator. The denominator exponent is subtracted from the numerator exponent. The quotient mantissa is normalised to make the most significant digit non-zero and the exponent appropriately adjusted. The mantissa of the result is chopped down to occupy 4 digits.

Example :.9998 E1

÷.1000 E-99 == .9998 E 101