Académique Documents
Professionnel Documents
Culture Documents
7
8
(c) (792)10
2. Convert the following decimal numbers to octal numbers.
(a) 37.1
(b) 12.34
(c) 3.14
(d) 23.38
(e) 75.231
(f) 57.231
3. Convert the following binary numbers to octals and then to decimal
numbers.
(a) (110 111 001.101 011 101)2
(b) (1 001 100 101.011 01)2
4. Convert the following numbers as required.
(a) (100 101 101)2 = (
(b) (0.782)10 = (
(c) (47)10 = (
(d) (0.47)10 = (
(e) (51)10 = (
(f) (0.694)10 = (
)8 = (
)8 = (
)8 = (
)2
)2
)8 = (
)8 = (
)2
)2
)8 = (
)2
)10
)2 = (
)10
1
)8 = (
)10
(i) (45753.127664)8 = (
)2 = (
)10
5. Convert x = (0.6)10 first to octal and then to binary. Check your result
by converting directly to binary.
6. Prove that the decimal number
the binary system.
1
7
(f) 987.0054321
(g) 385.65
(h) 102
11. Identify the decimal floating point numbers corresponding to the following bit strings in the IEEE single precision system:
(a) 0 00000000 00000000000000000000000
(b) 1 00000000 00000000000000000000000
(c) 0 11111111 11111111111111111111111
(d) 1 11111111 11111111111111111111111
(e) 0 00000001 00000000000000000000000
(f) 0 10000001 11110000000000000000000
(g) 0 01111111 00000000000000000000000
(h) 0 01111011 11111001100110011001101
12. In the IEEE single precision system, what are the bit-string representation for the following sub-normal numbers?
(a) 2128 + 2139
(b) 2132 + 2145
(c) 2129 + 2130
P149
k
(d)
k=127 2
13. Determine the decimal numbers that have the following IEEE single
precision system representations:
(a) [3F 27E520]16
(b) [CA3F 2900]16
(c) [C705A700]16
(d) [494F 96A0]16
(e) [4B187ABC]16
(f) [45223000]16
(g) [45607000]16
3
(h) [C553E100]16
(i) [437F 0001]16
14. Convert the greatest positive element in single precision to an octal
number o and write it in normalized floating point notation. Convert then the resulting o to a decimal number d and write it in
normalized floating point notation.
15. (a) Identify the binary number x whose 32 bit-string representation
in single precision is as follows:
1 00000001 00000000000000000000000
(b) Find the next largest and smallest machine numbers in single precision for the number x given above, then write their hexadecimal
representation.
16. Consider the binary number b = 1.01 2+128 .
(a) Write the machine number representing b in IEEE double precision, then write its corresponding hexadecimal representation.
(b) Write the machine number representing b in IEEE single precision,
then write its corresponding hexadecimal representation.
(c) Let xM be the midpoint of the interval [0, b]. Write the machine
number representing xM in IEEE single precision, then write its
hexadecimal representation.
17. Consider the binary number b = 2127 + 2130 .
(a) Write the machine number representing b in IEEE single precision,
then write its corresponding Hexadecimal representation.
(b) Find the successor of b (y = succ(b)) in IEEE single precision,
then write its corresponding machine number and Hexadecimal
representation.
(c) Write the machine number representing b in IEEE double precision, then write its corresponding hexadecimal representation.
(d) Find the predecessor of b (x = pre(b)) in IEEE double precision,
then write its corresponding machine number and hexadecimal
representation.
4
18. For some values of x, the following functions cannot be accurately computed by using the given formula. Explain and find a way around the
difficulty.
(a) f (x) = x2 + 1 x
(b) f (x) = x4 + 4 2
(c) f (x) = x + 2 x
1
(sinh x
x3
ex ex
ex +ex
tanh x)
21. For some values of x, the following functions cannot be accurately computed by using the given formula. Explain and find a way around the
difficulty.
(a) f (x) = ln(x) 1
(b) f (x) = ln x ln (1/x)
(c) f (x) = x2 (sin x ex + 1)
(d) f (x) = ex e
22. Let f (x) = ln(x + x2 + 1). Show how to avoid loss of significance in
computing f (x) when x is negative. Hint: Compute first f (x).
5
x2 1 cannot be
(ex 1)sin x
x2
(a) For some values of x the function f (x) cannot be accurately computed by using the given formula. What are the non-negative
values of x that cause the problem? What remedy do you propose?
(b) Use the first 2 terms only of the Taylors series derived in (a), to
approximate f (104 ) in F (10, 5, 15, +15), rounding to the closest.
(c) Find the absolute relative error in this approximation if the exact
value of f (104 ) is 0.50003333807.....
25. Let
f (x) =
ex ex
x
(b) e3 =
1
e3
1
3i
i=0 i!
P5