**Wheels2050 wrote:**

portealmario wrote:can somebody explain the conceps of hexidecimal numbers to me?

Hexadecimal is simply a different way of representing numbers. It's useful because computers 'think' in binary - i.e. think in factors of two. While we are used to using decimal numbers in everyday life, it's not a natural numbering system for computers.

First, let's review the decimal system. It has digits 0,1,2,3,.....,9. Now, the way we write a number in any base (be that decimal, binary, hexadecimal etc.) is in the form:

xyzw

If we are in base ten (decimal), we would write the number "one thousand, four hundred and sixty seven" as:

1467 (I know you know this, but I'm trying to keep things flowing well).

Now, what 1467 means is that we have:

1x1000 + 4x100 + 6x10 + 7x1.

1, 10, 100, 1000 etc. are all powers of ten. So we can write the above line as:

1x10^3 + 4x10^2 + 6x10^1 + 7x10^0

so as we read from right to left, each digit indicates the number of tens to the appropriate power that the number contains (so the rightmost is 7 lots of ten to the zero, 6 lots of 10 to the one etc.) Thus, we can write any integer number in this format. Note that the number:

0000000000000001467

is exactly the same number, but for convenience we just discard the left-most zeros.

You may be familiar with binary, which is a similar idea - we just replace the powers of ten with powers of two.

so:

1011011

would be:

1x2^6 + 0x2^5 + 1x2^4 + 1x2^3 + 0x2^2 + 1x2^1 + 1x2^0

which, if we work out the exponents of 2:

2^0 = 1

2^1 = 2

2^2 = 4

2^3 = 8

2^4 = 16

2^5 = 32

2^6 = 64So, sticking those back into our expanded formula above, we have:

1x64 + 0x32 + 1x16 + 1x8 + 0x4 + 1x2 + 1x1 = 91 (If I've done my maths correctly)

It's just like the decimal you're used to, just with powers of two.

Now, we can use those same ideas with hexadecimal - now our base is 16. So the right-most digit is the number of sixteen-to-the-zeros, the one to the left the number of sixteen-to-the-ones, etc.

If you look at our decimal numbering system, you'll quickly notice that we only have 10 digits. However, that poses a problem - how do you write the number "14" in hexadecimal?

14 is less than 16^1 (=16), so we need to write it as 14x16^0. However, how do we do that with a single digit? (which is the idea - a number should only have one 'digit' for each power of your base). Thus, it was decided to use the beginning of the alphabet. 0-9 are as normal, but we then start with "A" and go on. Thus, when reading hexadecimal, we find:

0-9 = as normal

A = 10

B = 11

C = 12

D = 13

E = 14

F = 15Thus, to write the number '14' in hexadecimal, we simply write Ex16^0 (or, as it is usually seen, just E). When reading hex, people automatically convert that to mean 14.

So, if we have the number: A48, what does that mean? Just like before, we have:

Ax16^2 + 4x16^1 + 8x16^0, which (remembering A=10) gives us: 10x256 + 4x16 + 8x1 = 2632 in decimal.

Hexadecimal is useful, because to write 2632 in binary, we would require: 101001001000, which is obviously much more unwieldy than A48. Thus, hex is seen a lot in computing.

One final thing is that it's not always obvious what base someone is using. If I write the number:

10011110

how do you interpret that? Is it decimal, is it binary, is it hex, or is it something else entirely? Often contextual clues will tell you, but to be sure there are a variety of schemes. Sometimes you'll see a subscript at the right-hand side of the number (so if the above was binary, it would have a little '2' in subscript on the right-hand side). A common way of denoting hex (such as in the C and C++ programming languages) is to precede it with "0x". Thus, if I wrote:

0x847,

you'd know that it's in hex and not the number "eight hundred and forty-seven".

I hope that helps!

EDIT: Bonus points for telling me what 0x847 is in decimal!

thanks alot! that really helped !

is it 2071?