1 00:00:00,000 --> 00:00:01,550 2 00:00:01,550 --> 00:00:04,970 What if we needed to convert a binary number that we're 3 00:00:04,970 --> 00:00:07,220 given in binary to decimal. 4 00:00:07,220 --> 00:00:15,440 But let's say we were given a binary number of 10100111. 5 00:00:15,440 --> 00:00:17,540 How do we convert that to decimal, 6 00:00:17,540 --> 00:00:18,556 the decimal equivalent? 7 00:00:18,556 --> 00:00:20,930 Well, the answer is, we're going to take everywhere there 8 00:00:20,930 --> 00:00:23,540 is a one, we're going to take that value from the placeholder 9 00:00:23,540 --> 00:00:25,200 it's in and simply add them up. 10 00:00:25,200 --> 00:00:28,250 So we're going to add up 128 plus 32 more 11 00:00:28,250 --> 00:00:30,480 plus 4 plus 2 plus 1. 12 00:00:30,480 --> 00:00:36,305 So we can do that longhand, 128 plus 32 plus 4 plus 2 plus 1. 13 00:00:36,305 --> 00:00:40,430 8 plus 2 is 10, plus 4 more is 14, plus 2 more is 16, 14 00:00:40,430 --> 00:00:42,050 plus 1 more is 17. 15 00:00:42,050 --> 00:00:44,680 There's our 1, there's our 7. 16 00:00:44,680 --> 00:00:48,740 Then we have in this column 3 plus 2 plus 1 is 6. 17 00:00:48,740 --> 00:00:51,470 And in the hundreds position, we have a 1. 18 00:00:51,470 --> 00:00:56,360 So that value of this binary number right here is 167. 19 00:00:56,360 --> 00:00:58,890 And I put 167 equals 167, I guess 20 00:00:58,890 --> 00:01:00,420 that's a little bit redundant. 21 00:01:00,420 --> 00:01:03,260 So in converting from binary to decimal, 22 00:01:03,260 --> 00:01:06,020 we simply look for the 1's and then add up 23 00:01:06,020 --> 00:01:10,950 the values of those positions for our equivalent total value. 24 00:01:10,950 --> 00:01:14,690 So now it's time for your exercise in converting binary 25 00:01:14,690 --> 00:01:15,322 to decimal. 26 00:01:15,322 --> 00:01:17,780 And what I'd like you to convert is this, this number right 27 00:01:17,780 --> 00:01:20,420 here into decimal. 28 00:01:20,420 --> 00:01:22,280 So go ahead and pause me. 29 00:01:22,280 --> 00:01:24,560 When you're done, go ahead and resume, 30 00:01:24,560 --> 00:01:25,820 and we'll confirm or answer. 31 00:01:25,820 --> 00:01:30,730 32 00:01:30,730 --> 00:01:31,930 All right, welcome back. 33 00:01:31,930 --> 00:01:32,930 Let's see how we did. 34 00:01:32,930 --> 00:01:37,090 So for this answer, which we'll call option number A here, 35 00:01:37,090 --> 00:01:45,230 we have 64 plus 32 more plus 16 more plus 4 plus 2 36 00:01:45,230 --> 00:01:46,610 and that's it. 37 00:01:46,610 --> 00:01:48,050 So we add all of those up. 38 00:01:48,050 --> 00:01:49,250 There's 4, 5, 6. 39 00:01:49,250 --> 00:01:53,260 6 more is 12, plus 4 is 16, plus 2 more is 18. 40 00:01:53,260 --> 00:01:55,610 We'll carry the 1, there's an 8. 41 00:01:55,610 --> 00:01:58,250 So for the 10th position, we have 6 plus 1 more is 7. 42 00:01:58,250 --> 00:02:04,260 Plus 3 more is 10, plus 1 more is 11, that would be 118. 43 00:02:04,260 --> 00:02:06,800 And if that's what you came up with, congratulations. 44 00:02:06,800 --> 00:02:11,640 You have the ability to convert from binary into decimal. 45 00:02:11,640 --> 00:02:13,060 Now let me give you a couple more 46 00:02:13,060 --> 00:02:15,030 that I'd like you to practice with as well. 47 00:02:15,030 --> 00:02:16,321 Let's take this one right here. 48 00:02:16,321 --> 00:02:19,651 Well, 00000000. 49 00:02:19,651 --> 00:02:21,410 I want you to use that one if you would, 50 00:02:21,410 --> 00:02:26,540 as well as this one, 11111111. 51 00:02:26,540 --> 00:02:32,774 And one more, let's have you go ahead and do 11110000. 52 00:02:32,774 --> 00:02:37,970 And we'll call those A, B, and C. And what I'd like you to do 53 00:02:37,970 --> 00:02:43,430 is write out on paper what the decimal equivalent of A, B, 54 00:02:43,430 --> 00:02:44,240 and C is. 55 00:02:44,240 --> 00:02:47,960 And if you're saying, Keith, I think I've got the A, it's 0, 56 00:02:47,960 --> 00:02:49,770 you'd be absolutely right. 57 00:02:49,770 --> 00:02:52,160 It might take you a little bit longer for B and C. 58 00:02:52,160 --> 00:02:55,160 So go ahead and pause me while you do all three of those. 59 00:02:55,160 --> 00:02:58,190 Write out your answers and then click on resume, 60 00:02:58,190 --> 00:02:59,370 and we'll compare notes. 61 00:02:59,370 --> 00:03:05,050 62 00:03:05,050 --> 00:03:06,640 OK, welcome back. 63 00:03:06,640 --> 00:03:09,650 So let's take this first one, option A first. 64 00:03:09,650 --> 00:03:13,650 And option A is 0 plus 0 plus 0 plus 0 plus 0, OK. 65 00:03:13,650 --> 00:03:16,410 So A equals 0. 66 00:03:16,410 --> 00:03:19,320 Now, this next one, we have some more adding to do. 67 00:03:19,320 --> 00:03:20,760 So we have 128. 68 00:03:20,760 --> 00:03:22,530 And here's what I'd recommend. 69 00:03:22,530 --> 00:03:24,450 Don't just do it in your mind. 70 00:03:24,450 --> 00:03:27,600 If you're new to this, do it as we have in this video, 71 00:03:27,600 --> 00:03:31,980 by writing out, like 128 plus 64 plus 32, which 72 00:03:31,980 --> 00:03:33,640 is what this is all about. 73 00:03:33,640 --> 00:03:38,970 So for answer B, it would be 128 plus 64 more which is 192. 74 00:03:38,970 --> 00:03:41,880 Plus 32 more, which is 224. 75 00:03:41,880 --> 00:03:44,610 Plus 16 more, which is 240. 76 00:03:44,610 --> 00:03:47,130 Plus 8 more, which is 248. 77 00:03:47,130 --> 00:03:50,250 Plus 4 more, which is 252. 78 00:03:50,250 --> 00:03:52,710 Plus two more, which is 254. 79 00:03:52,710 --> 00:03:55,480 Plus 1 more is 255. 80 00:03:55,480 --> 00:03:58,440 So B equals 255. 81 00:03:58,440 --> 00:04:01,350 And you might say, well, Keith, you did that in your mind. 82 00:04:01,350 --> 00:04:02,790 You didn't even write that out. 83 00:04:02,790 --> 00:04:06,210 And that's because this is one of those values 84 00:04:06,210 --> 00:04:09,780 that you're going to see a lot, of 255. 85 00:04:09,780 --> 00:04:12,606 And it's just because of raw practice with these numbers 86 00:04:12,606 --> 00:04:13,980 that they can do that in my head. 87 00:04:13,980 --> 00:04:15,760 Otherwise, I'd be writing it out. 88 00:04:15,760 --> 00:04:22,560 So 128 plus 64 plus 32 plus 16 plus 8 plus 4 plus 2 plus 1 89 00:04:22,560 --> 00:04:24,300 equals 255. 90 00:04:24,300 --> 00:04:33,190 And for answer C, we have 128 plus 64 plus 32 plus 16. 91 00:04:33,190 --> 00:04:35,514 And if we add all that up the long way, the short way, 92 00:04:35,514 --> 00:04:36,930 use a calculator or what have you, 93 00:04:36,930 --> 00:04:39,930 it's going to end up to be 240. 94 00:04:39,930 --> 00:04:43,410 If those are the three values that you got before we compared 95 00:04:43,410 --> 00:04:44,820 notes, my hat's off. 96 00:04:44,820 --> 00:04:47,160 If you didn't get these three numbers, 97 00:04:47,160 --> 00:04:49,560 I would ask you to go back, manually, 98 00:04:49,560 --> 00:04:53,760 like we did right here and here and add them up once again, 99 00:04:53,760 --> 00:04:55,680 just to confirm that you're doing 100 00:04:55,680 --> 00:04:59,590 the conversion from binary into decimal correctly. 101 00:04:59,590 --> 00:05:03,270 Also, the valid range, if you will, for any octet, 102 00:05:03,270 --> 00:05:09,202 any number in IP version 4 is going to be between 0 and 255. 103 00:05:09,202 --> 00:05:11,160 It can't be any lower than 0 because then we're 104 00:05:11,160 --> 00:05:12,500 going into negative numbers. 105 00:05:12,500 --> 00:05:15,180 And it can't be any higher than 255. 106 00:05:15,180 --> 00:05:19,200 Because in an octet, if every single binary number is on, 107 00:05:19,200 --> 00:05:22,710 the maximum it can ever get to is 255. 108 00:05:22,710 --> 00:05:25,140 But I also-- just with a little caution also, 109 00:05:25,140 --> 00:05:28,380 I want to point out that 0 through 255 110 00:05:28,380 --> 00:05:32,680 is actually 256 different numbers. 111 00:05:32,680 --> 00:05:34,560 Because 0, indeed, is a value. 112 00:05:34,560 --> 00:05:37,320 But the numerical high number you're ever going to see 113 00:05:37,320 --> 00:05:39,330 is going to be 255. 114 00:05:39,330 --> 00:05:41,520 I hope this has been informative for you. 115 00:05:41,520 --> 00:05:44,300 And I'd like to thank you for viewing.