# Hex

#### eds01

##### Diabloii.Net Member
Hex

Can ony one explain hexadecimal to me? There was a question on a final yesterday about it, we wernt taught about it, and even the teacher didnt know it, and its really bothering me.

#### KnightFall

##### Diabloii.Net Member
It's just another way of counting. Like Decimal or Binary.

Normal numbers, 1-9 are to base 10. Hex numbers are to base 16.

Decimal counts like : 1 2 3 4 5 6 7 8 9 10 11 Etc

Hex counts like : 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D Etc

So for example,
A = 10
F = 15

But FF is not 15*15.
FF = 255

Does that help any? Not sure it will, find it hard to explain really...

Edit : Can you remember the question? I would like to see if I could answer it...

KnightFall

#### KnightFall

##### Diabloii.Net Member
Edit : Damn forums are rubbish for tables...

Tring to find one which works...

You will find decimal to hexadecimal conversion tables in most HTML manuals.

KnightFall

#### mhl12

##### Diabloii.Net Member
taken from dictionary.com

Of, relating to, or based on the number 16: the hexadecimal number system.
i know, not the best source but its the first one that popped in my mind.

#### plasmo

##### Diabloii.Net Member
Here's the Wikipedia page on it; might be of some help. Good place to get a general idea about something before you start serious research.

KnightFall said:
Edit : Damn forums are rubbish for tables...
I usually use the code tag for tables:
Code:
``````Decimal counts like: 1 2 3 4 5 6 7 8 9 10 11 Etc
Hex counts like:     1 2 3 4 5 6 7 8 9 A  B  C D E F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D Etc``````
Still have to preview it a couple of times to get it perfect, but it gets the job done.

#### KnightFall

##### Diabloii.Net Member
Ah! Thanks for the tip! Didn't remember there was a table thingie like that...

KnightFall

#### Chynobi

##### Diabloii.Net Member
What are we talking about hex wise?

Conversion? Ie Denery to Hex?

#### eds01

##### Diabloii.Net Member
I'm mostly wondering about conversion, i.e. 100(hex) - 10(hex) = x(decimal) and figureing out how much it is. Any help with that?

##### Diabloii.Net Member
eds01 said:
I'm mostly wondering about conversion, i.e. 100(hex) - 10(hex) = x(decimal) and figureing out how much it is. Any help with that?
100 (hex) = 256 (decimal) 1 * 16^2 + 0 * 16^1 + 0 * 16^0 = 255
10 (hex) = 16 (decimal) 1 * 16^1 + 0 * 16^0 = 16

256 - 16 = 240

#### Arokthis

##### Diabloii.Net Member
On the assumption that you're running Windows, go to the calculator. (Start button, programs, accessories, calculator) Set it to "scientific" and enter the decimal number you want changed to hex. Switch it to hex and you will have the result. Voila!

#### Merick

##### Diabloii.Net Member
I always liked Hex better than binary and octal, it just seems easier with a higher-than-10 base number system.

#### Ev_

##### Diabloii.Net Member
Because no one has explicitly said this yet (although garublador came close)...

Hex works exactly the same way every number base works. Every digit in a number represents the number of times a certain power of the base is in the number. Starting from the decimal and moving left, the places are base^0, base^1, base^2, base^3, etc.

So in our everyday number system (base 10), 292 means:
(2 * (10^2)) + (9 * (10^1)) + (2 * (10^0))

292 in hex would mean:
(2 * (16^2)) + (9 * (16^1)) + (2 * (16^0)) = 658 (base 10)

To write 292 (base 10) in hex:
(1 * (16^2)) + (2 * (16^1)) + (4 * (16^0))
or 124

To write 292 (base 10) in binary:
(1 * (2^8)) + (0 * (2^7)) + (0 * (2^6)) + (1 * (2^5)) + (0 * (2^4)) + (0 * (2^3)) + (1 * (2^2)) + (0 * (2^1)) + (0 * (2^0))
or 100100100

In octal, it's 444. I think you can probably figure out how by now.