Hexadecimals

Started by doomkaiber001, October 28, 2010, 06:46:30 AM

Previous topic - Next topic

doomkaiber001

Right, I kinda need help with something. I understand the hexadecimals; until it gets to three digits... :( I'd like someone to explain it, thanks. :smileyface:

James0x57

0xFF = 255
0x100 = 256


Use windows calculator until you figure it out. When I started 11 years ago I was in the same boat and that worked best for me.

Good luck.


doomkaiber001

I'll try but, judging on those numbers, I'll struggle quite a bit. Thanks for giving me the headstart though!

James0x57

Start by learning to count in hex. That would help you. Most of us use a calculator (or some other tool) to convert between hex and decimal. Over time you'll memorize handfuls of frequent conversions without trying to.


doomkaiber001

I think I know a bit about hex. Last night I began writing all the hex's I could do. I managed to get to 9A, and the parts after that. I got a headstart using 'Statman Hexadecimals' (up to 20) and carried on from there. Once I finished, I checked my results to that page, they were all right!

doomkaiber001

What do you mean anyway by counting in Hex:
This?
0  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  1E  1F  20  21...
And so on and so forth.

Link

Quote from: doomkaiber001 on October 28, 2010, 05:40:38 PM
What do you mean anyway by counting in Hex:
This?
0  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  1E  1F  20  21...
And so on and so forth.

Exactly this..

doomkaiber001

Oh, and sorry if that last post was a bit, well, hyper. I am happy though, beyond belief... Anyway I still don't understand how 0xFF equals 255. Enlighten me please?

dcx2

Hex is a compressed form of binary.

0xF = 1111b

0xC = 1100b

(the lowercase b after a number indicates it is binary)

0xFF = 1111 1111b

Now you just need to learn how to convert base 2 to base 10.

http://www.wikihow.com/Convert-from-Binary-to-Decimal

doomkaiber001

So... Decimal to Binary
178= 10110010

Binary to decimal
11001110 = 206

doomkaiber001

So does that make 0xD 1101 and 0xE 1110?

doomkaiber001

Quote from: dcx2 on October 28, 2010, 07:34:17 PM
Hex is a compressed form of binary.

0xF = 1111b

0xC = 1100b

(the lowercase b after a number indicates it is binary)

0xFF = 1111 1111b

Now you just need to learn how to convert base 2 to base 10.

http://www.wikihow.com/Convert-from-Binary-to-Decimal

So I take it I need to understand Binary to work ot the Hex's following 9A?

James0x57

Main thanks goes to Link because he said yes? ... *shrugs*


Those binary conversions are correct.



Example to convert straight to decimal from hex:
0x1FA =
(16^2)*1 + (16^1)*0xF + (16^0)*0xA =
256*1 + 16*15 + 1*10 =
256 + 240 + 10 =
506


doomkaiber001

Forgive me for this noobish question but what exactly does the ^ mean inbetween numbers.

James0x57

"raised to the power of"
So ^2 means "squared"
16^4 = 16*16*16*16