Write down the binary representation of the decimal number 6

Write down the binary representation of the decimal number 63.25, assuming single precision format.

Solution

As you may know, IEEE754 single precision numbers are made of three parts: sign (1-bit), exponent (8-bit) and mantissa (23-bit). For simplicity, let\'s assume we deal with normalized numbers all the time. The equation is the following: (-1)^(SIGN) * 1.MANTISSA * 2^(EXPONENT-127) Let\'s do an example. Say we have the following IEEE754 number in binary format: 1 11000000 11011100000101111110111 The sign bit is 1, which means the number is negative. The exponent is 11000000, which converts to 192 in decimal (1x2^7 + 1x2^6). We subtract 127 (this is an offset which is added to allow negative value as well) and we get 65. The mantissa is 11011100000101111110111. When the number is normalized, we have an implicit 1 on the left followed by a point and the number which leads to: 1.11011100000101111110111 This is a fractional binary number and it is converted as follows: 1 x 2^0 +
1 x 2^-1 +
1 x 2^-2 +
0 x 2^-3 +
1 x 2^-4 +
1 x 2^-5 +
1 x 2^-6 +
0 x 2^-7 +
0 x 2^-8 +
0 x 2^-9 +
0 x 2^-10 +
0 x 2^-11 +
1 x 2^-12 +
0 x 2^-13 +
1 x 2^-14 +
1 x 2^-15 +
1 x 2^-16 +
1 x 2^-17 +
1 x 2^-18 +
1 x 2^-19 +
0 x 2^-20 +
1 x 2^-21 +
1 x 2^-22 +
1 x 2^-23 Which is equal to approximately 1.859740138 So now we have -1 * 2^65 * 1.859740138 = -6.86123E19 Here you go! This is very long to do by hand so I suggest you use a converter that supports IEEE754 to speed up conversion

 Write down the binary representation of the decimal number 63.25, assuming single precision format.SolutionAs you may know, IEEE754 single precision numbers ar

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site