1 00:00:04,030 --> 00:00:10,480 Now to prove us let's use a calculator here's the calculator on my Mac. 2 00:00:10,680 --> 00:00:16,870 If I type 255 notice in binary that's eight binary 1s. 3 00:00:16,890 --> 00:00:20,820 That's not very clear so let me use a Windows calculator. 4 00:00:20,820 --> 00:00:22,760 So here's my Windows calculator. 5 00:00:22,800 --> 00:00:29,120 I'm going to specify binary one two three four five six seven eight. 6 00:00:29,130 --> 00:00:35,670 Notice the Windows calculator puts a gap between the four binary values makes it easier to read but 7 00:00:35,670 --> 00:00:42,060 in a IP address there is no gap like that but I often write it that way just to make it easier to read. 8 00:00:42,090 --> 00:00:48,450 Notice the value is 255 in decimal but in binary it's eight binary 1s. 9 00:00:48,450 --> 00:00:50,510 Now we'll talk about hexadecimal later. 10 00:00:50,670 --> 00:00:58,320 That's FF in hexadecimal but 255 in decimal equates to 8 binary1s. 11 00:00:58,320 --> 00:01:00,780 Okay so here's a another example. 12 00:01:00,780 --> 00:01:04,950 What is the binary equivalent of 1 in decimal. 13 00:01:04,950 --> 00:01:08,030 So it's not this because that would be 128. 14 00:01:08,040 --> 00:01:10,050 It's not this because there would be 64. 15 00:01:10,050 --> 00:01:12,210 It's not this because there would be 32. 16 00:01:12,210 --> 00:01:12,810 Same there. 17 00:01:12,810 --> 00:01:13,920 Same here. 18 00:01:13,920 --> 00:01:15,330 And so forth. 19 00:01:15,330 --> 00:01:17,260 We wouldn't use any of those. 20 00:01:17,280 --> 00:01:23,340 The only bit that we would set on is that. So that in binary equals that in decimal. 21 00:01:23,790 --> 00:01:24,730 So there you go. 22 00:01:24,750 --> 00:01:31,960 But we typically write it this way because an IPv4 address consists of 4 groupings or 4 octets 23 00:01:32,340 --> 00:01:33,190 as it's called. 24 00:01:33,270 --> 00:01:36,420 So for groupings of 8 bits or 4 octet. 25 00:01:36,540 --> 00:01:42,910 So again 1 in decimal we would write like this in binary. 26 00:01:42,990 --> 00:01:45,800 Okay so let's see if you can answer this question. 27 00:01:45,810 --> 00:01:51,130 Pause the video if you need more time I'm going to go through the question and then I'll answer it. 28 00:01:51,150 --> 00:01:55,220 What is the binary equivalent of 192 in decimal? 29 00:01:55,260 --> 00:02:00,640 So what is a 192 equal to, to which binary bits here 30 00:02:00,750 --> 00:02:04,550 would you set on to get 192? 31 00:02:04,560 --> 00:02:07,320 Now pause the video at this point if you need more time. 32 00:02:07,350 --> 00:02:09,889 Otherwise I'm going to explain the answer. 33 00:02:09,990 --> 00:02:17,400 Now the easiest way to work this out is look at 192 does 192 minus 128 equal a positive or negative 34 00:02:17,400 --> 00:02:18,240 value? 35 00:02:18,270 --> 00:02:25,280 In this case, it's going to equal 64 so we know that we need to set this value on because that plus and 36 00:02:25,290 --> 00:02:29,520 it's quite easy here 64 equals 192. 37 00:02:29,520 --> 00:02:40,110 So those two bits need to be on the rest or set off because 192 minus 128 minus 64 equals zero or that 38 00:02:40,110 --> 00:02:41,750 plus that equals this. 39 00:02:41,760 --> 00:02:49,800 So in other words, 1 1 followed by 6 binary 0s equals 192 in decimal. 40 00:02:49,800 --> 00:02:53,150 Hopefully, that makes sense but he has another example in case it doesn't. 41 00:02:53,190 --> 00:02:56,950 I'm going to teach you a trick in this example as well. 42 00:02:57,000 --> 00:02:59,380 We've got 253 here. 43 00:02:59,430 --> 00:03:03,350 What is the binary equivalent of 253? 44 00:03:03,360 --> 00:03:05,880 Hint: think about working backwards. 45 00:03:08,300 --> 00:03:10,310 If you need more time pause the video now. 46 00:03:10,310 --> 00:03:15,650 Otherwise I'm going to tell you the answer. Okay So 253 47 00:03:15,650 --> 00:03:21,930 we could do the method where we minus 128 to make sure that it's not less than zero. 48 00:03:22,010 --> 00:03:27,300 Or we could work backwards and say 255 minus 253 equals 2. 49 00:03:27,320 --> 00:03:33,990 So we want to remove 2 out of the equation and leave all the other values on. 50 00:03:33,990 --> 00:03:41,120 So in other words, we could just state immediately turn this off and leave everything else on. 51 00:03:41,120 --> 00:03:53,070 So in other words, 128 plus 64 plus 32 plus 16 plus 8 plus 4 plus 1 equals 253. So you 52 00:03:53,070 --> 00:03:59,700 could either try and work it out by saying 255 minus 128 gives me a value and then subtract 53 00:03:59,700 --> 00:04:06,320 64 from that and then subtract 32 from that, subtract 16 from that, and so forth until you get to zero. 54 00:04:06,390 --> 00:04:11,860 Or you could just say turn 255 minus 253 equals 2. 55 00:04:11,880 --> 00:04:14,610 I know that 2 should be removed. 56 00:04:14,610 --> 00:04:16,470 Everything else should be on. 57 00:04:16,470 --> 00:04:21,120 So that equals 253 or to write it in binary. 58 00:04:21,120 --> 00:04:22,800 It looks like that. 59 00:04:22,890 --> 00:04:29,070 Now before we go any further I've created some quizzes on my website which gives you unlimited examples 60 00:04:29,070 --> 00:04:33,410 of converting binary to decimal and decimal to binary. 61 00:04:33,630 --> 00:04:39,810 So if you go to davidbombal.com/freequiz you can get access to these quizzes or 62 00:04:40,050 --> 00:04:45,630 simply look under free, free quiz to get access to all of these free quizzes. 63 00:04:45,630 --> 00:04:56,010 So as an example here we've got a quiz asking you to convert decimal to binary so I know that that is 64 00:04:56,010 --> 00:04:57,010 the answer. 65 00:04:57,110 --> 00:05:01,020 So I'm going to collect check answer and I'm told that that is correct. 66 00:05:01,020 --> 00:05:02,510 Here's another example. 67 00:05:02,550 --> 00:05:03,950 What is the binary equivalent. 68 00:05:03,960 --> 00:05:07,980 Let's put a incorrect number in so something like that. 69 00:05:08,010 --> 00:05:09,300 Check on answer. 70 00:05:09,330 --> 00:05:11,530 I'm told that that is wrong. 71 00:05:11,550 --> 00:05:12,930 Try again. 72 00:05:12,930 --> 00:05:14,080 You can keep on trying. 73 00:05:14,100 --> 00:05:19,190 Or you can click give up if you want to get the answer. 74 00:05:19,230 --> 00:05:24,000 So the software keeps track telling you how many you got correct and how many you gave up on. 75 00:05:24,330 --> 00:05:31,230 So you can do that quizzes an example or you can go to the opposite which is binary to decimal. 76 00:05:31,230 --> 00:05:33,110 So I'll just put in 123 77 00:05:33,150 --> 00:05:35,830 Check the answer and you can see it's wrong. 78 00:05:35,940 --> 00:05:40,950 Try again or click give up and it'll tell you what the correct answer is. 79 00:05:40,950 --> 00:05:45,480 So those are free quizzes on davidbombal.com that you can use if you want to practice.