1
00:00:01,000 --> 00:00:07,000
Now imagine once again that we have 8 cables and there's current on every cable

2
00:00:07,000 --> 00:00:11,000
so current on the first cable, second one and so forth and so on

3
00:00:11,000 --> 00:00:20,000
each cable has current, that means that this value is 128, 64, 32, and so forth

4
00:00:20,000 --> 00:00:22,000
If you add all those values together

5
00:00:22,000 --> 00:00:30,000
so 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1, you get a value of 255

6
00:00:30,000 --> 00:00:39,000
Thus 8 binary 1s equals 255 in decimal, that's because each logical cable

7
00:00:39,000 --> 00:00:43,000
is set on, in other words, it has a value of 1 and this value for example

8
00:00:43,000 --> 00:00:49,000
represents 2 to the power of 5 which equals 32 in decimal

9
00:00:49,000 --> 00:00:55,000
So adding all of those values together gives you a value of 255 in decimal

10
00:00:55,000 --> 00:00:59,000
So let's demonstrate this using a Windows calculator

11
00:00:59,000 --> 00:01:04,000
So in this example, I'm going to go to calculator and change it to programmer

12
00:01:04,000 --> 00:01:07,000
This allows me to see both decimal and binary values

13
00:01:07,000 --> 00:01:14,000
So 255 in decimal is equivalent to 8 binary 1s or once again

14
00:01:14,000 --> 00:01:18,000
8 binary 1s is equivalent to 255 in decimal

15
00:01:18,000 --> 00:01:22,000
255 in decimal is equivalent to 8 binary 1s

16
00:01:22,000 --> 00:01:29,000
So here's another example, what is the binary equivalent of 1 in decimal?

17
00:01:29,000 --> 00:01:35,000
So using our table, the decimal value is 1, that means that these values are

18
00:01:35,000 --> 00:01:39,000
are all turned off, in other words, the binary equivalent is 0

19
00:01:39,000 --> 00:01:43,000
for the first 7 values, but the last value is turned on

20
00:01:43,000 --> 00:01:50,000
So 1 in decimal is equivalent to 7 binary 0s followed by binary 1

21
00:01:50,000 --> 00:01:53,000
Once again using our Windows calculator

22
00:01:53,000 --> 00:01:56,000
1 in decimal is equivalent to 1 in binary

23
00:01:56,000 --> 00:02:00,000
but because we're using this mainly with IP Addressing you'll tend to write

24
00:02:00,000 --> 00:02:05,000
it as follows, the Windows calculator removes the leading 0s

25
00:02:05,000 --> 00:02:10,000
So 1 in decimal is equivalent to 1 in binary, in this example what is

26
00:02:10,000 --> 00:02:14,000
equivalent binary value of 192 in decimal?

27
00:02:14,000 --> 00:02:21,000
So using our table 192 is equivalent to 128 + 64 which implies that the

28
00:02:21,000 --> 00:02:27,000
first bit is on and the second bit is on but the remaining bits are set to 0

29
00:02:27,000 --> 00:02:38,000
128 + 64 = 192, thus, 11 followed by 6 binary 0s, is equivalent to 192 in decimal

30
00:02:38,000 --> 00:02:43,000
using our Windows calculator once again, a 192 in decimal equals

31
00:02:43,000 --> 00:02:52,000
11000000 in binary which is once again the equivalent of 192 in decimal

32
00:02:52,000 --> 00:02:58,000
Here's another example, what is the binary equivalent of 253 in decimal?

33
00:02:58,000 --> 00:03:08,000
Now 253 in decimal is a 128 + 64 + 32 + 16 + 8 + 4 + 1

34
00:03:08,000 --> 00:03:11,000
and once again that gives you 253

35
00:03:11,000 --> 00:03:18,000
So 128 means the first or most significant bit is set on

36
00:03:18,000 --> 00:03:24,000
64 implies the second bit is on, 32 means that the third bit is on

37
00:03:24,000 --> 00:03:29,000
16 means the fourth bit is on, 8 means the fifth bit is on

38
00:03:29,000 --> 00:03:34,000
4 means the sixth bit is on and the 1 means that the last bit

39
00:03:34,000 --> 00:03:40,000
or least significant bit is on, 2 is set off in this example

40
00:03:40,000 --> 00:03:46,000
So 253 in decimal is equal to 6 binary 1s followed

41
00:03:46,000 --> 00:03:50,000
by binary 0 followed by binary 1

42
00:03:50,000 --> 00:03:54,000
So 253 equals 6 binary 1s followed by 0, followed by 1

43
00:03:54,000 --> 00:03:59,000
So I am hoping at this point you have a good understanding on how to convert

44
00:03:59,000 --> 00:04:03,000
decimal to binary and back again. There are many tricks with regards to

45
00:04:03,000 --> 00:04:07,000
binary that can allow you to speed up the calculations

46
00:04:07,000 --> 00:04:15,000
One example would be that 255 - 2 = 253, in other words, this value is set off

47
00:04:15,000 --> 00:04:22,000
which allows you to work out that 255 looks like this but that bit is set off

48
00:04:22,000 --> 00:04:27,000
so 253 looks like this
