• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Other✓] How to learn hexadecimal.

  • 853
    Posts
    3
    Years
    • Seen Nov 9, 2023
    This is actually a tutorial, I decided to make to help others learn the vital skill of counting in hexadecimal.
    You could use a calculator/converter when editing but things go much faster if you have at least a basic understanding of how it works,
    when you're working or editing.

    This is extremely useful when scripting or editing items as in nearly every case you'll need to input number values in hexadecimal.
    I put it here, since it will go up faster than tutorials & resources.
    Now on to the tutorial.


    Our normal decimal system is base 10, meaning starting from 0 we count 10 different values before
    we reach the max, then reset by going up a place. i.e from ones to tens, tens to hundreds. etc.

    hexadecimal is essentially an extra 6 values on top of the normal 10.
    Hexadecimal is base 16, from 0 - 9 its identical, but instead of going directly to ten,
    it fills those values with a-f which have values of 10 - 15.

    All the same rules of our number system apply but on a different base.
    So the key to understanding hex is understanding our own math system.


    Starting in the ones place.

    our 10 values are 0 - 9

    We can treat it like we have an infinite number of places that are all 0, zeroed out
    until we completely fill the place that precedes it to the right.

    0000000000000000009

    It then goes up by 1, and resets the place to the right back to 0, and the cycle repeats.


    0000000000000000010

    So we start at 0 in the ones place, count up to 9, and add a 1 to the next place over, ie the "tens" place,
    and reset the ones to 0.


    Now there are several shortcuts in our thought we make, because we know our systems so well,
    like when we were in school they may have taught this simple way of counting them;

    10 is one tens, 20 is two tens, 30 is three tens, etc.

    So now we can just look and know 10 is one tens, and say, oh yeah that's the number 10 or the value 10.

    but if you break that down, its simply saying that once you get to the tens place, its just
    single digit value in front, multiplied by whatever the base of the system is.


    So for our base 10, that's: 10 = 1 x 10 20 = 2 x 10 30 = 3 x 10 and so on.


    Since we know hexadecimal is base 16, we can apply the same logic. (fyi hex numbers are typically denoted by a "0x" in front)

    so if you see 0x10, just know, ok that's 1 x base. that means its 1 x 16. simple.



    Now lets look at the number 13, we have a 1 in the tens place, and a 3 in the ones place.

    If we break it down we know that just means one tens, plus 3 ones.


    So looking at 0x13 in hexadecimal

    that's 1 times the base of 16, plus 3. so 1 x 16= 16 and then add 3, and we have 19.

    Now lets get a bit complex.

    Lower values are easy enough to do in your head with practice, but I just want to do a brief proof of concept
    so you can see that you got this. And you don't have to be afraid when seeing letters in your math.

    now brief preface/summary

    hexadecimal is base 16, so starting at 0 it has 16 values before the ones place resets and it moves into the tens place.

    those values are 0-9 and the a-f,
    where:
    a=10
    b=11
    c=12
    d=13
    e=14
    &
    f=15.

    So using that for reference
    look at the value D5

    Solve that one yourself and then continue, I know you can do it just use a calculator and go back over what I have above.




























    Congrats you now know hexadecimal.

    Alright so for most of the edits we need do on this site we never really need to go above 2 digits.

    But for sake of knowledge I'll explain real quick.

    It's just like I said above everything we need to learn hexadecimal is packed in our knowledge of our own system.

    So 3 digits, in decimal that's starts at 100. and like every place before it,(and after) its a multiple of the base.

    Think like this, how do we break down a hundred?

    It's 10 x 10. i.e base x base.

    so if you see 0x100 that's simply 16 x 16.

    now its unsaid when we're dealing with just 100, but its actually the single digit in the hundreds place x base x base.


    Like this 100 = (1 x base) x base. 200 = (2 x base) x base) aka (2 x 10) x 10 = 200.

    So we do the same for hex 1 x 16 x 16 = 256


    If you have more numbers following the hundreds place you proceed
    by adding with the same multiples scheme you did before.

    hundreds place is (constant x base) x base

    +

    tens place is (constant x base)

    +

    whatever is in the ones place.


    I'll do one for you to demonstrate as the last part of this tutorial.

    I'll be breaking down the number 0x123

    1 hundreds

    20 tens

    and 3 ones.

    (1 x 16) x 16 = 256

    +

    2 x 16 = 32

    +

    3 = 3

    Total = 291


    Thanks for reading. :)
     
  • 9
    Posts
    3
    Years
    • Seen Apr 27, 2024
    Thank you, this tutorial was a great help! The way you broke it down really helped me wrap my mind around hexadecimal
     
    Back
    Top