Floating Point Representation PDF

Title Floating Point Representation
Author Bumble Bee
Course Digital Design and Computer Organization
Institution PES University
Pages 5
File Size 225.5 KB
File Type PDF
Total Downloads 103
Total Views 146

Summary

Prof. Mahesh...


Description

Subject: Computer Organization

Arithmetic- Floating Point Representation

3.6 Floati bers aand Oper 3.6.. Floati atingngng-Poi Poi Point nt Nu Num mbers nd Oper perati ati ation on onss 3. 3.6. 6. 6.1 1 Floa Floating ting Poin Pointt Repr Repres es esenta enta entation tion Wh Whyy Fl Floatin oatin oatingg PPoin oin ointt Rep Repres res resent ent entation ation ne needed eded eded?? So far we have seen how a decimal number is represented in binary and how it is classified as signed and unsigned, represented and how they are stored Ex: (65535)10 = 0xFFFF = 1111 1111 1111 1111, It uses 2 bytes of memory location to store. But, How about storing a small number like 0.0 0.0000 000 0000000 0000 000000 00 005 5 =0 =0.5 .5 x10-10 or How about storing a large number like 500 500000 000 000000 000 000000 000 =5 x 1011 If Conventional Binary Representation is used –The Number need to Converted into Binary and then need to be stored in memory.. This requires large number of bits to represent the very small or large value as shown above. Can we rep repres res resent ent thes these eb byy us using ing Fixed Si Size ze Mem Memor or ory? y? Yes, There are standard representation to do and are called Floating Point Representation defined by IEEE commonly used in all processors There are three standards used for floating point number representation defined by IEEE Prec Precisi isi ision on

Sign

Exp Exponen onen onentt

Ma Mantiss ntiss ntissaa

Tot Total al

Sing Single le Doub Double le Long dou doub ble

1 1 1

8 11 15

23 52 64

32 64 80

a. Single Precision - 32 bit Number representation It is called a single-precision representation becau because se it occu occupie pie piess a ssingl ingl ingle e 3232-bit bit w word ord ord. The scale −126 +127 38. ± factor has a range of 2 to 2 , which is approximately equal to 10 IEEE 32 bit Number Floating Point representation is as shown below 31

30

23

22

0

S E’ M where,  Bit 31: S- Sign bit If S=1 – It means it has a Negative Sign and S=0 – It means it has a Positive Sign  Bit [3 [30:2 0:2 0:23] 3] 3]:: 8 bit Sign exponent bits in excess 127 representation We need both positive and negative integers and , we keep two integers for special cases, so we have 254 left to cover -126 to +127 (Actual sign exponent E excluding special cases). The actual Sign exponent, E, is in the range −126 ≤ E ≤ 127. The use of the excess-127 representation for exponents simplifies comparison of the relative sizes of two floating-point numbers. Instead of the actual signed exponent, E, the value stored in the exp exponen onen onentt field is an un unsig sig signed ned integ integer er

Subject: Computer Organization

Arithmetic- Floating Point Representation

E’ = E + 127 127. This is called the excess-127 format. In this, 127 is exponent bias, added to the actual exponent ( E ) and stored in exponent filed and is called exces excesss 127 representation (E’) which iss an u unsi nsi nsigne gne gned d int intege ege egerr . Therefore, the range of E’ for normal values is -126+1 126+127 27 27=1 =1 ≤ E’ ≤

127 127+12 +12 +127=25 7=25 7=254 4 & E’ inclu includin din dingg speci special al case casess is in the rang range e 0 ≤ E’ ≤ 255. The end values of this range, 0 and 255, are used to represent special values, as described later. Therefore, the range of E for normal values is 1 ≤ E ‘≤ 254.  Bit [2 [22:0 2:0 2:0]: ]: 23 bit mantissa fraction 23 bits, M, are the fractional part of the significant bits. The full 24-bit string, B, of significant bits, called the mantissa, always has a leading 1, with the binary point immediately to its right. Therefore, the mantissa B = 1.M = 1.b-1 b-2b-3 .......b-23 has the value V(B) = 1 + b−1 × 2−1 + b−2 × 2−2 +・ ・ ・+b−23 × 2−23 Exam Examp ple (1 (1): ):

Value Represented = ± 1.M x 2E’-127 0 0 1 0 1 0 0 7 6 5 4 3 2 2 2 2 2 2 2 21 Value Represented = ±1.001010….. X 240-127 = ±1.001010….. X 2-87 Exam Examp ple (2)

0 20 = 25 + 23 = 32 + 8 = 440 0

Subject: Computer Organization

Arithmetic- Floating Point Representation

Exam Examp ple (3 (3))

b. Double Precision – 64 bit Number representation It is called a Double-precision representation becau because se it occ occupi upi upies es a Tw Two o 32-b -bit it word. The scale −1022 +1023 308. ± factor has a range of 2 to 2 , which is approximately equal to 10 IEEE 32 bit Number Floating Point representation is as shown below 63 S

62 E’

52

51 M

0

where,  Bit 63: S- Sign bit If S=1 – It means it has a Negative Sign and S=0 – It means it has a Positive Sign  Bit [6 [62: 2:52]: 111 1 bit Sign exponent bits in excess 1023 representation The actual Sign exponent, E, is in the range −1022 ≤ E ≤ 1023. The use of the excess-1023 representation for exponents simplifies comparison of the relative sizes of two floating-point numbers. Instead of the actual signed exponent, E, the value stored in the exp exponen onen onentt field is an un unsig sig signed ned integ integer er E’ = E + 1023 1023. This is called the excess-1023 format. Thus, E’ is in the rang range e 0 ≤ E’ ≤ 2046 2046. The end values of this range, 0 and 2046, are used to represent special values, as described later. Therefore, the range of E for normal values is 1 ≤ E ‘≤ 2046.

Subject: Computer Organization

Arithmetic- Floating Point Representation

 Bit [5 [51:0 1:0 1:0]: ]: 52 bit mantissa fraction 52 bits, M, are the fractional part of the significant bits. The full 52-bit string, B, of significant bits, called the mantissa, always has a leading 1, with the binary point immediately to its right. Therefore, the mantissa

Subject: Computer Organization

Arithmetic- Floating Point Representation...


Similar Free PDFs