Sunteți pe pagina 1din 2

Explain the single precision floating point single IEEE 754 representation. Represent the number (63.

125)10 using IEEE 754


single precision and double precision representations.

Single Precision

S stands for Sign (white color)


E stands for Exponent (yellow color)
N stands for Number (also called Mantissa or Significand) (green color)

0this Sign bit (1 bit)


1st to 8this Exponent bits (7 bits)
9thto 31this Exponent bits (24 bits)
Double Precision

S stands for Sign (white color)


E stands for Exponent (yellow color)
N stands for Number (also called Mantissa or Significand) (green color)

0this Sign bit (1 bit)


1st to 11this Exponent bits (10 bits)
12thto 63this Exponent bits (53 bits)

First of all to represent we have (63.125)10 using IEEE 754


Since number is a positive number
Sign bit is: 0
0
Now let’s work on Mantissa part
Convert 63 into binary form i.e 11111
Remaining is fraction part 0.125
Now we multiply fraction value with 2 till we get whole number 1 at the end.
We reach 1 so we stop
Write number from top to bottom
We get 0.125 = 001
Number (63.125)10 = (11111.001)2
Convert Binary number to Exponent Form
11111.001 Will be 1.1111001 * 24
Discard 1.
Take 1111001 as Significand
Significand number = (1111001)2
Significand bits are:
1 1 1 1 0 0 1

Fill the Significand in the beginning


Rest all fills it with 0’s
We will have
Significand bits are:
1 1 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

+4 is the Exponent
So we have to subtract it with 127
Exponent = 127-4=123
Exponent number (123)10 = (1111011)2
Exponent bits are:
1 1 1 1 0 1 1

Note: For positive number we take – (minus sign)


For negative number we take + (plus sign)
This is because we have 7 bits where the largest number we can save largest
Number (127)10 = (1111111)2 If we add even one number we will need 8 bits.

For Double Precision Only Exponent


+4 is the Exponent
So we have to subtract it with 1023
Exponent = 1023-4=1019
Exponent number (1019)10 = (1111111011)2
Exponent bits are:
1 1 1 1 1 1 1 0 1 1

Significand bits are:


1 1 1 1 0 0 1
Significand will only have a change in terms of Zero’s which are added at the end.
For single precision 23-7=16 Zero’s
For double precision 53-7=46 Zero’s
Note: For positive number we take – (minus sign)
For negative number we take + (plus sign)
This is because we have 10 bits where the largest number we can save largest
Number (1023)10 = (1111111111)2 If we add even one number we will need 11 bits.

S-ar putea să vă placă și