1 00:00:00,120 --> 00:00:04,070 In order to talk to machines, you have to speak in their language. 2 00:00:04,070 --> 00:00:08,040 Early on, we figured out ways to extract code from machine languages. 3 00:00:08,040 --> 00:00:09,570 But, in order to step forward, 4 00:00:09,570 --> 00:00:12,580 we must step down to some lower level machine code. 5 00:00:12,580 --> 00:00:16,370 The binary numbering system is similar to the decimal numbering system you're 6 00:00:16,370 --> 00:00:18,770 already use to in many ways. 7 00:00:18,770 --> 00:00:21,650 The principles behind the systems are similar, but 8 00:00:21,650 --> 00:00:23,530 obviously there's some differences as well. 9 00:00:24,590 --> 00:00:27,730 Let's start with some names you may already be familiar with. 10 00:00:27,730 --> 00:00:33,510 A bit is the smallest unit in binary, and it can either be a zero or a one. 11 00:00:33,510 --> 00:00:35,610 If you put eight bits together it's a byte. 12 00:00:36,940 --> 00:00:41,720 Both the decimal and binary numbering system, are positional numbering systems 13 00:00:41,720 --> 00:00:44,730 meaning, the position of the numbers indicate the relative value. 14 00:00:45,770 --> 00:00:47,680 Let's look at an example. 15 00:00:47,680 --> 00:00:52,473 In the number 1,234, the 1 is worth 1000, 16 00:00:52,473 --> 00:00:58,341 the 2 is worth 200, the 3 is worth 30 and the 4 is worth 4. 17 00:00:58,341 --> 00:01:03,150 If you switch these numbers around, their relative values will also switch around. 18 00:01:04,890 --> 00:01:10,130 The decimal system accomplishes this place value by using 10 as the base, and 19 00:01:10,130 --> 00:01:14,190 increasing the power each time you step to the left, or 10 the 0, 10 to the 1, 20 00:01:14,190 --> 00:01:19,664 10 to the 2, are the ones, tens, and hundreds place. 21 00:01:19,664 --> 00:01:22,650 This same process happens in binary. 22 00:01:22,650 --> 00:01:27,710 Only it uses two as the base instead of ten so the first position is two to zero 23 00:01:27,710 --> 00:01:33,640 the second position is two the first, the third position is two to the second and 24 00:01:33,640 --> 00:01:37,870 the fourth position is two to the third, representing the ones, 25 00:01:37,870 --> 00:01:39,710 twos, fours and eights place. 26 00:01:41,870 --> 00:01:44,680 Now, let's use our knowledge of place value to find out 27 00:01:44,680 --> 00:01:46,650 what this bite represents. 28 00:01:46,650 --> 00:01:48,256 Don't be shy, take a guess. 29 00:01:48,256 --> 00:01:51,271 [SOUND] That's right, it's 1. 30 00:01:51,271 --> 00:01:56,300 Here we've turned on the first bit which represents a 1 or 31 00:01:56,300 --> 00:01:58,774 a 0 meaning this equals 1. 32 00:02:01,160 --> 00:02:04,810 Let's try another, what about this bite? 33 00:02:04,810 --> 00:02:10,330 Here we've turned on the second bit which represents two, so this bit equals two. 34 00:02:12,360 --> 00:02:13,340 And, what about this one? 35 00:02:14,400 --> 00:02:17,980 Here we've turned on the first two bits, the two and 36 00:02:17,980 --> 00:02:21,800 the one, because two and one equals three. 37 00:02:21,800 --> 00:02:22,980 This represents three. 38 00:02:22,980 --> 00:02:25,796 [BLANK_AUDIO] 39 00:02:25,796 --> 00:02:27,620 Let's skip ahead a little bit. 40 00:02:27,620 --> 00:02:29,230 What do you think this byte will represent? 41 00:02:30,260 --> 00:02:31,810 Here we have the 8 and 42 00:02:31,810 --> 00:02:37,360 the 2 bits turned on, so this represent 10, because 8 plus 2 is 10. 43 00:02:37,360 --> 00:02:41,260 Now, let me assure you none of the languages we teach here at 44 00:02:41,260 --> 00:02:44,100 Treehouse use the binary numbering system. 45 00:02:44,100 --> 00:02:46,920 But, it's important to know where your data is going, and 46 00:02:46,920 --> 00:02:48,210 what it looks like to a computer. 47 00:02:49,220 --> 00:02:50,370 In the next video, 48 00:02:50,370 --> 00:02:54,240 we'll look at a laptop tear down to see what data storage hardware looks like.