1
1

00:00:00,510  -->  00:00:01,940
<v ->Now, at this point of the course,</v>
2

2

00:00:01,940  -->  00:00:04,890
we're about to jump into the area that most students dread
3

3

00:00:04,890  -->  00:00:06,160
when it comes to networking.
4

4

00:00:06,160  -->  00:00:08,210
And this is known as subnetting.
5

5

00:00:08,210  -->  00:00:10,340
Now, don't worry, I'm going to get you through it.
6

6

00:00:10,340  -->  00:00:11,340
But this is probably one
7

7

00:00:11,340  -->  00:00:13,550
of the hardest concepts on the exam,
8

8

00:00:13,550  -->  00:00:15,850
you may need to go through this section a couple of times
9

9

00:00:15,850  -->  00:00:17,390
to make sure you grasp it.
10

10

00:00:17,390  -->  00:00:19,500
Now, what we're going to do is I'm going to go through
11

11

00:00:19,500  -->  00:00:21,590
and we're going to do the hard way first,
12

12

00:00:21,590  -->  00:00:24,180
so you understand the theory and how it all works.
13

13

00:00:24,180  -->  00:00:26,310
Then, I'm going to show you a shortcut
14

14

00:00:26,310  -->  00:00:28,780
and how to get through it for the exam a lot easier.
15

15

00:00:28,780  -->  00:00:31,250
But please don't skip the next couple of lessons
16

16

00:00:31,250  -->  00:00:32,830
of going through the hard way first,
17

17

00:00:32,830  -->  00:00:34,550
because if you don't understand the hard way,
18

18

00:00:34,550  -->  00:00:36,980
the easy way will make zero sense to you.
19

19

00:00:36,980  -->  00:00:40,070
So, as we go forward, we're going to stop and take this lesson
20

20

00:00:40,070  -->  00:00:42,470
to talk about computer mathematics.
21

21

00:00:42,470  -->  00:00:45,060
Now, this is important because computers do their numbering
22

22

00:00:45,060  -->  00:00:47,720
and do math a little bit differently than we do.
23

23

00:00:47,720  -->  00:00:51,180
Now, as a kid, you learn to count in what's known as Base-10.
24

24

00:00:51,180  -->  00:00:52,910
This is a decimal number, right?
25

25

00:00:52,910  -->  00:00:54,200
Decimal meaning 10.
26

26

00:00:54,200  -->  00:00:56,787
And so, when I count, you would start at zero,
27

27

00:00:56,787  -->  00:00:59,810
and it goes zero, one, two, three, four, five, six , seven,
28

28

00:00:59,810  -->  00:01:00,980
eight, nine.
29

29

00:01:00,980  -->  00:01:02,660
Now, what comes next?
30

30

00:01:02,660  -->  00:01:04,940
Well, we go to the second column, we put a one there,
31

31

00:01:04,940  -->  00:01:05,850
and we go back to zero.
32

32

00:01:05,850  -->  00:01:08,420
So, now we go from nine to 10.
33

33

00:01:08,420  -->  00:01:09,460
And then, we keep counting up,
34

34

00:01:09,460  -->  00:01:11,680
and eventually, we get to 98, 99.
35

35

00:01:11,680  -->  00:01:13,680
And then go, "Oh, I need another column,"
36

36

00:01:13,680  -->  00:01:15,670
put another one there and add two zeros.
37

37

00:01:15,670  -->  00:01:16,760
That's 100.
38

38

00:01:16,760  -->  00:01:18,960
So I go 98, 99, 100, right?
39

39

00:01:18,960  -->  00:01:20,250
And that's the whole idea here
40

40

00:01:20,250  -->  00:01:22,220
when we talk about decimal, right?
41

41

00:01:22,220  -->  00:01:23,110
When we talk about decimal,
42

42

00:01:23,110  -->  00:01:25,330
we only have 10 choices for the numbers.
43

43

00:01:25,330  -->  00:01:28,750
Each decimal place can only be zero, one, two, three, four,
44

44

00:01:28,750  -->  00:01:30,110
five, six, seven, eight, nine.
45

45

00:01:30,110  -->  00:01:31,740
Those are 10 options.
46

46

00:01:31,740  -->  00:01:32,900
Now, computers and networks
47

47

00:01:32,900  -->  00:01:35,150
don't actually understand decimal natively.
48

48

00:01:35,150  -->  00:01:36,640
So, even though we've been using decimal
49

49

00:01:36,640  -->  00:01:38,550
when talking about IPv4 addresses,
50

50

00:01:38,550  -->  00:01:40,510
that's not how computers see them.
51

51

00:01:40,510  -->  00:01:42,390
Computers do everything in binary,
52

52

00:01:42,390  -->  00:01:44,070
which is base-2 numbering.
53

53

00:01:44,070  -->  00:01:47,040
That means, every single digit is either a one
54

54

00:01:47,040  -->  00:01:50,390
or it's a zero, that's an on or it's an off.
55

55

00:01:50,390  -->  00:01:52,550
That is how computers understand things.
56

56

00:01:52,550  -->  00:01:55,303
And so, when they count, they go 011011100111
57

57

00:01:59,510  -->  00:02:01,310
and they keep going like that.
58

58

00:02:01,310  -->  00:02:03,930
The one zero is actually the number two for us.
59

59

00:02:03,930  -->  00:02:08,210
But for them in binary, that is actually a one zero
60

60

00:02:08,210  -->  00:02:11,010
and one zero equates to two, because it's the third thing,
61

61

00:02:11,010  -->  00:02:13,300
we got to zero one two.
62

62

00:02:13,300  -->  00:02:15,230
Now, that's the way this works with a computer.
63

63

00:02:15,230  -->  00:02:16,860
And so, we have to understand
64

64

00:02:16,860  -->  00:02:18,540
how things are written in decimal
65

65

00:02:18,540  -->  00:02:20,010
and how things are written in binary,
66

66

00:02:20,010  -->  00:02:22,190
and how to convert between the two.
67

67

00:02:22,190  -->  00:02:23,180
And that's what we're going to talk
68

68

00:02:23,180  -->  00:02:25,250
about in this particular lesson.
69

69

00:02:25,250  -->  00:02:27,860
Now, when we convert from binary to decimal,
70

70

00:02:27,860  -->  00:02:29,540
we're going to do this using a table
71

71

00:02:29,540  -->  00:02:31,150
that I have here on the screen.
72

72

00:02:31,150  -->  00:02:33,310
Each number is a factor of two.
73

73

00:02:33,310  -->  00:02:35,270
And so, this way, we can start going
74

74

00:02:35,270  -->  00:02:37,170
and putting them as placeholders of one
75

75

00:02:37,170  -->  00:02:39,520
or zero as we go through each place.
76

76

00:02:39,520  -->  00:02:43,410
So, if we start on the right, and we go left, we have one,
77

77

00:02:43,410  -->  00:02:46,230
and then, we have a place of one, right?
78

78

00:02:46,230  -->  00:02:49,840
Now, if I put a one zero in the second and first columns,
79

79

00:02:49,840  -->  00:02:51,910
this is going to become two.
80

80

00:02:51,910  -->  00:02:54,350
And we keep going through as we keep counting.
81

81

00:02:54,350  -->  00:02:55,870
Now, if you're not getting it quite yet,
82

82

00:02:55,870  -->  00:02:57,830
you will by the end of this lesson, I promise.
83

83

00:02:57,830  -->  00:02:59,050
So, let's just keep going ahead
84

84

00:02:59,050  -->  00:03:01,130
and we're going to do some examples together.
85

85

00:03:01,130  -->  00:03:03,973
Let's say I give you the binary number of 10010110.
86

86

00:03:06,450  -->  00:03:07,700
And I asked you to tell me
87

87

00:03:07,700  -->  00:03:10,420
what is this if I put it into decimal?
88

88

00:03:10,420  -->  00:03:12,680
Well, we're going to first by populating the table
89

89

00:03:12,680  -->  00:03:15,160
starting from the right and going to the left.
90

90

00:03:15,160  -->  00:03:16,930
And so, we're going to put the number there
91

91

00:03:16,930  -->  00:03:18,120
that we have from right to left
92

92

00:03:18,120  -->  00:03:20,150
and end up with what you see here on the screen,
93

93

00:03:20,150  -->  00:03:24,650
it turns into 1001011, and zero.
94

94

00:03:24,650  -->  00:03:26,630
Now, there's a place where there's a one,
95

95

00:03:26,630  -->  00:03:28,360
and I'm going to add the number above it.
96

96

00:03:28,360  -->  00:03:33,360
So, if I see something like 128, plus 16, plus four plus two,
97

97

00:03:34,400  -->  00:03:38,120
and I add that all together, I'm going to get 150.
98

98

00:03:38,120  -->  00:03:43,120
That is the number 10010110 in binary,
99

99

00:03:43,270  -->  00:03:46,020
and it translates to 150 in decimal.
100

100

00:03:46,020  -->  00:03:48,480
You see how easy that is if you have the little chart.
101

101

00:03:48,480  -->  00:03:50,370
So, if you make this chart on your paper,
102

102

00:03:50,370  -->  00:03:51,510
when you sit down for the exam,
103

103

00:03:51,510  -->  00:03:53,920
it's going to make things a lot easier for you.
104

104

00:03:53,920  -->  00:03:55,970
Again, going from right to left on the chart,
105

105

00:03:55,970  -->  00:04:00,540
each position starts out with the number of one, two
106

106

00:04:00,540  -->  00:04:04,410
four, eight, 16, 32, 64, 128,
107

107

00:04:04,410  -->  00:04:07,530
we keep multiplying by two as we go from right to left.
108

108

00:04:07,530  -->  00:04:09,200
And so, if I added up every single one
109

109

00:04:09,200  -->  00:04:10,400
of those with one in it,
110

110

00:04:10,400  -->  00:04:13,760
guess what the biggest number I could get is? 255.
111

111

00:04:13,760  -->  00:04:16,420
Which, if you remember when I talked about IPv4,
112

112

00:04:16,420  -->  00:04:20,470
all my numbers were either zero all the way up through 255.
113

113

00:04:20,470  -->  00:04:21,970
That's my four octets.
114

114

00:04:21,970  -->  00:04:23,920
Well, that's because I have eight digits
115

115

00:04:23,920  -->  00:04:25,840
in each of those octets, right?
116

116

00:04:25,840  -->  00:04:27,800
And each digit, each binary digit,
117

117

00:04:27,800  -->  00:04:29,700
can only hold a one or a zero.
118

118

00:04:29,700  -->  00:04:31,560
Now, what if I gave you a decimal number,
119

119

00:04:31,560  -->  00:04:32,880
like from an IP address
120

120

00:04:32,880  -->  00:04:34,670
and asked you to convert that to binary?
121

121

00:04:34,670  -->  00:04:35,810
Could you do it?
122

122

00:04:35,810  -->  00:04:36,770
Well, the answer is yes,
123

123

00:04:36,770  -->  00:04:39,450
it's the exact same process we just did.
124

124

00:04:39,450  -->  00:04:41,630
So, let's take a number from 167
125

125

00:04:41,630  -->  00:04:43,800
and convert it backwards to binary.
126

126

00:04:43,800  -->  00:04:45,960
That'd be one of the octets inside of an IP address,
127

127

00:04:45,960  -->  00:04:46,930
for instance.
128

128

00:04:46,930  -->  00:04:48,300
Well, instead of adding up,
129

129

00:04:48,300  -->  00:04:49,820
we're going to to be subtracting.
130

130

00:04:49,820  -->  00:04:51,890
So, when I do this, I'll take 167
131

131

00:04:51,890  -->  00:04:53,460
and I'll start from the left.
132

132

00:04:53,460  -->  00:04:56,300
Can I take 128 out of 167?
133

133

00:04:56,300  -->  00:04:57,220
Yes, I can.
134

134

00:04:57,220  -->  00:04:59,000
And I'll have 39 leftover.
135

135

00:04:59,000  -->  00:05:00,440
Then, I go to the next column.
136

136

00:05:00,440  -->  00:05:01,560
That's 64.
137

137

00:05:01,560  -->  00:05:03,760
Can I take 64 from 39?
138

138

00:05:03,760  -->  00:05:05,550
No, because there's not enough there.
139

139

00:05:05,550  -->  00:05:08,010
So, I'll put a zero under the 64 column.
140

140

00:05:08,010  -->  00:05:10,480
Then, I'll say, Can I take 32 out of 39?
141

141

00:05:10,480  -->  00:05:11,400
Yes, I can.
142

142

00:05:11,400  -->  00:05:12,930
And I'll have seven left over.
143

143

00:05:12,930  -->  00:05:14,590
So, I'll put one in that column.
144

144

00:05:14,590  -->  00:05:16,670
Then. I look, can I take 16 from seven?
145

145

00:05:16,670  -->  00:05:18,340
No, so I put a zero.
146

146

00:05:18,340  -->  00:05:19,620
How about eight from seven?
147

147

00:05:19,620  -->  00:05:21,290
No, so I put a zero.
148

148

00:05:21,290  -->  00:05:22,640
How about four from seven?
149

149

00:05:22,640  -->  00:05:24,650
Yes, and that leaves me with three.
150

150

00:05:24,650  -->  00:05:26,540
Can I go ahead and take two from three?
151

151

00:05:26,540  -->  00:05:28,600
Yes, I'll put a one in that column.
152

152

00:05:28,600  -->  00:05:30,100
And then, can I take one from one?
153

153

00:05:30,100  -->  00:05:32,230
Yes, and I'll put a one down for that.
154

154

00:05:32,230  -->  00:05:34,970
And this is how you convert from decimal back to binary,
155

155

00:05:34,970  -->  00:05:36,890
you're going to subtract all the way down.
156

156

00:05:36,890  -->  00:05:39,080
Just like what I went from binary to decimal,
157

157

00:05:39,080  -->  00:05:41,230
I ended up going from decimal to binary,
158

158

00:05:41,230  -->  00:05:43,010
I'm going to go ahead and subtract.
159

159

00:05:43,010  -->  00:05:45,410
Now, either way, if you have this chart down,
160

160

00:05:45,410  -->  00:05:46,490
these factors of two,
161

161

00:05:46,490  -->  00:05:48,910
it makes these problems very, very easy.
162

162

00:05:48,910  -->  00:05:50,750
So, now that we have that example underway,
163

163

00:05:50,750  -->  00:05:53,743
and we see that 167 is actually 10100111.
164

164

00:05:56,060  -->  00:05:58,660
How can I check my math and make sure I got it right?
165

165

00:05:58,660  -->  00:06:00,570
Well, I can go the other way.
166

166

00:06:00,570  -->  00:06:03,610
And I can add up the numbers and they all come back to 167.
167

167

00:06:03,610  -->  00:06:05,270
That means, I did the problem correctly.
168

168

00:06:05,270  -->  00:06:06,830
So, let's check our answer,
169

169

00:06:06,830  -->  00:06:11,830
128 plus 32 plus four plus two plus one, that equals 167.
170

170

00:06:12,180  -->  00:06:14,540
That means, we did our math problem correctly.
171

171

00:06:14,540  -->  00:06:16,930
Now, in the next lesson, I'm going to give you some problems.
172

172

00:06:16,930  -->  00:06:18,410
And we're going to try these together
173

173

00:06:18,410  -->  00:06:20,070
and see if you understand these concepts
174

174

00:06:20,070  -->  00:06:21,940
because it is really, really important
175

175

00:06:21,940  -->  00:06:23,223
as we go into subnetting.
