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

Binary numbers are used in the mantissa field, but they do not have to be. IBM u

ID: 3647727 • Letter: B

Question

Binary numbers are used in the mantissa field, but they do not have to be. IBM used base 16 numbers, for example, in some of their floating point formats. There are other approaches that are possible as well, each with their own particular advantages and disadvantages. The following table shows fractions to be represented in various floating point formats.

a. 1/3
b. 1/10

Write down the bit pattern in the mantissa assuming a floating point format that uses binary numbers in the mantissa (essentially what you have been doing in this chapter). Assume there are 24 bits, and you do not need to normalize. Is this representation exact?

Explanation / Answer

please rate - thanks

how to convert a fraction to binary

1/3 = .333

Step 1: Begin with the decimal fraction and multiply by 2. The whole number part of the result is the first binary digit to the right of the point.

Because .333= 0.666, the first binary digit to the right of the point is a 0.
So far, we have .333=.0??? . . . (base 2) .

Step 2: Next we disregard the whole number part of the previous result (the 0 in this case) and multiply by 2 once again. The whole number part of this new result is the second binary digit to the right of the point. We will continue this process until we get a zero as our decimal part or until we recognize an infinite repeating pattern.

Because .666 x 2 = 1.332, the second binary digit to the right of the point is a 1.
So far, we have .333 = .01?? . . . (base 2) .

Step 3: Disregarding the whole number part of the previous result (we multiply by 2 once again. The whole number part of the result is now the next binary digit to the right of the point.

Because .332 x 2 = .664, the third binary digit to the right of the point is a 0.
So now we have .333= .010?? . . . (base 2) .

One more time and we get that .333 decimal is .0101 binary

as you can see we keep going between .33 and .66 so

1/3 = .010101010101010101010101  

1/10= .1

Step 1: Begin with the decimal fraction and multiply by 2. The whole number part of the result is the first binary digit to the right of the point.

Because .1= 0.2, the first binary digit to the right of the point is a 0.
So far, we have .1=.0??? . . . (base 2) .

Step 2: Next we disregard the whole number part of the previous result (the 0 in this case) and multiply by 2 once again. The whole number part of this new result is the second binary digit to the right of the point. We will continue this process until we get a zero as our decimal part or until we recognize an infinite repeating pattern.

Because .2 x 2 = .4, the second binary digit to the right of the point is a 0.
So far, we have .1= .00?? . . . (base 2) .

Step 3: Disregarding the whole number part of the previous result (we multiply by 2 once again. The whole number part of the result is now the next binary digit to the right of the point.

Because .4 x 2 = .8, the third binary digit to the right of the point is a 0.
So now we have .1= .0100?? . . . (base 2) .

One more time and we get that .1 decimal is .0001 binary

keep doing this and we get

1/10= .000110011001100110011001