1 00:00:00,000 --> 00:00:00,500 2 00:00:00,500 --> 00:00:02,940 I remember seeing the Wizard of Oz, and near the end 3 00:00:02,940 --> 00:00:05,070 they pull back the curtain to reveal who 4 00:00:05,070 --> 00:00:07,080 really is acting as the wizard. 5 00:00:07,080 --> 00:00:10,500 And that's what I'd like to do right now with IP version 4. 6 00:00:10,500 --> 00:00:14,640 Even though IP version 4, it's represented as dotted decimal-- 7 00:00:14,640 --> 00:00:17,160 here we have four numbers right here, 8 00:00:17,160 --> 00:00:19,560 and they're separated by three periods-- 9 00:00:19,560 --> 00:00:22,410 what's really happening is that's just for us 10 00:00:22,410 --> 00:00:24,180 humans as a convenience. 11 00:00:24,180 --> 00:00:26,310 What's really going on behind the scenes 12 00:00:26,310 --> 00:00:28,560 is that each one of these numbers 13 00:00:28,560 --> 00:00:31,380 represents one byte of data-- 14 00:00:31,380 --> 00:00:35,230 8 bits which go into one byte of data. 15 00:00:35,230 --> 00:00:36,330 So each of these numbers-- 16 00:00:36,330 --> 00:00:39,360 130, 16, 33, and 17-- 17 00:00:39,360 --> 00:00:42,750 sometimes these numbers are referred to as an octet. 18 00:00:42,750 --> 00:00:45,390 And an octet is nothing more than 8 bits 19 00:00:45,390 --> 00:00:48,330 that are all represented together in the same grouping. 20 00:00:48,330 --> 00:00:51,210 So whether you want to call this first number the first number, 21 00:00:51,210 --> 00:00:54,810 or the first bite, or the first octet, all of those 22 00:00:54,810 --> 00:00:55,980 mean the same thing. 23 00:00:55,980 --> 00:00:58,680 Now, the great news for you and I is that, in converting, 24 00:00:58,680 --> 00:01:01,830 if we needed to, to convert binary to decimal or decimal 25 00:01:01,830 --> 00:01:03,600 to binary, it's really straightforward, 26 00:01:03,600 --> 00:01:06,450 because in either method we're going to use we're 27 00:01:06,450 --> 00:01:08,460 going to first write out this table. 28 00:01:08,460 --> 00:01:10,200 We have a decimal number that we're 29 00:01:10,200 --> 00:01:11,670 going to convert to binary. 30 00:01:11,670 --> 00:01:13,170 So we're going to do that one first. 31 00:01:13,170 --> 00:01:15,030 And it's really just a game. 32 00:01:15,030 --> 00:01:17,997 And I call it the, does it fit game. 33 00:01:17,997 --> 00:01:19,080 And here's how we play it. 34 00:01:19,080 --> 00:01:20,290 We take a number-- 35 00:01:20,290 --> 00:01:22,157 so we're going to first start with 130, 36 00:01:22,157 --> 00:01:23,490 and we're going to write it out. 37 00:01:23,490 --> 00:01:26,010 And all we need to do is take this very first number 38 00:01:26,010 --> 00:01:28,350 on the far left, 128, and ask ourselves 39 00:01:28,350 --> 00:01:30,000 the question, does it fit. 40 00:01:30,000 --> 00:01:32,340 Does 128 fit into 130? 41 00:01:32,340 --> 00:01:33,870 Yes or no? 42 00:01:33,870 --> 00:01:35,650 It's a binary question. 43 00:01:35,650 --> 00:01:37,140 If the answer is yes, we're going 44 00:01:37,140 --> 00:01:39,660 to put a bit on in that position. 45 00:01:39,660 --> 00:01:42,840 And we're also going to subtract that value of 128 46 00:01:42,840 --> 00:01:45,060 from the number we're trying to convert. 47 00:01:45,060 --> 00:01:47,550 So the remainder of this is 2. 48 00:01:47,550 --> 00:01:49,980 130 minus 128 is 2. 49 00:01:49,980 --> 00:01:52,740 So we take that remainder, and we play the game again. 50 00:01:52,740 --> 00:01:55,160 Does 64 go into 2? 51 00:01:55,160 --> 00:01:55,660 No. 52 00:01:55,660 --> 00:01:58,360 Well, it might a fraction of the time, but we're looking for, 53 00:01:58,360 --> 00:02:02,150 does that number go in an entire time at least once? 54 00:02:02,150 --> 00:02:04,920 And if the answer is, no, it doesn't, we put a 0 there. 55 00:02:04,920 --> 00:02:05,850 How about 32? 56 00:02:05,850 --> 00:02:07,350 Does it go into 2? 57 00:02:07,350 --> 00:02:08,055 No, it doesn't. 58 00:02:08,055 --> 00:02:08,940 So that gets a 0. 59 00:02:08,940 --> 00:02:10,380 Does 16 go in? 60 00:02:10,380 --> 00:02:11,110 No, it doesn't. 61 00:02:11,110 --> 00:02:11,970 That gets 0. 62 00:02:11,970 --> 00:02:13,500 8-- does it go into 2? 63 00:02:13,500 --> 00:02:14,100 Nope. 64 00:02:14,100 --> 00:02:15,120 How about 4? 65 00:02:15,120 --> 00:02:15,810 Nope. 66 00:02:15,810 --> 00:02:17,400 And then we get down to 2. 67 00:02:17,400 --> 00:02:19,830 Does 2 go into 2? 68 00:02:19,830 --> 00:02:21,300 And the answer is yes it does. 69 00:02:21,300 --> 00:02:23,040 It goes exactly one time. 70 00:02:23,040 --> 00:02:27,420 So we'll subtract 2 from it, and we are down to 0. 71 00:02:27,420 --> 00:02:30,060 So the question is, does 1 go into 0. 72 00:02:30,060 --> 00:02:31,800 And the answer is, it does not. 73 00:02:31,800 --> 00:02:34,290 And so, we're going to put a 0 there as well. 74 00:02:34,290 --> 00:02:35,670 It's sort of like accounting. 75 00:02:35,670 --> 00:02:37,680 If you love accounting with debits and credits, 76 00:02:37,680 --> 00:02:40,320 trying to get them to equalize, that's all we're doing here, 77 00:02:40,320 --> 00:02:43,290 is we're trying to whittle this number down to 0. 78 00:02:43,290 --> 00:02:50,700 So this number right here 10000010 is 130 in decimal. 79 00:02:50,700 --> 00:02:52,590 So let's do one more together. 80 00:02:52,590 --> 00:02:54,630 And let's go ahead and do 16. 81 00:02:54,630 --> 00:02:58,680 The game is, we want to convert 16 into binary. 82 00:02:58,680 --> 00:03:00,796 We're going to play the, does it fit game. 83 00:03:00,796 --> 00:03:02,670 So we're going to write out on our paper 16-- 84 00:03:02,670 --> 00:03:03,750 the number we're after-- 85 00:03:03,750 --> 00:03:06,420 and ask ourselves the question, does 128 go in? 86 00:03:06,420 --> 00:03:07,460 The answer is, no-- 87 00:03:07,460 --> 00:03:08,310 negative. 88 00:03:08,310 --> 00:03:10,140 Does 64 go into 16? 89 00:03:10,140 --> 00:03:11,640 No-- negative. 90 00:03:11,640 --> 00:03:13,740 Does 32 go into 16? 91 00:03:13,740 --> 00:03:14,430 It does not. 92 00:03:14,430 --> 00:03:16,790 Does 16 going to 16? 93 00:03:16,790 --> 00:03:17,880 [MAKES SIREN NOISE] 94 00:03:17,880 --> 00:03:18,780 The lights go off. 95 00:03:18,780 --> 00:03:20,100 Yes, it does fit. 96 00:03:20,100 --> 00:03:21,600 So we take that number that we just 97 00:03:21,600 --> 00:03:24,240 put in, we subtract that from our number, 98 00:03:24,240 --> 00:03:26,910 we take the remainder, and we play the rest of the game. 99 00:03:26,910 --> 00:03:30,300 You can stop playing until you've given all 8 bits 100 00:03:30,300 --> 00:03:32,010 in that octet or that byte. 101 00:03:32,010 --> 00:03:35,670 So 8 doesn't go in to 0, nor does 4, nor does 2, nor does 1. 102 00:03:35,670 --> 00:03:39,750 This is our binary number that represents 16. 103 00:03:39,750 --> 00:03:43,410 It is 00010000. 104 00:03:43,410 --> 00:03:45,990 So we're going to input-- when we configure routers 105 00:03:45,990 --> 00:03:48,120 and devices with IP addresses, we're 106 00:03:48,120 --> 00:03:50,070 actually going to put in the value of 16 107 00:03:50,070 --> 00:03:51,720 for that second octet. 108 00:03:51,720 --> 00:03:53,850 But what the computer knows, or the router knows, 109 00:03:53,850 --> 00:03:57,930 is that this is the binary value of that second octet. 110 00:03:57,930 --> 00:04:01,920 I'd like you to take this number, 33, and your mission-- 111 00:04:01,920 --> 00:04:03,510 which I hope you accept-- 112 00:04:03,510 --> 00:04:08,940 is to convert 33 into the 8-bit binary number 113 00:04:08,940 --> 00:04:10,662 that 33 is representing. 114 00:04:10,662 --> 00:04:12,120 What I would encourage you to do is 115 00:04:12,120 --> 00:04:16,680 start by writing out this table, and then simply writing out 33 116 00:04:16,680 --> 00:04:19,420 and playing the game called, does it fit. 117 00:04:19,420 --> 00:04:20,850 So does 128 go in? 118 00:04:20,850 --> 00:04:21,709 Does 64 go in? 119 00:04:21,709 --> 00:04:23,020 Et cetera, et cetera. 120 00:04:23,020 --> 00:04:25,110 Every time it does go in you put a 1, 121 00:04:25,110 --> 00:04:28,230 and you subtract that value from your number 122 00:04:28,230 --> 00:04:30,870 and play the game again, continuing on 123 00:04:30,870 --> 00:04:32,320 with the remainder. 124 00:04:32,320 --> 00:04:36,060 So go ahead pause me right now, work out the binary equivalent 125 00:04:36,060 --> 00:04:39,040 of the decimal 33, and when you come back, 126 00:04:39,040 --> 00:04:41,950 we'll validate what that answer is in binary. 127 00:04:41,950 --> 00:04:44,812 [MUSIC PLAYING] 128 00:04:44,812 --> 00:04:46,094 129 00:04:46,094 --> 00:04:47,260 So the game goes like this-- 130 00:04:47,260 --> 00:04:48,940 33 is right here. 131 00:04:48,940 --> 00:04:50,920 We say, does 128 go into 33? 132 00:04:50,920 --> 00:04:51,770 The answer is no. 133 00:04:51,770 --> 00:04:53,080 64 doesn't go in. 134 00:04:53,080 --> 00:04:54,057 32 does. 135 00:04:54,057 --> 00:04:55,390 So we're going to put a 1 there. 136 00:04:55,390 --> 00:04:59,380 We'll say, minus 32, and our remainder is 1. 137 00:04:59,380 --> 00:05:00,460 16 doesn't go. 138 00:05:00,460 --> 00:05:01,210 Nor does 8. 139 00:05:01,210 --> 00:05:01,900 Nor does 4. 140 00:05:01,900 --> 00:05:02,410 Nor does 2. 141 00:05:02,410 --> 00:05:04,630 But 1 goes in cleanly one time. 142 00:05:04,630 --> 00:05:07,720 And our accountant is happy because we've 143 00:05:07,720 --> 00:05:11,000 had a zero balance at the end, which is how it should be. 144 00:05:11,000 --> 00:05:15,100 So the decimal number of 33 is representing our binary number 145 00:05:15,100 --> 00:05:19,060 of 00100001. 146 00:05:19,060 --> 00:05:23,470 If that's the answer that you've got, absolutely, great job. 147 00:05:23,470 --> 00:05:25,690 I hope this has been informative for you. 148 00:05:25,690 --> 00:05:28,012 And I'd like to thank you for viewing. 149 00:05:28,012 --> 00:05:28,512