2.83 Binary Floating Value

★★

Problem:

Consider numbers having a binary representation consisting of an infinite string of the form 0.yyyy..., where y is a k-bit sequence. For example, the binary representation of 1/3 is 0.01010101...(y=01), while the representation of 1/5 is 0.001100110011...(y=0011).

A. Let Y=B2Uk(y), that is, the number having binary representation y. Give a formula in terms of Y and k for the value represented by the infinite string. Hint: Consider the effect of shifting the binary point k positions to the right.

n=0.yyyyyyy...
n<<k=y.yyyyy...=Y+n
(n<<k)-n=Y
n*2^k-n=Y
n=Y/(2^k-1)

B. What is the numeric value of the string for the following values of y?

(a) 101

Y=5, k=3, n=5/7

(b) 0110

Y=6, k=4, n=6/15=2/5

(c) 010011

Y=19, k=6, n=19/63

Last updated