Now there are three numbering systems that use a network engineer need to know, you need to know decimal,
binary and hexadecimal. Decimal is what's called a base 10 numbering system.
There are 10 numbers 0 up to 9.
I'm pretty sure you're very familiar with this numbering system.
So a number like 128 or 255 is an example of a decimal number.
We have binary, which is a base 2 numbering system there are two numbers either 0 or 1.
I've discussed binary in a separate video so if you're not sure about binary please make sure that you
look at that video, as an example 128 in binary would be this.
So one followed by eight zeros, 255 would be eight ones in binary.
Those are examples of binary numbers base 2 numbering system, only two numbers.
So in other words they have fewer numbers than base 10 or decimal.
Here we have 10 numbers, here we have two numbers, hexadecimal has 60 numbers so it has more numbers than
decimal we have numbers 0 all the way to 9, similar to decimal but then we have A B C D E and F.
So once again we have three numbering systems here.
We've got decimal which has 10 numbers, binary which has 2 numbers, hexadecimal which has 16 numbers.
Hexadecimal
isn't that complicated.
You just have more numbers that you can work with.
I'm going to compare hexadecimal to decimal now to make it easier to understand the equivalent decimal
number for hexadecimal 0 is 0 notice.
0 to 9 is the same as decimal
So if I gave you a decimal number of eight in hexadecimal it's also eight.
Compare that to binary, in binary that would look like this one would look like this in binary.
So that's the binary equivalent, but it's 1 in hexadecimal.
This is where it gets different but all you need to remember is the following rule.
The hexadecimal equivalent for decimal 10 is A, for decimal 11 is B, decimal 12 is C, 13
is D, 14 is E, 15 is F, remember that these additional numbers equate to these numbers in decimal
in hex, we have numbers once again 0 to 9 and then we have A to F.
Now, I've just put them into two separate groupings share.
They're not really separated.
They're all part of hexadecimal.
I've just done that to show you what's similar to decimal and what's a little bit different to decimal,
hexadecimal values are from 0 to 15, decimal 0 to 15 or hexadecimal 0 to F.
So here's a comparison showing hexadecimal binary and decimal, 9
looks like that, 5 looks like that.
Notice this is exactly the same as decimal once again binary values looked like that and then you just
need to remember that 10, 11, 12, 13, 14, 15 is represented by numbers A, B, C, D
E and F, notice the biggest number in hexadecimal is 15 and that's what it looks like in binary.
So if I gave you a binary number like 1 1 0 0 the easiest way to work this out is just say, what is that
in decimal, a decimal that equates to 1, decimal that equates to 2, a decimal that equates to 4 and that
equates to an 8.
We haven't got these too but set on, so it's 8 plus 4 which is 12 which is C in hexadecimal.
Once again if you're not sure about how to do, binary to decimal or decimal to binary conversions have
a look at the video where I discuss binary.
Let's look at some more complicated examples such as 128, 128 looks like this in binary.
Now I've split it on purpose into 2 groupings of 4 bits.
Why?
Because going back here remember that the biggest number in hexadecimal is F which equates to 4 binary
ones, smallest number is zero which equates to 4 binary zeros.
So if we take a 128 and we write it like that but we split it into groupings of 4
bits each, this equates to 8 in decimal.
This equates to 0 in decimal which equals 80 in hexadecimal.
Now it's important that you know how to work this stuff out but in the real world you'd obviously use
a calculator so you can use a calculator to verify your answers.
So are we using a 10 base system or a 16 base system.
Let's use 16 and specify 8 0
Remember a 16
bit numbering system means hexadecimal base 16, so 8 0 in hexadecimal equals a 128 in decimal
128 in decimal is 8 0 in hexadecimal.
And if we look at the binary it's 1 followed by 7 zeros.
Okay
What about 255, 255
looks like this in binary, it's 8 binary ones.
If we split that in half, that equals 15.
and that equals 15.
I'll just write it out here,
that equals decimal 15.
Why?
Because that's 1, that's 2, that's 4, and that's 8, 8 plus four plus 2, plus 1 is 15, 15
in decimal equals F in hexadecimal.
Going back to our table here that is that in decimal which equals that in hexadecimal.
So the easiest way to work this out is to take a decimal number, put it into binary
break it in to groupings of 4 bits
convert those 4 bits into a decimal number and that'll give you your hexadecimal number.
So that equals FF
Here's another example, 224 that's a decimal number.
Convert that into binary.
It looks like this.
Why?
Because that is 128, that is 64 and that is 32, 128 plus 64 plus 32, equals 224.
So that if you split it into two groupings of 4 bits that is decimal 0
and if you look at the first 4 bits in decimal,
that would be let's rewrite it here
so it's not confusing.
That would be a 1 that would be a 2,
that would be a 4 and that would be an 8.
We're not going to use 1 here because the binary bit is set to 0,
so it's 8 plus 4 plus 2 which is 14
and if we go back to our table, 14 in decimal is E in hexadecimal, we can see it looks like that in binary
once again.
So that is an E.
So this would be E 0 as we can see over there.
Okay one more example,
So 240, 240 in binary looks like this.
Why?
Because 128 plus 64 plus 32 plus 16 equals 240.
Forgive my bad handwriting.
You split this in half
so this is easy.
That equals 0 in decimal.
Here we've got 4 binary ones which hopefully you remember is F, just going back 4 binary ones is
15 or F in hexadecimal.
So answer is F0, 240 in hexadecimal is F0.
We can prove that again,
let's go to decimal 240, is that in hexadecimal, 224 in decimal is that in hexadecimal, and 255 in decimal
is that in hexadecimal.
There are the hexadecimal equivalents for these decimal values.
Make sure that you know how to convert numbers from decimal to hexadecimal.
Why does this become important because, as an example, this is a broadcast address in IP version 4.
So in IP version 4 that means all devices on the network, 255
looks like that in binary, it's 8 binary ones, 128 plus 64 plus 32 plus 16 plus 8 plus 4
plus 2 plus 1, so 255 looks like that four times, if you take each of these 4 binary bits each
of those equals F, so we've got FF so in hexadecimal a broadcast looks like this that is a broadcast
address.
So on this PC, I'm gonna ping 255 255 255 255.
What I'll do is put this into simulation mode so we can see what's actually going on and I'll press
enter.
It doesn't like that in packet tracer.
So let's ping 10 1 1 1 255.
It's okay with us sending that traffic into the network.
So I'll send the packet into the network and if we have a look at that packet notice the source MAC
address is the PC but the destination MAC address is a bunch of F's.
Now that isn't actually a proper conversion of this IP address to broadcast but because it's what's
called a link-local broadcast, we've broadcast to all the devices in the local segment Packet Tracer
showing it like that.
So the inbound PDU or protocol data unit shows us
source MAC addresses is this, destination MAC address is a bunch of F's source IP address and it's actually
done a conversion of setting the destination IP address to 255 255 255 255.
So even though it didn't accept the command pinging that address it actually converted that IP address
to all hosts, all networks broadcast and hence we have that at layer 2.
So once again there's the Layer 3 IP address destination is 255 255 255 255,
and at layer 2 it's all F's.
Now that you understand hexadecimal conversions you understand why it did that.
This at layer 3 looks like this at layer 2, but a MAC address is actually 48 bits in size, so it's
folded in and it looks like this.
We have 12 F's, not 8 F's like in this conversion here Mac addresses once again 12 but not simply
8 bits.
That's not an exact conversion like I've shown you but that's the hexadecimal equivalent of this IP
address this IP address looks like this, in binary that is binary 10 1 1 1,
again that's 8, that's two equals 10.
So I'll clear that up if we split that in half.
Notice here's a mistake.
This is not hexadecimal.
This is actually 0 in hex and that being 10 1 0 1 0 is A.
So it should be 0 A going back 10 in decimal is A in hexadecimal or this in binary.
So take the decimal number convert it to binary.
This is an IP address so it's 8 bits.
It's an octet 0 A, which in hexadecimal looks like that, 1 in decimal looks like that in binary which
looks like that in hexadecimal.
Why?
Because if we split this down the middle.
That is a 0 in hex.
That is a 1 in hex.
Looks like that for those three numbers.
And if we look at 224 1 2 3 that's 224 in binary 1 2 3 split it down
the middle.
That would have been a 1.
This is 2 4 8 8 plus 4 plus 2 equals 14 which equals E in hexadecimal.
This is zero.
So we get E 0 the next one is 0 1 that's 0 that's 1, 0 2 0 3.
I've gone through a few examples hopefully that makes sense.
Let me know if you're still struggling with the theory of this but to help you.
I've created a whole bunch of converters that can help you study.
So as an example if I click on the first link and by the way I've given you this PowerPoint presentation
so look at the attachments and you can download it, keep it for reference but you also have access to this
converter.
If I put a number in here like 128 another one 224 255 255 and click convert you'll see the decimal
binary and hex numbers and then it's done an inverse.
So that's 1 followed by seven zeros.
The inverse of that would be 0 followed by seven ones which looks like that as an inverse hex number.
So again there's the decimal number.
There's the binary number and here's the hex number
and then we've got inverses of that.
There's also a binary to decimal visual calculator.
So if I put in a number here like 240 you'll notice that the binary string looks like that.
This can help you work out binary numbers if you're not sure.
240 minus 128 gives us 112 because that bit is set on we subtract 128 from 240.
Reset that bit on we subtract 64 from 112.
Gives us 48 and then that bit on means 32 subtract from 48 gives us 16 that bit on means 16
subtracted from 16 gives us 0.
So the remaining bits are set to 0.
So we've got four binary 1s followed by four binary 0s for a number of 240.
But this is probably what you're gonna be more interested in.
I've got an unlimited hexadecimal to decimal quiz here.
So if you've been given this hex value what is the equivalent decimal value.
You can put in the value that you think it is.
Let's say 1 2 3.
Click check on and it tells you that you've got it wrong.
You can try that as many times as you like.
And if you're not sure click give up and then it gives you the decimal equivalent number, so you can
use this to test your knowledge of doing conversions from hex to decimal.
You can also go through a quiz question asking you what this is in hexadecimal.
Hopefully you'll remember that from what we studied.
Click Submit it tells us that we've got the answer correct.
So you can go through a whole bunch of course questions if you'd like
on DavidBombal.com
Okay, so it's important that you know how to work with hexadecimal because you'll find it in many places
in networking make sure that you understand the theory that you can do the conversions, in the real
world we'd use calculators but you need to know the theory first to understand how things work so that
you can troubleshoot networks, work with IP version 6 addresses and MAC addresses and so forth.
Again let me know if you need more examples but hopefully that makes sense and you can use the quiz
questions and online calculators to help you practice.