Convert the following numbers to their floating point binary equivalent.

Click For Summary
SUMMARY

The discussion focuses on converting decimal numbers to their floating-point binary equivalents, specifically 18.25 and 1027.375. The correct binary representation for 18.25 is 10110.01, while 1027.375 is represented as 100000011.011. The conversation also touches on the IEEE 754 standard for floating-point representation, emphasizing the need for understanding single and double precision formats. Participants recommend consulting textbooks or reliable online resources for a deeper understanding of floating-point conversions.

PREREQUISITES
  • Understanding of binary number systems
  • Familiarity with IEEE 754 floating-point representation
  • Basic knowledge of decimal to binary conversion techniques
  • Experience with rounding binary numbers for precision
NEXT STEPS
  • Study IEEE 754 single and double precision formats
  • Practice converting various decimal numbers to binary
  • Learn about binary rounding techniques
  • Explore online calculators for floating-point conversions
USEFUL FOR

Students, software engineers, and data scientists who need to understand binary conversions and floating-point representation for programming and computational tasks.

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."
 

Similar threads

Replies
4
Views
2K
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
38K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 30 ·
2
Replies
30
Views
6K
Replies
9
Views
2K
  • · Replies 34 ·
2
Replies
34
Views
22K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K