1 00:00:00,000 --> 00:00:04,708 [MUSIC] 2 00:00:04,708 --> 00:00:08,352 At the most basic level, when a computer runs an application, 3 00:00:08,352 --> 00:00:13,220 it follows the list of instructions you or another person has written. 4 00:00:13,220 --> 00:00:16,250 This list of instructions is called a program. 5 00:00:16,250 --> 00:00:20,270 Often programs take in or spit out some form of data. 6 00:00:20,270 --> 00:00:22,770 Whether you're checking the weather or writing a paper, 7 00:00:22,770 --> 00:00:24,680 programs are constantly handling data. 8 00:00:25,730 --> 00:00:29,300 Data [SOUND] itself is a piece or pieces of information. 9 00:00:29,300 --> 00:00:33,605 Almost all data is ultimately represented in [SOUND] binary form. 10 00:00:33,605 --> 00:00:38,510 Meaning [SOUND] data at its essence is just a series of 0s and 1s. 11 00:00:38,510 --> 00:00:41,451 [SOUND] These binary digits, 0 and 1, 12 00:00:41,451 --> 00:00:45,651 can be represented easily using electrical circuits. 13 00:00:45,651 --> 00:00:49,521 A bit, which is like a switch, is either off or on. 14 00:00:49,521 --> 00:00:51,990 If the switch is off, it's a 0. 15 00:00:51,990 --> 00:00:54,220 If it's on, it's a 1. 16 00:00:54,220 --> 00:00:58,250 An easy way to visualize binary is on a circuit board. 17 00:00:58,250 --> 00:01:06,230 To represent 1 and 0, we use high and low voltages to turn an LED on and off. 18 00:01:06,230 --> 00:01:10,530 Let's use this Texas Instrument launch pad for a tangible example of binary. 19 00:01:11,950 --> 00:01:17,660 We're using HIGH to turn the LED on to represent the binary 1. 20 00:01:17,660 --> 00:01:23,570 And to turn the LED off, we'll use LOW or the binary 0. 21 00:01:23,570 --> 00:01:30,794 But say instead I wanted to loop it from on to off or 1 to 0 and back again. 22 00:01:30,794 --> 00:01:35,599 I might write a program that looks like this. 23 00:01:35,599 --> 00:01:41,305 Turn it on, wait for a second, turn it off, wait for a second. 24 00:01:41,305 --> 00:01:46,640 Turn it on, wait for a second, turn it off, wait for a second. 25 00:01:46,640 --> 00:01:51,640 Now, this code is using Energia, which we don't really teach here at Treehouse. 26 00:01:51,640 --> 00:01:56,590 But if you're interested, in the teacher's notes I've linked the wiki page 27 00:01:56,590 --> 00:02:01,710 that you can find on GitHub and the link to the microcontroller I'm using. 28 00:02:01,710 --> 00:02:05,790 The fundamental building blocks of a computer is this idea of a switch, 29 00:02:05,790 --> 00:02:07,430 on or off. 30 00:02:07,430 --> 00:02:11,220 In a digital computer, this switch takes the form of a transistor. 31 00:02:11,220 --> 00:02:15,310 Before digital computers, they used vacuum tubes to do this. 32 00:02:15,310 --> 00:02:19,690 In order to store data or run programs, we need to first convert the programs 33 00:02:19,690 --> 00:02:23,600 into something that can actually be performed by the physical hardware. 34 00:02:23,600 --> 00:02:27,650 In most cases, this means turning the programs we write into binary.