1
00:00:05,650 --> 00:00:08,890
Hi and welcome to the new lesson.

2
00:00:09,130 --> 00:00:12,970
Today we're going to talk about bits and.

3
00:00:14,590 --> 00:00:22,810
What they mean, bits are used to represent data, bits are grouped in bytes, eight bits form a byte.

4
00:00:25,640 --> 00:00:28,940
Bits are the smallest increment of data on a computer.

5
00:00:29,880 --> 00:00:34,650
They are usually referred to as either on and off.

6
00:00:35,360 --> 00:00:46,820
Which is very common, especially in an electrical engineering major or in the normal binary digit notation

7
00:00:46,820 --> 00:00:48,470
of one in zero.

8
00:00:49,190 --> 00:00:55,610
It's funny, but people say about other people that their binary if they can't really.

9
00:00:56,670 --> 00:00:59,830
Do anything in between things need either.

10
00:01:00,920 --> 00:01:01,970
All or nothing?

11
00:01:04,070 --> 00:01:07,160
Now the bigger picture bites.

12
00:01:09,110 --> 00:01:19,700
So eight bids can be grouped together to form KiloByte Megabyte Gigabyte Terabyte, and you can actually

13
00:01:19,700 --> 00:01:28,940
go ahead and deduce how many bids are in each one of these measuring units by multiplying the bytes

14
00:01:28,940 --> 00:01:29,570
by eight.

15
00:01:32,410 --> 00:01:40,550
Inbuilt significance, this is very important because you'll be using it a lot and.

16
00:01:42,670 --> 00:01:48,220
The bit that you have to them most right here, that is the least significant bit.

17
00:01:49,870 --> 00:01:55,180
And as it was, you go more to the left, the bits gained more significance.

18
00:01:55,510 --> 00:02:03,280
And this gets tied in with the next slide you're going to see in which you see the corresponding powers

19
00:02:03,280 --> 00:02:09,970
of two for each bit location inside a binary number.

20
00:02:10,960 --> 00:02:22,030
For example, this binary number one one one one one one one one has eight bits and the the least significant

21
00:02:22,030 --> 00:02:22,540
bit.

22
00:02:22,750 --> 00:02:27,220
It's tied to two to the power of zero.

23
00:02:27,730 --> 00:02:34,660
And as we move more to the left, this one gets tied in with the two to the power of one.

24
00:02:35,320 --> 00:02:38,830
And the third one with two to the power of two.

25
00:02:39,250 --> 00:02:47,290
And so on until we get to the last one, which gets tied in to with the two two, the power of seven.

26
00:02:47,560 --> 00:02:56,590
And this one, as you can see, holds more value, more decimal value in these than any of the other

27
00:02:57,130 --> 00:02:57,730
bits.

28
00:02:59,640 --> 00:03:07,650
So here this is probably where you'll visualize this more is because we get to actually calculate how

29
00:03:07,650 --> 00:03:16,500
to turn a binary number to decimal, so we have the same example one one one one one one one one.

30
00:03:17,130 --> 00:03:24,810
What you have to do is look in this table and say, OK, my number, this is my number here, starting

31
00:03:24,810 --> 00:03:28,200
from the least significant bit on the right.

32
00:03:29,510 --> 00:03:41,660
I say one times, two to the zero plus one times two to the one plus one times two to the two plus one

33
00:03:41,660 --> 00:03:48,340
times to the power three plus one times to the power of four plus one times to the power of five.

34
00:03:48,350 --> 00:03:53,250
And you can actually follow along here two plus one times two to the six.

35
00:03:53,310 --> 00:03:55,100
But this is where it came from.

36
00:03:55,370 --> 00:03:59,270
This table plus one times two to the power of seven.

37
00:03:59,660 --> 00:04:06,860
Now, if you actually perform the calculations, you will see that this number is equal to 255.

38
00:04:11,470 --> 00:04:18,400
And we'll take another example this time is the binary number one zero one zero one zero one one.

39
00:04:19,770 --> 00:04:26,220
And we'll do it the same way, so to find out the decimal value of this will have to.

40
00:04:28,810 --> 00:04:38,020
First, like, do the multiplication between this one and two to the zero, then add the multiplication

41
00:04:38,020 --> 00:04:39,850
between the.

42
00:04:40,900 --> 00:04:41,750
Bit here.

43
00:04:41,770 --> 00:04:50,950
And the two to the power of one plus zero times, two to the power of two plus one times three to the

44
00:04:51,310 --> 00:04:59,830
two to the power of three plus zero times two to the power of four plus one times to the power of five

45
00:05:00,100 --> 00:05:05,950
plus zero times to the power of six plus one times two to the power seven.

46
00:05:07,180 --> 00:05:13,060
And now we've performed the calculation and we find out that the number.

47
00:05:14,650 --> 00:05:19,510
In decimal base is 171.

48
00:05:21,190 --> 00:05:29,920
Normal notation for binary is a zero B in front of the number, but another use notations are the one

49
00:05:29,920 --> 00:05:37,120
that I have here on the bottom, where you just add a b at the end of the binary numbers c see here.

50
00:05:37,270 --> 00:05:47,920
We grouped this number into Nemours because it's easier to visualize for us humans, but in computer,

51
00:05:47,920 --> 00:05:52,660
in inside a computer like you won't have those spaces.

52
00:05:54,620 --> 00:06:03,560
And to turn a decimal number into binary, I like to start by dividing this number.

53
00:06:03,590 --> 00:06:05,390
I'll take this example number one.

54
00:06:05,390 --> 00:06:06,170
Thirty seven.

55
00:06:06,380 --> 00:06:07,960
And now divided to two.

56
00:06:08,300 --> 00:06:12,290
The result I'll market down here is sixty eight.

57
00:06:12,500 --> 00:06:16,600
And then I also take a note of my remainder.

58
00:06:16,610 --> 00:06:17,780
Very important.

59
00:06:19,850 --> 00:06:24,110
And then I take my result in nine divided by two.

60
00:06:24,350 --> 00:06:30,560
My result of that division is 34 and I have a remainder of zero.

61
00:06:31,370 --> 00:06:37,340
Now I divide thirty four by two and my result is 17.

62
00:06:37,430 --> 00:06:39,140
My remainder is zero.

63
00:06:39,650 --> 00:06:45,200
I divide 17 by two and my result is eight and my remainder is one.

64
00:06:45,920 --> 00:06:47,990
And I divide eight by two.

65
00:06:48,140 --> 00:06:52,040
My result is four and my remainder is zero.

66
00:06:53,410 --> 00:06:56,980
Now I have four divided by two.

67
00:06:57,010 --> 00:07:03,910
My result is two and my remainder is zero two, divided by two is one.

68
00:07:04,540 --> 00:07:08,230
And in this case, I'll just move the one over here.

69
00:07:08,590 --> 00:07:16,030
And this is what gives us the binary number from the most significant bit here to the least significant

70
00:07:16,030 --> 00:07:16,210
bit.

71
00:07:16,210 --> 00:07:17,970
So this is very important.

72
00:07:17,980 --> 00:07:24,550
You have to actually write down the result of this operation in this order.

73
00:07:25,150 --> 00:07:27,790
Top to bottom to top.

74
00:07:29,110 --> 00:07:38,080
So we would say one thirty seven in decimal is equal to be one zero zero zero.

75
00:07:38,200 --> 00:07:46,330
So from here, one zero zero one once again, I have separated my bits into nibbles just to make it

76
00:07:46,330 --> 00:07:47,410
easier to read.

77
00:07:48,590 --> 00:07:58,250
So if we want to turn this binary number one zero zero zero one zero zero one back to decimal, we know

78
00:07:58,250 --> 00:07:58,790
its value.

79
00:07:58,790 --> 00:07:59,870
It's one thirty seven.

80
00:08:00,080 --> 00:08:01,790
But how do we get to that value?

81
00:08:02,150 --> 00:08:07,220
Well, we have to use the table that I have presented in the previous slide.

82
00:08:08,420 --> 00:08:20,930
And you multiply each bit with the corresponding power in the and binary table and you add it with the

83
00:08:20,930 --> 00:08:27,680
next byte multiplied, but with its corresponding power of two and so on.

84
00:08:30,610 --> 00:08:37,390
We do with all the bits, and then we perform the calculations and we get a result of one thirty seven.

85
00:08:39,450 --> 00:08:45,390
So the next base we're going to talk about is Hexadecimal also called this base 16.

86
00:08:45,780 --> 00:08:49,980
It does use 16 characters to represent the bids.

87
00:08:50,680 --> 00:08:55,380
So these are numbers from zero to 15.

88
00:08:56,400 --> 00:08:59,940
Zero to nine is represented as we normally know it.

89
00:09:01,000 --> 00:09:07,360
But 10 to 15 are represented by the first six letters in the alphabet.

90
00:09:07,930 --> 00:09:16,470
So 10 is a 11 is B, 12, A C, 13 is D, 14 is E and 15 is F.

91
00:09:16,480 --> 00:09:24,220
And here I have the table of conversion for all the hexadecimal characters.

92
00:09:24,340 --> 00:09:25,570
Zero one two three.

93
00:09:25,810 --> 00:09:28,000
As you can see all the way to F.

94
00:09:29,800 --> 00:09:32,590
And you'll be using these to convert.

95
00:09:34,950 --> 00:09:38,010
All the hexadecimal expressions, too binary.

96
00:09:38,380 --> 00:09:39,540
That's very important.

97
00:09:39,920 --> 00:09:48,420
Now also, I want to point out that the known notation for hexadecimal is zero x, as you can see here,

98
00:09:48,450 --> 00:09:50,070
zero zero zero.

99
00:09:50,430 --> 00:09:53,400
You should use this to distinguish.

100
00:09:56,130 --> 00:10:01,560
A hexadecimal notation or no from another.

101
00:10:01,920 --> 00:10:08,550
Any other base like base 10 that doesn't have anything in front of it or binary or octal?

102
00:10:09,330 --> 00:10:18,020
OK, so now we're going to take concrete example and we're going to try to turn it into binary notation

103
00:10:18,030 --> 00:10:19,110
step by step.

104
00:10:20,400 --> 00:10:27,870
So we have X DeaDBeeF, the very popular cybersecurity example that everybody talks about or likes to

105
00:10:27,870 --> 00:10:28,380
use.

106
00:10:28,770 --> 00:10:37,980
So what we're going to do is we're going to go left to right and translate each one of these characters

107
00:10:38,820 --> 00:10:42,300
hexadecimal characters into their binary correspondence.

108
00:10:42,780 --> 00:10:45,600
But you can also start a right to left.

109
00:10:45,600 --> 00:10:53,580
It doesn't really matter as long as you keep translating them one by one and you put them in the position

110
00:10:53,580 --> 00:10:57,210
where they're supposed to be put the conversions like one after another.

111
00:10:57,210 --> 00:11:06,780
If you start left to right or you put the conversions like in front, if you start from right to left

112
00:11:07,080 --> 00:11:13,710
right, so you'll translate F and then you'll translate E and you'll put it right in front of the translation.

113
00:11:13,710 --> 00:11:18,060
For F, it's important to keep the order.

114
00:11:18,840 --> 00:11:30,240
So D will be b one one zero one e is or B one one one zero e is one zero one zero and so on.

115
00:11:36,960 --> 00:11:46,770
And now we have the final expression for dead beef in binary, and it's a very large number.

116
00:11:49,580 --> 00:11:57,230
So let's say now that we need to convert this number from binary to hexadecimal, and we have no idea

117
00:11:57,230 --> 00:11:58,520
what this would be like.

118
00:12:00,190 --> 00:12:07,120
It is very important to look from the least significant bit here.

119
00:12:08,690 --> 00:12:11,630
Towards the most significant bit here.

120
00:12:11,960 --> 00:12:16,250
And split it into nibbles.

121
00:12:17,850 --> 00:12:18,210
Right.

122
00:12:18,240 --> 00:12:24,060
Leave one space in between four bits, you always start from the least significant bit here.

123
00:12:24,300 --> 00:12:25,980
Group them into four.

124
00:12:28,410 --> 00:12:36,300
Right, so now this expression happens to be an exact number of nibbles, but sometimes you have like

125
00:12:36,300 --> 00:12:38,430
one left over here or two.

126
00:12:39,090 --> 00:12:45,330
And that's not an issue, just pad with extra zeros in front of them to create and nibble.

127
00:12:46,230 --> 00:12:47,280
If that is the case.

128
00:12:48,000 --> 00:12:53,840
So now, once you have it all split into Nemours, you can do the same thing.

129
00:12:53,850 --> 00:13:02,430
You either like start converting them one nibble at a time from the right to from the right to the left

130
00:13:02,430 --> 00:13:03,710
or from the left to the right.

131
00:13:03,720 --> 00:13:09,780
It doesn't matter if you already have them all separated into nibbles in the order that they're supposed

132
00:13:09,780 --> 00:13:10,470
to be.

133
00:13:10,980 --> 00:13:21,960
So one one zero one is the one one one zero is E and use the tables for this, as it's very common to

134
00:13:21,960 --> 00:13:27,960
just make a tiny mistake on one of these expressions thinking that, you know, then I do it all the

135
00:13:27,960 --> 00:13:28,320
time.

136
00:13:28,500 --> 00:13:35,670
One one one zero one one one zero one one is a one one zero one D. And so on.

137
00:13:36,060 --> 00:13:41,010
Now we have the full expression of that beef.

138
00:13:42,990 --> 00:13:49,320
So now let's talk about how to convert text to decimal.

139
00:13:50,070 --> 00:13:55,860
And remember, from binary, we were using the table of correspondence.

140
00:13:56,070 --> 00:14:07,440
So basically each one of these characters is used to represent a power of 16 because this is base 16.

141
00:14:07,710 --> 00:14:22,800
So as is representing the 16s to the zero that we have in this hexadecimal number E represents the sixteen

142
00:14:22,800 --> 00:14:25,110
to the power of ones that we have.

143
00:14:26,470 --> 00:14:28,780
E represent the 16s.

144
00:14:29,790 --> 00:14:36,570
Now, sixteen to the power of two and so on, so we're going to do exactly the same thing that we have

145
00:14:36,570 --> 00:14:38,580
done for the binary.

146
00:14:41,510 --> 00:14:42,380
Expressions.

147
00:14:42,680 --> 00:14:45,350
So we're going to go start here.

148
00:14:45,440 --> 00:14:52,340
The least significant character, and we're going to say f times 16 to the zero because you can see

149
00:14:52,340 --> 00:14:55,350
here plus e!

150
00:14:55,400 --> 00:14:56,960
Time 16 to the one.

151
00:14:57,980 --> 00:15:01,910
Plus, E times 16 to the second.

152
00:15:03,020 --> 00:15:13,970
Plus, B times 16 to the third and so on, you go and add all of these multiplications.

153
00:15:15,190 --> 00:15:22,420
And if you do the calculations, you'll see, you'll see that this is the number used to represent that

154
00:15:22,420 --> 00:15:23,470
beef in base.

155
00:15:23,470 --> 00:15:23,920
10.

156
00:15:24,400 --> 00:15:35,680
The very large number now remember that f e b, all of these letters are just used to represent the

157
00:15:35,740 --> 00:15:38,760
numbers, you know, 10 to 15.

158
00:15:38,770 --> 00:15:40,840
So each one has a correspondent.

159
00:15:41,110 --> 00:15:42,670
F is 15.

160
00:15:42,700 --> 00:15:48,880
That's why I do this here e is 14 and so on.

161
00:15:51,580 --> 00:15:58,720
The last base that I will touch base on today is octal, which is base eight.

162
00:15:59,140 --> 00:16:08,530
There are two notations that are not as utilized here, so either you put a zero in front of the actual

163
00:16:08,530 --> 00:16:12,250
number or you put a cue after the actual number.

164
00:16:13,240 --> 00:16:16,810
However, this one is the most popular.

165
00:16:16,990 --> 00:16:19,930
It's zero lowercase.

166
00:16:19,930 --> 00:16:20,470
Oh.

167
00:16:23,540 --> 00:16:30,680
So when base eight, you have eight characters, you have zero one, two, three, four, five, six

168
00:16:30,680 --> 00:16:31,460
and seven.

169
00:16:32,690 --> 00:16:42,380
And each one of these octal characters gets represented in binary by using three bits.

170
00:16:42,710 --> 00:16:53,330
So zero in octal would be binary zero zero zero one and octal would be binary zero zero one two in October

171
00:16:53,330 --> 00:16:56,390
will be binary zero one zero and so on.

172
00:16:56,400 --> 00:17:06,290
So this is something that you could keep handy if you are performing some actual conversions.

173
00:17:07,280 --> 00:17:16,520
So I'm going to take this example here six seven zero in October base eight and we're going to try to

174
00:17:16,520 --> 00:17:23,740
convert it to binary and the same as I did for hexadecimal works here, too.

175
00:17:23,750 --> 00:17:25,760
I just take each character.

176
00:17:28,150 --> 00:17:35,530
From my octal, no, and I turn it into its binary version.

177
00:17:36,250 --> 00:17:39,160
And I just write them in the same order.

178
00:17:40,750 --> 00:17:52,930
As they are in the actual number and and when I'm done with that, this here gives me my binary notation

179
00:17:52,930 --> 00:17:56,170
for the actual number six seven zero.

180
00:17:56,170 --> 00:18:00,610
So binary, that's one one zero one one one zero zero zero.

181
00:18:01,660 --> 00:18:12,220
And if you want to turn a binary number two actor, I recommend you start from the right and go to the

182
00:18:12,220 --> 00:18:19,930
left, grouping the bits three by three and then you perform.

183
00:18:20,170 --> 00:18:31,480
You convert each group of three bits into an actor character like you hear one one two zero is six one

184
00:18:31,480 --> 00:18:35,650
one one is seven and zero zero zero is eight.

185
00:18:38,000 --> 00:18:47,900
Is a zero sorry, so if you want to turn that an actual number to decimal?

186
00:18:48,470 --> 00:18:57,290
I took this ridiculously large number, but you you will use this table just like we did for binary

187
00:18:57,470 --> 00:18:58,820
and for hexadecimal.

188
00:18:59,210 --> 00:19:06,080
Each character in the actual number gets a power of eight.

189
00:19:06,530 --> 00:19:08,000
That corresponds to it.

190
00:19:10,130 --> 00:19:18,800
So keeping that in mind, the actual number two one three one zero four six zero and transformed into

191
00:19:18,800 --> 00:19:29,270
decimal would be seven times eight to the zero plus six times eight to the one plus four times eight

192
00:19:29,270 --> 00:19:37,700
to the second, plus zero times eight to the third plus one times aide to the power of four plus three

193
00:19:37,700 --> 00:19:44,450
times eight to the power of five plus one times eight to the power of six plus two times eight to the

194
00:19:44,450 --> 00:19:45,860
power of seven.

195
00:19:46,280 --> 00:19:56,150
So if we perform the calculations here, we see this octal number is equal to four million five hundred

196
00:19:56,150 --> 00:20:00,230
and fifty nine thousand one hundred fifty nine in base ten.

197
00:20:05,640 --> 00:20:07,410
And that was it for my lesson today.
