MHB Convert the following numbers to their floating point binary equivalent.

AI Thread Summary
The discussion focuses on converting decimal numbers to their floating point binary equivalents. For the number 18.25, the correct binary representation is confirmed as 10010.01, where 18 is represented as 10010 and 0.25 as 0.01. The second number, 1027.375, is initially misrepresented as 10000000011.010, but the correct conversion is clarified as 100000011.011. The breakdown shows that 1027 equals 10000000011 and 0.375 translates to 0.011 in binary. Additionally, the conversation touches on the IEEE 754 floating-point standard, emphasizing the need for understanding its specifications for proper representation, including the significance of rounding and the arrangement of the exponent and significand in the final binary format. Resources for further reading and online calculators for floating-point conversion are also suggested.
shamieh
Messages
538
Reaction score
0
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:
Technology news on Phys.org
shamieh said:
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.
 
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."
 
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Thread 'Star maps using Blender'
Blender just recently dropped a new version, 4.5(with 5.0 on the horizon), and within it was a new feature for which I immediately thought of a use for. The new feature was a .csv importer for Geometry nodes. Geometry nodes are a method of modelling that uses a node tree to create 3D models which offers more flexibility than straight modeling does. The .csv importer node allows you to bring in a .csv file and use the data in it to control aspects of your model. So for example, if you...
Back
Top