WEBVTT 00:00:00.521 --> 00:00:02.919 - [Voiceover] What I would like to do in this video is 00:00:02.919 --> 00:00:06.843 explore the connection between the binary number system 00:00:06.843 --> 00:00:08.866 which is clearly, or we've already 00:00:08.866 --> 00:00:11.475 talked about this, is base two. 00:00:11.475 --> 00:00:14.838 Explore the quotient between that and the hexadecimal, 00:00:14.838 --> 00:00:19.838 hexadecimal number system, which is base 16. 00:00:20.258 --> 00:00:22.250 The reason why this is interesting is 00:00:22.251 --> 00:00:26.408 because 16 is a power of two. 00:00:26.408 --> 00:00:28.163 What we'll see is you could always view 00:00:28.163 --> 00:00:29.651 the hexadecimal number system. 00:00:29.651 --> 00:00:32.317 It's almost condensed representation 00:00:32.317 --> 00:00:33.788 of the binary number system. 00:00:33.788 --> 00:00:35.503 This is actually why you will actually, 00:00:35.503 --> 00:00:37.609 we've already talked about the binary system 00:00:37.609 --> 00:00:40.191 is used extensively in computer science 00:00:40.191 --> 00:00:41.905 and in even computer engineering. 00:00:41.905 --> 00:00:44.935 It's the underlying things that are happening 00:00:44.935 --> 00:00:46.969 or it's the representation used when we talk 00:00:46.969 --> 00:00:49.918 about logic gates and transistors and things like that. 00:00:49.918 --> 00:00:52.570 But hexadecimal also shows up a lot 00:00:52.570 --> 00:00:56.342 because it's kind of a condensed representation of base two. 00:00:56.342 --> 00:00:58.181 What do I mean by that? 00:00:58.181 --> 00:01:03.181 Let's write out a arbitrary number in base two. 00:01:03.500 --> 00:01:07.329 Let's say I have one, zero, one, one, 00:01:07.329 --> 00:01:12.329 zero, one, one, one, zero. 00:01:12.585 --> 00:01:16.100 This right over here is in binary 00:01:16.100 --> 00:01:17.759 and I can even write in parenthesis . 00:01:17.759 --> 00:01:20.980 This is a binary representation. 00:01:20.980 --> 00:01:25.790 I want to convert this to hexadecimal representation. 00:01:25.790 --> 00:01:28.772 I encourage you to pause the video and try out in your own. 00:01:28.772 --> 00:01:30.756 I'll give you a clue on how you could think 00:01:30.756 --> 00:01:34.066 about converting directly from base two to base 16. 00:01:34.066 --> 00:01:37.437 Think about which one over here is in the 16s place 00:01:37.437 --> 00:01:41.137 and what is the 256 place over here. 00:01:41.137 --> 00:01:44.689 Then that might help you convert directly. 00:01:44.689 --> 00:01:46.467 Assuming you had a go at it. 00:01:46.468 --> 00:01:49.970 The really fun thing about between base two and base 16 is 00:01:49.970 --> 00:01:52.971 you don't have to, well for any bases, you really don't have 00:01:52.971 --> 00:01:55.852 to go through base 10 but these in particular, 00:01:55.852 --> 00:02:00.114 it's especially easy to go convert between these two bases. 00:02:00.114 --> 00:02:02.258 The realization that you have to make is, 00:02:02.258 --> 00:02:05.923 what are the powers, which places here are powers of 16? 00:02:05.923 --> 00:02:09.067 This right over here, that is the ones place. 00:02:09.067 --> 00:02:11.093 One way to think about it is all of these is going 00:02:11.093 --> 00:02:13.023 to tell you how many ones we have. 00:02:13.023 --> 00:02:16.029 Ones, twos, fours, and eights, 00:02:16.029 --> 00:02:18.302 but another way to think about it is this is a count 00:02:18.302 --> 00:02:23.302 of ones, all the way up to a potential of 15 ones. 00:02:25.324 --> 00:02:29.803 This could count, this is going to be between zero, 00:02:29.803 --> 00:02:32.096 and I'm going to write it down. 00:02:32.096 --> 00:02:34.714 Actually, let me write it down in base 16. 00:02:34.714 --> 00:02:37.019 It's going to be between zero and F. 00:02:37.019 --> 00:02:39.988 It's going to be between zero and 15. 00:02:39.988 --> 00:02:42.462 It's kind of a count between the number 00:02:42.462 --> 00:02:45.474 of ones, I guess you could say. 00:02:45.474 --> 00:02:47.202 Then this is the 16s place. 00:02:47.202 --> 00:02:49.939 I'm going to do that in different color. 00:02:49.939 --> 00:02:53.914 This right over here is the 16s place. 00:02:53.914 --> 00:02:58.478 You could have between zero and 15s, 16s. 00:02:58.479 --> 00:03:01.517 This is also going to be between zero and F, 00:03:01.517 --> 00:03:04.827 when you look at this four digit binary numbers. 00:03:04.827 --> 00:03:07.005 Once again, this whole thing right over here is 00:03:07.005 --> 00:03:09.755 essentially going to tell you how many 16s you have. 00:03:09.755 --> 00:03:10.707 This whole thing is going to tell you 00:03:10.707 --> 00:03:13.257 how many ones you have. 00:03:13.258 --> 00:03:15.578 Then the next four, we could keep going, 00:03:15.578 --> 00:03:17.079 although there is only one place here. 00:03:17.079 --> 00:03:22.079 We could go, this right over here is the 256s place. 00:03:22.128 --> 00:03:24.817 This is going to be the next four digits. 00:03:24.818 --> 00:03:26.360 They really have one right over here, 00:03:26.360 --> 00:03:29.128 but one, two, three, and then the fourth one. 00:03:29.128 --> 00:03:34.128 This is also going to be between zero and 15, 256s. 00:03:34.399 --> 00:03:35.584 Hopefully, that helps you a little bit. 00:03:35.584 --> 00:03:37.713 Actually, if this was a clue, I encourage you 00:03:37.713 --> 00:03:39.156 to pause the video again (laughs) and see 00:03:39.157 --> 00:03:42.173 if you can represent this in hexadecimal. 00:03:42.173 --> 00:03:46.321 Let's try to work this thing together. 00:03:46.321 --> 00:03:47.746 How many ones do we have? 00:03:47.746 --> 00:03:48.681 What number is this? 00:03:48.681 --> 00:03:50.458 These four digits right over here. 00:03:50.458 --> 00:03:54.857 This is eight plus four plus two. 00:03:54.857 --> 00:03:59.453 So eight plus four is 12, plus two is 14. 00:03:59.453 --> 00:04:01.916 This right over here is 14. 00:04:01.916 --> 00:04:04.130 How do we represent that in hexadecimal? 00:04:04.130 --> 00:04:08.411 Well, 14 is one less than 15 so it's going to be E. 00:04:08.411 --> 00:04:10.864 This is going to be E. 00:04:10.864 --> 00:04:13.363 This is E. 00:04:13.363 --> 00:04:18.041 E is our hexadecimal representation of the number 14 00:04:18.041 --> 00:04:22.264 comes right before our representation of the number 15 F. 00:04:22.264 --> 00:04:25.593 Alright, now, how many 16s do we have? 00:04:25.593 --> 00:04:27.028 Let's see, I have no eights. 00:04:27.028 --> 00:04:28.972 I have a four, and I have a two. 00:04:28.972 --> 00:04:31.902 We're going to have six 16s. 00:04:31.902 --> 00:04:35.397 So we're going to have six 16s. 00:04:35.397 --> 00:04:38.075 Then, how many 256s do I have? 00:04:38.075 --> 00:04:40.959 I only have one 256. 00:04:40.959 --> 00:04:44.268 One 256. 00:04:44.268 --> 00:04:47.695 This number in hexadecimal, and I could write that. 00:04:47.695 --> 00:04:52.695 This is in hexadecimal right over here, is one, six, E. 00:04:53.514 --> 00:04:56.111 One, six, E. 00:04:56.111 --> 00:05:01.111 I guess you could call this 256 E, 00:05:01.188 --> 00:05:05.639 16 E. 00:05:05.639 --> 00:05:07.562 I guess 14. 00:05:07.562 --> 00:05:10.883 I (laughs) finally have to come up with a better way 00:05:10.883 --> 00:05:12.880 of reading this hexadecimal number. 00:05:12.880 --> 00:05:16.293 If you're not curious what number is this, because you don't 00:05:16.293 --> 00:05:18.356 have to go through decimal just so you could comprehend it 00:05:18.356 --> 00:05:21.046 in the number system that you're used to operating in. 00:05:21.046 --> 00:05:23.611 One that's based off from the number of fingers you have. 00:05:23.611 --> 00:05:26.279 Feel free to do so.