Conversion
In this tutorial we will learn hexadecimal to decimal conversion for a floating point number i.e., a number with fractional part.
Before we dive into the main topic lets talk a little about Decimal and Hexadecimal Number System that we are going to work with in this tutorial.
A decimal number system consists of 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. So, any number that we use in our daily life is actually in decimal number system.
In hexadecimal number system we use ten digits and six english alphabet letters.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F
10 is denoted as A
11 is denoted as B
12 is denoted as C
13 is denoted as D
14 is denoted as E
15 is denoted as F
Hexadecimal implies base 16
To convert a hexadecimal number having integer and fractional part into decimal form we have to multiply the integer part
ones place with 160
tens place with 161
hundreds place with 162
ans so on...
and the fractional part
tenths place by 16-1
hundredths place by 16-2
and so on...
The following table shows the places, hexadecimal number and the multipliers for the corresponding places.
place | ones | Decimal Point | tenths | hundredths |
hexadecimal | 0 | . | 0 | 1 |
multiplier | 160 | 16-1 | 16-2 |
= 0x160 + 0x16-1 + 0x16-2
= 0 + 0 + 0.00390625
= 0.00390625
So, the required decimal number is
0.01(base 16) = 0.00390625(base 10)
Alternatively, (0.01)16 = (0.00390625)10
Where, (base 10) means the number is in decimal number system and (base 16) means the number is in hexadecimal number system.
The following table shows the places, hexadecimal number and the multipliers for the corresponding places.
place | ones | Decimal Point | tenths | hundredths | thousandths | ten thousandths | hundred thousandths |
hexadecimal | A | . | 2 | 8 | F | 5 | C |
multiplier | 160 | 16-1 | 16-2 | 16-3 | 16-4 | 16-5 |
= Ax160 + 2x16-1 + 8x16-2 + Fx16-3 + 5x16-4 + Cx16-5
= 10x160 + 2x16-1 + 8x16-2 + 15x16-3 + 5x16-4 + 12x16-5
= 10 + 0.125 + 0.03125 + 0.003662109375 + 0.0000762939453 + 0.0000114440918
= 10.1599...
= 10.16 (approx. value)
So, the required decimal number is
A.28F5C(base 16) = 10.16(base 10) (approx. value)
Alternatively, (A.28F5C)16 = (10.16)10 (approx. value)
Where, (base 10) means the number is in decimal number system and (base 16) means the number is in hexadecimal number system.
ADVERTISEMENT