Tip:
Highlight text to annotate it
X
00:00:00 - My 11-year-old daughter really despises mathematics.
00:00:06 - But the good news is, she could handle the mathematics
00:00:09 - that we'll need to master as a CCNA data center.
00:00:13 - And in this Nugget I'll guide you through the math that
00:00:17 - we'll need to be able to perform. 00:00:19 - And as you can see from our title,
it centers around 00:00:22 - converting from one numeric representation
to another. 00:00:27 - Let's jump in.
00:00:29 - In this Nugget we'll make sure you're well versed in every
00:00:32 - potential conversion you might need to perform, from
00:00:35 - something like decimal to binary, binary to decimal, hex
00:00:39 - to binary, hex to decimal, we'll cover it all.
00:00:42 - And if it's been a while since you've used hex to decimal,
00:00:45 - we'll review these numbering representations for you in
00:00:50 - this Nugget as well. 00:00:51 - By the way, you might say, what's
the big deal? 00:00:54 - Just use a scientific calculator
to perform these or 00:00:57 - a programming calendar to perform
these calculations. 00:01:01 - Well, you're not provided with
such a calculator in the exam 00:01:05 - environment, so we need to be able
to do these the old 00:01:08 - fashioned way, with a pen or pencil
and paper. 00:01:14 - Now, in order to take a decimal
number and convert it 00:01:17 - to binary, all we have to memorize,
really, is a 00:01:21 - conversion chart.
00:01:23 - In fact, whenever I sit a CCNA exam that's going to feature
00:01:28 - such conversions, the first thing I do after starting the
00:01:31 - exam is grab my scratch of paper and go ahead and build
00:01:36 - my conversion chart. 00:01:37 - It looks like this.
00:01:39 - 2 raised to the seventh power is 128.
00:01:45 - 2 raised to the sixth power is 64.
00:01:48 - 2 raised to the fifth power is 32.
00:01:52 - 2 raised to the fourth power is 16.
00:01:56 - 2 to the third is 8. 00:01:58 - 2 the second is 4.
00:02:00 - 2 to the first is 2 and 2 to the 0 is 1.
00:02:05 - So there is my conversion chart that I build.
00:02:09 - Now, you might say, well, Anthony, how would I ever
00:02:11 - memorize all that? 00:02:13 - Well, actually when you first start
out building this 00:02:16 - conversion chart, you would build
it from right to left. 00:02:21 - Yeah, you would start here.
00:02:24 - It's easy to remember that anything to the 0 power is 1
00:02:29 - in decimal. 00:02:31 - Any number raised to 1 is that
number itself. 00:02:35 - And then you just double.
00:02:37 - So you would go 1, 2, 4, 8, 16, 32, 64, 128 as you move
00:02:45 - across there. 00:02:46 - So here is our conversion chart
and this is our first 00:02:50 - step of the conversion process.
00:02:54 - Now once you have your conversion chart built,
00:02:56 - everything is easy. 00:02:59 - Watch this.
00:03:00 - Let's say we are given the number 56 and we're asked to
00:03:04 - convert it into binary. 00:03:07 - Well, can we take the number 128
away from 56 without 00:03:15 - getting a negative result?
00:03:16 - No. 00:03:17 - Can we take the number 64 from
56 without 00:03:20 - getting a negative result?
00:03:22 - No, we can't. 00:03:23 - We can take the number 32 from
56, though. 00:03:28 - So we have a binary 1 in this position.
00:03:33 - So now I'll go ahead and do that 00:03:35 - subtraction and we get 24.
00:03:38 - Can we take 16 from 24? 00:03:40 - Yes we can.
00:03:42 - And if we do this subtraction, we get oh, it looks like my
00:03:47 - daughter would be proud, we get a remainder of 8.
00:03:51 - Can we take 8 from 8? 00:03:54 - Yes we can.
00:03:56 - And then we're done, right? 00:03:58 - Because that gives us that 0 that
we're looking for. 00:04:01 - So 0, 0, and 0.
00:04:04 - So 56 in binary is 1, 1, 1, 0, 0, 0.
00:04:12 - By the way, if you were talking about an octet in a
00:04:16 - TCP/IP address, you would actually fill it out by
00:04:20 - sticking two 0s upfront here. 00:04:23 - But we're not really talking about
that. 00:04:24 - We just want the binary representation
of 56. 00:04:28 - We can drop those leading 0s and
it should be 111000. 00:04:35 - Now, when you're practicing, as
we are in this Nugget, 00:04:40 - you'll want to be able to check
your math, right? 00:04:43 - Check your work.
00:04:45 - And we'll do that with a calculator. 00:04:47 - Even though this calculator will
not be available to us in 00:04:50 - the exam environment, let's leverage
it while we're 00:04:53 - practicing.
00:04:55 - So here you can see I've just launched the Windows
00:04:57 - calculator. 00:04:58 - And we'll want to go to the View
menu. 00:05:01 - And notice one of the views but
we have is a 00:05:04 - programmer's calendar.
00:05:06 - Wow, I like this. 00:05:07 - Now, we are selected on decimal
here. 00:05:11 - Oh, and by the way, I should mention
this is the calculator 00:05:13 - in Windows 7.
00:05:15 - So I'm going to choose decimal and I'm going to put
00:05:19 - in the number 56. 00:05:22 - And look what happens.
00:05:23 - Without us hitting any kind of conversion button or anything
00:05:27 - like that-- 00:05:28 - let me move it so you can see our
answer-- 00:05:31 - 111000.
00:05:34 - Look here. 00:05:35 - Let me get my drawing tool so you
can really see this. 00:05:39 - Right down here they're showing
us the binary in this 00:05:43 - nice programmer's calendar.
00:05:45 - And notice it's 111000, just as we calculated.
00:05:53 - Awesome. 00:05:54 - So we can check our conversion
work to make sure we're 00:05:59 - accurate as we're practicing using
that great Windows 00:06:03 - calculator.
00:06:05 - Now I have even better news for you.
00:06:07 - Going from binary to decimal is an even easier conversion.
00:06:13 - And that's because addition tends to be a little easier
00:06:16 - than subtraction. 00:06:18 - Let's start by, once again, building
our conversion chart. 00:06:22 - I thought I would build it again
just so you can get some 00:06:27 - mastery through repetition, right?
00:06:30 - And let me build it this time as you might build it in your
00:06:34 - exam environment. 00:06:35 - We go 2 to the 0, and you think,
oh, yeah, anything 00:06:39 - raised to the 0 power is 1.
00:06:42 - And then 2 to the 1. 00:06:44 - Anything raised to the 1 power
is that number itself. 00:06:47 - And then 2 to the 2, and you see
how easy this is. 00:06:50 - We could do it this way.
00:06:51 - 8, 16, 32, 63, 128. 00:06:57 - And then this is 2 to the 3, 2
to the 4, 2 to the fifth, 2 to 00:07:04 - the sixth, and 2 to the seventh.
00:07:07 - And at this point you might say, Anthony, what do you even
00:07:09 - care about the binary top half of this?
00:07:13 - 2 to the 3, 2 to the 4. 00:07:15 - Well, that's going to come in handy
later on specifically 00:07:20 - when we are manipulating IP addressing
and 00:07:23 - working with subnets.
00:07:25 - So now if we get a number in binary, to convert it to
00:07:30 - decimal is very, very easy. 00:07:34 - Yeah, it just involves addition.
00:07:35 - What if they gave this, 10011101. 00:07:42 - Well, all we have to do is add
up those decimal values. 00:07:49 - So here we have 128 plus 16 plus
8 plus 4 plus 1. 00:08:00 - And this is our number, once we
add it all up, in decimal 00:08:05 - for this binary representation.
00:08:08 - So we've got 8 plus 6, 14, plus 8 is 22, 26, 27, carry
00:08:15 - the 2, that's a 5, and a 1. 00:08:19 - So I believe the answer is 157.
00:08:24 - Are we going to double check with a calculator?
00:08:26 - Of course we are. 00:08:28 - So here's our handy Windows calculator.
00:08:30 - Once again, in that programmer view.
00:08:33 - And we're going to go ahead and input the number that they
00:08:36 - gave us in binary. 00:08:38 - 1, 0, 0.
00:08:41 - So we'll go to binary 1 0 0 and then it was 1110111101.
00:08:54 - Suddenly it sounds like I'm singing a song by rush.
00:08:57 - 100100 or whatever that was. 00:09:01 - All right, so let's go ahead, now
that we've put the number 00:09:04 - in in binary, let's go ahead and
see what the decimal 00:09:09 - representation is by clicking on
the decimal, and we'll do 00:09:12 - the conversion right here in the
calculator. 00:09:14 - It's indeed 157.
00:09:17 - So my addition was correct and we see just how easy it is to
00:09:22 - move from binary to decimal conversions. 00:09:26 - Now, as promised, let's talk about
hex. 00:09:29 - Hex is a base 16 system.
00:09:33 - So what we do is we have 0 in hex, which
00:09:36 - represents 0 in decimal. 00:09:39 - And let me put a key here.
00:09:40 - This is hex and this is decimal. 00:09:42 - We have 1, which represents 1,
2, 2, 3, 3, 4, 5, 5 represents 00:09:51 - 6, 6 represents 6, 7 represents
7, 8 represents 8, 00:09:58 - then we'll continue this.
00:09:59 - Hex and decimal. 00:10:00 - We have 9 represented by 9.
00:10:04 - And then at the number 10, we use A. Uppercase or lowercase,
00:10:10 - doesn't matter. 00:10:11 - This represents the number 10.
00:10:15 - B represents 11, C, 12, D, 13, E, 14, and F, 15.
00:10:28 - Notice I switched upper and lower case here
00:10:30 - as I was doing this. 00:10:31 - Doesn't matter.
00:10:32 - So there you have it. 00:10:33 - The numbers 0 through 15 are represented
in 00:10:39 - this manner in hex.
00:10:41 - For instance, if we see the hex character C, this has a
00:10:45 - decimal representation of 12. 00:10:49 - Now, each hex character represents
00:10:54 - how many binary bits? 00:10:57 - Well, the answer is 4 bits.
00:11:01 - 4 bits equal 1 hex character. 00:11:05 - This has a very interesting name,
by the way. 00:11:11 - 4 bits is called a nibble.
00:11:13 - Yeah. 00:11:13 - Why is it called a nibble?
00:11:15 - Well, it's half of a byte. 00:11:19 - Oh, isn't that funny?
00:11:20 - So a byte is 8 bits and each hexadecimal character
00:11:25 - represents 4 bits, half of a byte, so we call it a nibble.
00:11:30 - Too funny. 00:11:34 - Now, we need a way that we can
communicate to a reader that 00:11:41 - we are presenting a number in hexadecimal.
00:11:45 - And the way they decide to do this was 0 lowercase x.
00:11:50 - So when you see 0 lowercase x, you know whatever follows this
00:11:56 - is in hexadecimal. 00:11:58 - So let's say we have 0x 611.
00:12:04 - What we see here is that we are dealing with the
00:12:07 - hexadecimal number 611. 00:12:11 - Again, the 0x communicates to us
that we're dealing with 00:12:15 - hex, and here is the hex number.
00:12:18 - Converting this to binary is simple. 00:12:22 - All we need remember is that each
of these hexadecimal 00:12:27 - characters represents 4 bits.
00:12:31 - So a 1, right, a 1 would be 1, 0, 0, 0.
00:12:39 - There are the 4 bit that that 1 represents.
00:12:44 - The next one would be 1, 0, 0, 0.
00:12:49 - And then for this character, 6, it would be 0, 1, that's
00:12:56 - the 2 position, and then we add that to the 4
00:13:01 - position and then a 0. 00:13:03 - So there you have it.
00:13:05 - 611 in hexadecimal converts to 011000010001.
00:13:19 - Notice we are still relying on out knowledge here of
00:13:23 - converting from decimal, right, to binary.
00:13:27 - That's underlying our ability to do this.
00:13:33 - Now, when we're practicing can we check our work with the
00:13:36 - Windows calculator? 00:13:37 - Well, of course we can.
00:13:39 - Here we can see we'll choose to enter in
00:13:42 - hex the number 611. 00:13:47 - And right here in that area where
we have the binary 00:13:52 - representation shown to us, we
can see we have our exact 00:13:58 - answer, don't we?
00:13:59 - 011000010001. 00:14:06 - This is math, people, but it is
simple math, isn't it? 00:14:12 - But now let's sit right here and
let's think 00:14:15 - about hex to decimal.
00:14:19 - Well, wait a minute. 00:14:20 - If we can convert hex to binary,
as we just did, can't 00:14:25 - we then take this binary and convert
it to decimal? 00:14:30 - Sure we can.
00:14:32 - This is the 1 position. 00:14:35 - Then we have 2, 4, 8, 16, 32, 64,
for 128, 128 00:14:48 - doubled would be--
00:14:50 - what would that be? 00:14:51 - 256, that's that position.
00:14:54 - 256 doubled would be 512. 00:14:59 - And 512 doubled would be 1,024.
00:15:04 - So 1,024 plus 512 plus 16 plus 1 gives us 12, 13,
00:15:15 - that's 5, 5, one. 00:15:19 - I propose to you that 611 in
00:15:24 - hexadecimal is 1,553 in decimal. 00:15:32 - How are we going to check our answer?
00:15:34 - Well, when we're practicing, with the Windows
00:15:36 - calculator, of course. 00:15:39 - Here is that calculator.
00:15:41 - I'll once again go to hexadecimal. 00:15:44 - I'll enter in our 611.
00:15:48 - And we'll go ahead and convert that to decimal and we can see
00:15:53 - the answer is indeed 1,553. 00:15:59 - So now we can easily convert from
hexadecimal 00:16:03 - to decimal as well.
00:16:07 - So you know time it is in this Nugget.
00:16:09 - It's exam time. 00:16:11 - Here's what I want you to do for
me. 00:16:13 - I want you to go ahead and convert
00:16:16 - this number to decimal. 00:16:20 - OK?
00:16:20 - I want this number converted to decimal.
00:16:23 - Now what is this number? 00:16:25 - The 0x tells us it's in hex.
00:16:27 - So we have 4AE in hex. 00:16:31 - I need you to convert this for
me to decimal. 00:16:35 - Now would be a great time for you
to go ahead and pause this 00:16:39 - CBT Nugget.
00:16:40 - Go ahead and get yourself some scratch paper and a writing
00:16:44 - tool and go ahead and work this out.
00:16:48 - You can check your answer against the Windows calculator
00:16:52 - if you like, but do not use the Windows calculator at all
00:16:57 - to come up with the answer. 00:16:58 - Good luck.
00:16:59 - Like I said, pause the video now. 00:17:01 - Unpause it when you're ready to
see me 00:17:03 - walk through the solution.
00:17:11 - Well, did you go ahead and convert those nibbles?
00:17:14 - Yeah. 00:17:15 - E is--
00:17:17 - what is it? 00:17:18 - That's 14, isn't it?
00:17:20 - And that in binary would be 0, 1, 1, 1.
00:17:27 - And then A is 10. 00:17:30 - In binary that would be 0, 1, 0,
1. 00:17:36 - And then our 4 is 0 in the one
position, 0 in the 2 position, 00:17:42 - 1 in the 4 position, and a 0 in
the 8 position. 00:17:46 - So there is our string of binary
that represents 4AE. 00:17:53 - Now underneath each of these we'll
put the decimal 00:17:56 - representations.
00:17:57 - There's the 2, there's the 4, there's the 8, nothing in the
00:18:01 - 16, there's the 32, nothing in the 64, there's our 128, then
00:18:08 - we have 256, then we have 512, then we have 1,024.
00:18:15 - So our answer here is going to be 1,024 added to 128, added
00:18:22 - to 32, 8, 4, 2. 00:18:27 - We're going to add this up.
00:18:28 - That's 12, 14, 22, 26, 28, 6, 7, 8, 9, 1, 1.
00:18:40 - I propose our answer is 1,198. 00:18:45 - Let's grab our calculator to check
our work. 00:18:48 - Here is our calculator.
00:18:50 - We'll go ahead and indicate we want to enter in hex.
00:18:53 - 4AE. 00:18:56 - We'll convert to decimal 1,198.
00:19:01 - And it's at this point that you realize that you're
00:19:04 - actually going to want math questions in your CCNA data
00:19:10 - center exam because you absolutely 00:19:14 - know you got it right.
00:19:16 - There's no gray area here. 00:19:19 - There's no room for interpretation.
00:19:22 - Once you know how to do these calculations, 00:19:25 - it's going to be simple.
00:19:26 - And remember, you're picking this from
00:19:29 - multiple choice options. 00:19:32 - So when you get 1,198 and your
A or B or C or D response 00:19:39 - matches that 1,198, it's almost
like the warm, 00:19:44 - comfortable feeling you get from
the 00:19:46 - Windows calculator, right?
00:19:48 - You know, my goodness, this is the value that I calculated is
00:19:53 - one of my options on the test. 00:19:55 - That's got to be right.
00:19:56 - So you'll really, really enjoy any questions that you might
00:20:00 - face about conversions now, won't you?
00:20:04 - So yet another very important Nugget in our CCNA data center
00:20:09 - series where we went and took a look at decimal to binary
00:20:13 - conversions. 00:20:14 - The other way, binary to decimal.
00:20:16 - We found those even easier. 00:20:18 - And then we reviewed hexadecimal
and saw how we can 00:20:22 - easily convert from hex to binary
and therefore hex to 00:20:26 - decimal as well.
00:20:28 - I hope this has been informative for you, and I'd
00:20:30 - like to thank you for viewing.