with correct selected answer solution Concordia University
Problem Set #1
Multiple Choice
Test
Chapter 01.05 Floating Point
Representation COMPLETE SOLUTION
SET
1. A hypothetical computer stores real numbers in floating point format in
8-bit words. The first bit is used for the sign of the number, the second bit
for the sign of the exponent, the next two bits for the magnitude of the
exponent, and the next four bits for the magnitude of the mantissa.
Represent e 2.718 in the 8-bit format.
(A) 00010101
(B) 00011010
(C) 00010011
(D) 00101010
Solution
The correct answer is (A).
Finding 2 10 ? 2
Quotient Remainde
r
2/2 1 0
1/2 0 1
Hence 2 10 10 2
Finding 0.718 10 ? 2
Number Number after Number before
decimal decimal
0.718 2 1.436 0.436 1
0.436 2 0.872 0.872 0
0.872 2 1.744 0.744 1
0.744 2 1.488 0.488 1
0.718 2.718 10 10.101 2
10
0.101 1.0101 2
2
, 1.0101
2
1 10
2
01 2
2
Bits in mantissa
0101 Bits in
exponent 01 Sign
number bit 0 Sign
exponent bit 0
The final floating point representation is 00010101.
,2. A hypothetical computer stores real numbers in floating point format in
8-bit words. The first bit is used for the sign of the number, the second bit
for the sign of the exponent, the next two bits for the magnitude of the
exponent, and the next four bits for the
magnitude of the mantissa. The base-10 number represents in the above
(10100111)2
given 8-bit format is
(A) -5.75
(B) -2.875
(C) -1.75
(D) -0.359375
Solution
The correct answer is (A).
The number is 10100111
Sign number bit 1
Sign of number is
negative Sign exponent
bit 0
Sign of exponent is
positive Bits in
exponent 10
10 2 1 21 0 20
2 10
Bits in mantissa 0111
1.0111 2 1 20 0 2 1 1 2 2 1 2 3 1 2 4
(1.4375)10
Hence, the number in base-10 is
= 1.4375 22
5.75
, 3. A hypothetical computer stores floating point numbers in 8-bit words.
The first bit is used for the sign of the number, the second bit for the sign
of the exponent, the next two bits for the magnitude of the exponent, and
the next four bits for the magnitude of the mantissa. The machine epsilon
is most nearly
8
(A) 2
4
(B) 2 3
2
(C) 2
2
(D)
Solution
The correct answer is (B).
The machine epsilon is
number of bits for mantissa
mach 2
24