Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1) Convert the following binary and hexadecimal numbers to floating point format

ID: 3586710 • Letter: 1

Question

1) Convert the following binary and hexadecimal numbers to floating point format. Assume a binary format consisting of a sign bit (negative = 1), a base 2, 8-bit, excess-128 exponent, and 23 bits of mantissa, with the implied binary point to the right of the first bit of the mantissa.

a. 110110.0110112

b. 1.11110012

c. 4F7F16

d. 0.000000001111112

e. 0.1100 × 236

f. 0.1100 × 236

2) For the format used in Exercise 5.5, what decimal number is represented by each of the following numbers in floating point format?

1)C2F0000016

2)3C54000016

3) Represent the decimal number 171.625 in IEEE 754 format.

Explanation / Answer

Ans 1) The specified format for floating point numbers in this problem is the same as IEEE 754, with the exception that the mantissa leaves the leading digit rather than truncating it as is done in IEEE 754, since all non-zero mantissas in binary always have a leading 1.


a)110110.011011 in exponent notation is 1.10110011011 x 2^5
To square this, multiply the mantissa by itself and double the exponent.
1.10110011011 x 2^5
x1.10110011011 x 2^5
--------------
1.10110011011
.110110011011
.00110110011011
.000110110011011
.000000110110011011
.0000000110110011011
.000000000110110011011
.0000000000110110011011
--------------------------
10.1110010001101111011001 x 2^10
renormalizing and rounding to 23 significant digits gives:
1.0111001000110111101101 x 2^11


This is a positive number, so the sign digit is 0, and the binary point is already in the correct place for the given mantissa format. The exponent is excess-128, so the exponent field will be 128 + 11 = 139
139 in binary is 10001011

Therefore the completed number is:
0 10001011 10111001000110111101101


b) -1.1111001 squared is:

-1.1111001 x 2^0
x-1.1111001 x 2^0
------------------
1.1111001
.11111001
.011111001
.0011111001
.00011111001
.00000011111001
-------------------
11.11001000110001 x 2^0
renormalizing and extending to 23 significant digits gives:
1.1110010001100010000000 x 2^1

This is a positive number, so the sign digit is 0, and the binary point is already in the correct place for the given mantissa format. The exponent is excess-128, so the exponent field will be 128 + 1 = 129
139 in binary is 10000001

Therefore the completed number is:
0 10000001 11110010001100010000000

c) -4F7F in binary is
-100 1111 0111 1111
-1.00111101111111 x 2^14
to raise this to the 16th power, we must multiply the mantissa by itself 16 times and multiply the exponent by 16. Therefore, the final exponent will be at least 14*16 = 224
The largest exponent that can be held in this system is 255 - 128 = 127.
Therefore, since the needed exponent is larger than the largest possible, this number cannot be represented due to overflow.

d) 0.00000000111111 squared is:

1.11111 x 2^-9
x 1.11111 x 2^-9
-----------------
1.11111
.111111
.0111111
.00111111
.000111111
.0000111111
------------------
11.1110000001 x 2^-18
renormalizing and extending to 23 significant digits:
1.1111000000100000000000 x 2^-17

This is a positive number, so the sign digit is 0, and the binary point is already in the correct place for the given mantissa format. The exponent is excess-128, so the exponent field will be 128 + (-17) = 111
111 in binary is 01101111

Therefore the completed number is:
0 01101111 11111000000100000000000

e) 0.1100 x 2^36
renormalizing and extending to 23 significant digits:
1.1000000000000000000000 x 2^35

This is a positive number, so the sign digit is 0, and the binary point is already in the correct place for the given mantissa format. The exponent is excess-128, so the exponent field will be 128 + 35 = 163
163 in binary is 10100011

Therefore the completed number is:
0 10100011 11000000000000000000000

e) 0.1100 x 2^-36
renormalizing and extending to 23 significant digits:
1.1000000000000000000000 x 2^-37

This is a positive number, so the sign digit is 0, and the binary point is already in the correct place for the given mantissa format. The exponent is excess-128, so the exponent field will be 128 + (-37) = 91
91 in binary is 01011011

Therefore the completed number is:
0 01011011 11000000000000000000000

Ans 2) 1) -1.58457e+29

Ans 2) 2) 2.19903e+12

Ans 2) 3) 171.625
= 128 + 32 +
= 2^7 + 2^5 + 2^3 + 2^1 + 2^0 + 2^-1 + 2^-3
in binary, this number is:
10101011.101
renormalizing and extending to 24 significant digits:
1.01010111010000000000000 x 2^7

IEEE 754 format is identical to the format from 5.19, except that the leading digit of the mantissa is dropped. Therefore, the mantissa field of this floating-point number is:
01010111010000000000000

This is a positive number, so the sign digit is 0. The exponent is excess-128, so the exponent field will be 128 + 7 = 135
135 in binary is 10000111

Therefore the completed number is:
0 10000111 01010111010000000000000