Hey everybody was going on this is Caleb with slopestyle.
And in this video we're going to work on understanding hexadecimal.
Hexadecimal is a number system that is used in the computer world and it's really important to know
about.
So we're going to learn how it works.
We're going to compare it to things like binary and our decimal number system.
And let's do it.
Let's dive right in.
So we're going to begin by looking at the two number systems that we're familiar with at this point.
The decimal number system and the binary number system.
Now of course the decimal number system is base 10.
We use this every day 0 through 9 10 values k we use this for pretty much everything.
Then there's the binary number system which is a base 2 system.
This means there are only two values 0 and 1 on or off.
And we've already talked about this but there's another number system called base 16 and that is where
hexadecimal comes into play.
It uses the same numbers from the from the decimal number system 0 through 9 but from 9 we're going
to go up a b c d e f.
And the interesting thing is the value for ABC D E and F are the same as if we were continuing on in
the decimal system so is equal to 10 B 11 C 12 13 14 15 16 values hexadecimal.
So let's take a look at how the base 10 number system works.
We obviously know this we learned this in like elementary school but if we were going to represent the
number 231 in the base 10 system we would put a 2 in the hundreds place or three in the tens place and
a 1 in the ones place.
Now that that represents two hundreds three tens and one one.
But what if we wanted to represent the same number in binary.
OK we know how to do this.
We have 8 channels K ranging from 1 all the way up to 128.
And if we were to put in the value 1 1 1 0 0 1 1 1 that would mean to add 128 plus 64 plus 32 plus four
plus two plus one.
And that gets us a grand total of two hundred thirty one k that's the same representation with a very
different number system.
Now let's move on.
Texas decimal this is really really important stuff.
So like I showed you before hexadecimal has six values above nine.
ABC D E and F.
And like I said A is equal to 10 B 11 12 13 14 and F 15 K and this gets us 16 places K in our base 16
system.
And the way the numbers are going to work are obviously different and you'll see why this is kind of
actually a cool number system and you'll probably also understand why it's not used to write code just
like binary is not directly used to write code anymore.
But take a look.
If we were to use a chart just like I showed you with the base 10 system we still have one place and
if we want to represent a particular number in that channel then the next channel to the left is the
six teens place.
So we go from ones all the way to six teens.
OK.
And what that's going to mean is that if I put an E in the teens place that means that I have 14 16s.
So 14 times 16 if I put a 6 there it would be 6 16s.
Otherwise we're basically putting the value in that place.
Times 16 K that's very cool.
So in this example we have e 7 14 16s and 7 1.
So if we do 14 times 16 we end up with 224.
Add that to 7 and we get 231.
So e 7 is the same thing as 1 1 1 0 0 1 1 0 1 in binary.
The cool thing about hexadecimal is that you can store much bigger values in much smaller space just
by changing to a base 16 system.
Now if we were to take it a step further on every channel you go to the left we go from 1 to 6 teens
and then we end up with 16 to the second power or 256.
Then it would be 16 to the third power to the fourth power to the fifth power.
And the numbers get exponentially larger for every channel just like in binary.
Now if we were to use this example 8 7 we would take eight and multiply it by 16 to the power of two
or 256.
So eight times 256 gets us 2048 then we would add that to what we already have in E which is 224.
Then add that to 7 for a grand total of two thousand two hundred seventy nine.
With only three characters.
Pretty amazing stuff.
So this is hexadecimal it's not very hard to understand.
It's a very easy number system but you know just like binary it's not really human readable you can't
look at a hexadecimal value and say Ah I know what that does in code and that's why.
Thankfully programming languages were written and compilers were built in order to be the go between
for us.
So to recap hexadecimal is a base 16 number system that has values going from zero all the way up to
9.
Then following that we had a B C D E F and those are worth 10 11 12 13 14 and 15.
And when we begin we basically have 16 to the power of zero.
So anything we put in there is just equal to itself.
We have 16 to the power of one which is the 16 channel and anything beyond that is going to be 16 to
the power of two 16 to the power of three four five six and so on we can get exponentially larger numbers
with much less data.
That's why hexadecimal is so great.
Thanks so much for watching this video and yeah this is Caleb with Debb slopes.
Dot.com.