Welcome to our community

Be a part of something great, join today!

Convert the following numbers to their floating point binary equivalent.

shamieh

Active member
Sep 13, 2013
539
Convert the following numbers to their floating point binary equivalent.

Can someone check my work?

a) 18.25

so I got 10010.01

I couldn't find an online conversion calculator anywhere.

can you also check my answer for this one?

b) 1027.375

I got

10000000011.010
 
Last edited:

HallsofIvy

Well-known member
MHB Math Helper
Jan 29, 2012
1,151
Convert the following numbers to their floating point binary equivalent.

Can someone check my work?

a) 18.25

so I got 10010.01
0.25= 1/4 which is "0 times 1/2+ 1 times 1/2^2.
that is, .25= 0.01.
18= 16+ 2= 1(2^4)+ 0(2^3)+ 1(2^2)+ 1(2)+ 0(1)
so 18 is 10110.
Yes, 18.25 is 10110.01 in base 2.

]I couldn't find an online conversion calculator anywhere.

can you also check my answer for this one?

b) 1027.375

I got

10000000011.010
0.375 is 3/8= (2+ 1)/8= 1/4+ 1/8= 0(1/2)+ 1(1/4) + 1(1/8) so that is 0.011
What you have is 0.010= 0(1/2)+ 1(1/4)+ 0(1/8).

1027= 1024+ 3= 2^{10}+ 2+ 1 so that is 10000000011
so 1027.375 is 100000011.011. What you have is the binary expression of 1027.25.
 

Evgeny.Makarov

Well-known member
MHB Math Scholar
Jan 30, 2012
2,492
Concerning the floating point, if you mean the IEEE 754 standard, the result depends whether you need single or double precision. I'll quote my response to a similar question from a different forum.

"Understanding IEEE 754 floating-point specification requires some time and effort. You should read your textbook or lecture notes, or at least Wikipedia pages about floating point and single-precision floating-point format.

First you need to convert 176.2058 to binary: 10110000.00110100101011110100111100001100...2. Next you round it to 24 bits: 10110000.0011010010101111. In the final representation, the decimal point should be after the first bit: 1.01100000011010010101111 * 27. The exponent is stored as the sum of 7 (or whatever it is for a given number) and 127, i.e., 134 in this case. In binary, 134 = 100001102. The first bit of significand is always 1, so it is not recorded, which leaves 23 bits. The final representation consists of the sign bit (0 means +1), the exponent and the significand. Thus, it is

0 10000110 01100000011010010101111.

Here are a couple of online calculators that can compute floating-point representation."