1
00:00:05,770 --> 00:00:09,040
Have but what's going on this is Caleb with Debb slopes dot com.

2
00:00:09,040 --> 00:00:13,120
And in this video we're going to be talking about binary.

3
00:00:13,210 --> 00:00:17,020
Now they say there are only two kinds of people in the world.

4
00:00:17,020 --> 00:00:20,220
Those who understand binary and those who don't.

5
00:00:20,230 --> 00:00:23,480
Now if you didn't get that you will understand it by the end of this video.

6
00:00:23,710 --> 00:00:31,840
And the reason for that is that binary is a system of numerical representation that uses a base two

7
00:00:31,930 --> 00:00:32,750
system.

8
00:00:32,950 --> 00:00:36,680
That means there are only two values 0 and 1.

9
00:00:36,930 --> 00:00:37,510
OK.

10
00:00:37,660 --> 00:00:41,920
Now we use a decimal number system meaning it's base 10.

11
00:00:41,950 --> 00:00:48,490
And there are 10 values 0 through 9 and we combine those to make other values of course with place value

12
00:00:48,590 --> 00:00:53,650
etc. etc. but binary simply has 0 and 1.

13
00:00:53,840 --> 00:01:00,600
And in the computer world those values represent two off meaning zero and on meaning 1 K.

14
00:01:00,610 --> 00:01:05,010
This is called boolean logic on or off true or false.

15
00:01:05,020 --> 00:01:06,100
That's that's how it works.

16
00:01:06,100 --> 00:01:07,270
That's binary.

17
00:01:07,270 --> 00:01:13,420
And of course those ons and offs zeros and ones can be combined to perform all kinds of crazy complex

18
00:01:14,680 --> 00:01:16,620
functions and stuff like that.

19
00:01:16,870 --> 00:01:20,700
But let's actually begin with an example that's common to all of us.

20
00:01:20,800 --> 00:01:23,710
The gigabyte right you're probably familiar with the gigabyte.

21
00:01:23,740 --> 00:01:29,380
Our phones come with a certain amount of gigabytes you know often not anywhere near as much as we would

22
00:01:29,380 --> 00:01:29,790
like.

23
00:01:29,800 --> 00:01:35,440
But this video is called Understanding binary So why the heck am I talking about gigabytes.

24
00:01:35,440 --> 00:01:36,060
I'll get to that.

25
00:01:36,070 --> 00:01:43,060
But something we need to know ahead of time is that a gigabyte is made up of megabytes 1024 to be exact

26
00:01:43,480 --> 00:01:48,340
a megabyte is made up of 1024 kilobytes a kilobyte.

27
00:01:48,340 --> 00:01:53,020
Can you guess it made up of 1024 bytes now.

28
00:01:53,080 --> 00:01:56,450
A Byte This is where things get a little mixed up.

29
00:01:56,560 --> 00:01:58,850
A byte is made up of 8 bits.

30
00:01:59,000 --> 00:02:04,500
Ok keep that in your brain a byte is made of 8 bits and if you cut a byte in half guess what you get.

31
00:02:04,540 --> 00:02:06,020
You get a nibble.

32
00:02:06,340 --> 00:02:06,630
Yes.

33
00:02:06,640 --> 00:02:09,010
Seriously go go look it up you can google it it's called a nibble.

34
00:02:09,010 --> 00:02:10,960
That's funny funny funny funny.

35
00:02:10,960 --> 00:02:11,860
All right.

36
00:02:11,860 --> 00:02:13,780
But that's not going actually help us here.

37
00:02:13,780 --> 00:02:18,650
So I want to show you an exploded view of one bit.

38
00:02:18,760 --> 00:02:19,110
OK.

39
00:02:19,120 --> 00:02:20,110
Now here it is.

40
00:02:20,110 --> 00:02:22,680
There are eight different channels.

41
00:02:22,880 --> 00:02:25,350
OK 8 bits right in one bite.

42
00:02:25,350 --> 00:02:32,050
Like I just said and each slot has a value and we're going to star on the far right side with the value

43
00:02:32,140 --> 00:02:38,470
one case of the far right channel is worth one then if we go to the next channel over we're going to

44
00:02:38,470 --> 00:02:42,830
go ahead and up it to two we actually multiply it by two.

45
00:02:42,940 --> 00:02:49,780
The next channel is going to get multiplied by two as well so it's equal to for the next channel 8 then

46
00:02:49,780 --> 00:02:55,140
16 then 32 then 64 and finally 128.

47
00:02:55,150 --> 00:03:00,310
So basically from right to left we are multiplying each channel by two for the next channel.

48
00:03:00,310 --> 00:03:07,110
Now of course this does continue you can go up to 2:56 than 512 than 10:24 et cetera et cetera.

49
00:03:07,120 --> 00:03:10,370
But one bit has eight channels.

50
00:03:10,520 --> 00:03:10,890
OK.

51
00:03:10,900 --> 00:03:14,100
And each of those channels you can see the values for right here.

52
00:03:14,410 --> 00:03:18,680
But what are we going to actually put in these channels what are we going to use it for.

53
00:03:18,700 --> 00:03:20,070
We're going to use binary.

54
00:03:20,230 --> 00:03:25,810
So we're going to basically put a zero in the channels that we don't care about that we don't want and

55
00:03:25,810 --> 00:03:28,660
we're going to put a one in the channels that we do care about.

56
00:03:28,660 --> 00:03:30,360
So here's an example.

57
00:03:30,400 --> 00:03:34,550
0 1 0 0 1 1 0 1.

58
00:03:34,810 --> 00:03:35,400
Well that's great.

59
00:03:35,410 --> 00:03:37,240
But you just said ziran won a bunch of time.

60
00:03:37,240 --> 00:03:38,990
So what does that supposed to mean for me.

61
00:03:39,250 --> 00:03:46,150
Well in order to convert binary into a decimal number all we need to do is simply add the values where

62
00:03:46,150 --> 00:03:50,740
there's a 1 because that means on and off is zero and it means that there is no value.

63
00:03:50,740 --> 00:03:57,460
So from left to right we can add 64 plus eight plus four plus one.

64
00:03:57,660 --> 00:04:06,370
And that gets us 77 so this value 0 1 0 0 1 1 0 1 in binary is the same thing as the decimal number

65
00:04:06,370 --> 00:04:07,420
77.

66
00:04:07,420 --> 00:04:08,390
That's pretty amazing.

67
00:04:08,410 --> 00:04:11,220
That's how binary works honestly it's that easy.

68
00:04:11,230 --> 00:04:17,560
Now if you were to put a one in every single slot 8:1 all the way across and add those up you would

69
00:04:17,560 --> 00:04:25,120
get 255 and if you've ever done any graphic design work or web development work or any type of development

70
00:04:25,720 --> 00:04:31,200
that number's probably familiar when working with color R.G. be colored to be exact now.

71
00:04:31,200 --> 00:04:33,520
RG bead color each channel.

72
00:04:33,550 --> 00:04:43,900
Red Green Blue can go up to a max of 255 and that's because each pixel has a value stored in one bit.

73
00:04:44,020 --> 00:04:44,310
Right.

74
00:04:44,320 --> 00:04:51,640
So Red would be you know maybe 255 unread and maybe 10 on green and 10 on blue it's going to be mostly

75
00:04:51,640 --> 00:04:52,330
red.

76
00:04:52,330 --> 00:04:57,310
And each of those pixels is linked to a particular bit in memory.

77
00:04:57,310 --> 00:04:59,350
That's really cool so that's how it works.

78
00:04:59,470 --> 00:05:04,020
And that's why it's 255 all those values can be stored in a single bit.

79
00:05:04,030 --> 00:05:05,100
Pretty amazing.

80
00:05:05,330 --> 00:05:08,660
Now it's time for a challenge a binary challenge.

81
00:05:08,690 --> 00:05:16,060
I'm going to give you 20 seconds to convert the following three binary numbers into their decimal counterparts.

82
00:05:16,070 --> 00:05:17,250
Be ready be prepared.

83
00:05:17,250 --> 00:05:21,290
You got your notebook you get your pen your keyboard whatever you're going to use maybe your whiteboard

84
00:05:21,320 --> 00:05:28,580
your chalkboard 20 seconds starting now.

85
00:05:34,270 --> 00:05:35,010
All

86
00:05:48,180 --> 00:05:52,270
did you get 19 109 and 238.

87
00:05:52,290 --> 00:05:52,840
Nice.

88
00:05:52,860 --> 00:05:54,870
Awesome work if you didn't go back.

89
00:05:54,870 --> 00:05:57,070
Check it again make sure you did the right thing.

90
00:05:57,150 --> 00:05:58,910
Make sure that you look at the correlation chart.

91
00:05:58,920 --> 00:06:01,360
Get it all down make sure you got it down.

92
00:06:01,590 --> 00:06:02,490
And now we're going to move on.

93
00:06:02,490 --> 00:06:06,680
So we've covered numbers in the decimal system but what about letters.

94
00:06:06,810 --> 00:06:11,010
Obviously when we type binary information gets sent into our keyboard.

95
00:06:11,130 --> 00:06:13,230
But how does that actually turn into a letter.

96
00:06:13,330 --> 00:06:19,050
Of course typing letters and showing numbers on the screen that's not going to work.

97
00:06:19,050 --> 00:06:24,330
So what people decided to do was to create something called ASCII see I.

98
00:06:24,460 --> 00:06:25,210
All right.

99
00:06:25,320 --> 00:06:31,670
And Aski is essentially a correlation chart from a binary value into a letter.

100
00:06:31,680 --> 00:06:36,480
So there's a chart a particular binary value is going to be equal to a particular letter.

101
00:06:36,480 --> 00:06:42,170
Now it could be super duper complicated but it's actually really really easy.

102
00:06:42,180 --> 00:06:48,570
Basically the ASCII to binary and binary to ASCII conversion chart takes the binary representations

103
00:06:48,630 --> 00:06:55,020
of the numbers 1 through 26 for each of the letters in our alphabet and it compares that number with

104
00:06:55,020 --> 00:07:01,950
the place in the alphabet so the value 3 would be the letter C 5 would be e 26 would be Z or Zed depending

105
00:07:01,950 --> 00:07:03,590
on where you from.

106
00:07:03,690 --> 00:07:09,990
And so since the highest placeholder in our binary chart that we'll ever have to use is 16 that gets

107
00:07:09,990 --> 00:07:11,010
you 26.

108
00:07:11,040 --> 00:07:13,140
That's the highest you're ever going to need.

109
00:07:13,230 --> 00:07:18,960
Those are going to be stored in those first five channels and the top three channels are going to help

110
00:07:18,960 --> 00:07:22,320
us know whether or not the letter is capital or lowercase.

111
00:07:22,320 --> 00:07:23,150
Pretty cool.

112
00:07:23,400 --> 00:07:29,630
So we're going to store the number value for 1 through 26 then 128 is always going to be zero.

113
00:07:29,700 --> 00:07:29,930
OK.

114
00:07:29,940 --> 00:07:33,140
It'll never have a 1 unless you're getting into different characters.

115
00:07:33,150 --> 00:07:35,510
But we're just talking about letters for now.

116
00:07:35,940 --> 00:07:42,240
And basically if you want to convert a capital letter you're going to have a one in the Sixty-Four place

117
00:07:42,450 --> 00:07:46,030
and a 0 in the 32 place for a lowercase letter.

118
00:07:46,170 --> 00:07:49,690
You have a 1 in both 64 and 32.

119
00:07:49,740 --> 00:07:56,250
Then after that you basically just read the last five channels and whatever value that ends up converting

120
00:07:56,250 --> 00:08:01,280
into your number or your letter I guess from 1 through 26 right.

121
00:08:01,290 --> 00:08:02,510
Based on the place.

122
00:08:02,580 --> 00:08:04,460
So it's time for a challenge.

123
00:08:04,500 --> 00:08:06,370
You ready prepared.

124
00:08:06,510 --> 00:08:07,320
Good to go.

125
00:08:07,320 --> 00:08:14,940
Here we go you have 30 seconds to convert the following binary word into the ASCII counterpart.

126
00:08:14,940 --> 00:08:18,760
Are you ready 30 seconds starting now.

127
00:08:41,240 --> 00:08:46,680
An

128
00:08:52,030 --> 00:09:00,310
did you get the word code nice if you didn't go back and check should be a capital C lowercase o d e.

129
00:09:00,350 --> 00:09:02,010
Amazing job.

130
00:09:02,240 --> 00:09:05,130
So believe it or not this is how binary works.

131
00:09:05,150 --> 00:09:07,940
Easy is that it's not as intense or scarier.

132
00:09:07,990 --> 00:09:10,270
You know the matrix like as you might think.

133
00:09:10,320 --> 00:09:14,160
No fool it's super easy really cool to work with.

134
00:09:14,540 --> 00:09:19,850
You know thankfully we don't have to actually use binary to program Nowadays we have programming languages

135
00:09:19,850 --> 00:09:24,590
that get converted into assembly language then machine language and then it gets converted down into

136
00:09:24,590 --> 00:09:30,990
binary some super super super smart engineers built that all for us which we can be very grateful for.

137
00:09:31,190 --> 00:09:32,420
So yeah that's binary.

138
00:09:32,420 --> 00:09:35,200
Let's head over to the next video and let's continue learning.

139
00:09:35,210 --> 00:09:37,640
This is Caleb with Deb's slopes dot com.
