Converting 37.223_10 to hexadecimal/base 16.

  • Thread starter Thread starter s3a
  • Start date Start date
Click For Summary
To convert the decimal number 37.223 to hexadecimal, the whole part is calculated as 25 in hex. The fractional part conversion involves multiplying the decimal fraction by 16 repeatedly to extract each hex digit. The process reveals that the fractional part is approximately 0.3916872B in hex. The complete hexadecimal representation of 37.223 is thus 25.3916872B. This method effectively combines the whole and fractional conversions for accurate results.
s3a
Messages
828
Reaction score
8

Homework Statement


Convert 37.223_10 to hexadecimal/base 16.

Homework Equations


N/A

The Attempt at a Solution


I know how to get the non-fractional/whote part.:
37 % 16 = 5
2 % 16 = 2

and the whole part is: 25.

Having said that, I do not know how to get the fractional part.

Could someone please help me get the fractional part as well?

Any help would be greatly appreciated!
 
Physics news on Phys.org
You can extend the same concept:

Everything in decimal notation:
37.223 = 2*16 + 5.223
5.223 = 5*1 + 0.223
0.223 = ?*1/16 + ...
... = ?*1/16^2 + ...
And so on.
 
I'm still confused. (Sorry.)

With what you gave in the last post, how do I know that the fractional part in the hexadecimal version is 392?

(I know that it's 392 using Wolfram alpha.)
 
mfb said:
You can extend the same concept: Everything in decimal notation:
0.223 = ?*1/16 + ...
Note that dividing by 1/16 is the same as multiplying by 16:

0.223 = ?*1/16 + ...
0.223 * 16 = 3.568
0.223 = 3 * 1/16 + .0355

0.0355 = ? * 1/16^2 + ...
.0355 * 16^2 = 9.088
0.0355 = 9 * 1/16^2 + 0.00034375

0.00034375 = ? * 1/16^3 + ...
0.00034375 * 16^3 = 1.408
0.00034375 = 1 * 1/16^3 + 0.000099609375

0.000099609375 = ? * 1/16^4 + ...
0.000099609375 * 16^4 = 6.528
0.000099609375 = 6 * 1/16^4 + 0.000008056640625

You could pick up 16 bits at a time:
0.223 = ?*1/16^4 + ...
0.223 * 16^4 = 14614.528
14614_10 = 3916_16 (use integer base conversion)
0.223 = 3916_16 / 16^4 + 0.000008056640625

0.000008056640625 = ? * 1/16^8 + ...
0.000008056640625 * 16^8 = 34603.008
34603_10 = 872B_16 (integer base conversion)
0.000008056640625 = 872B_16 * 1/16^8 + 0.00000000000186264514923095703125

0.223 = hex .3916872B ...
 
Last edited:

Similar threads

  • · Replies 22 ·
Replies
22
Views
5K
  • · Replies 8 ·
Replies
8
Views
5K
  • · Replies 2 ·
Replies
2
Views
11K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 13 ·
Replies
13
Views
4K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
16K
  • · Replies 8 ·
Replies
8
Views
3K