1
00:00:12,269 --> 00:00:19,390
welcome welcome to chapter two the language
of bits so in this chapter ah we will study
2
00:00:19,390 --> 00:00:24,279
everything about bits which is the basic zero
or one and what they can achieve ah again
3
00:00:24,279 --> 00:00:31,379
ah these slights are part of the book computer
organization architecture publish by micro
4
00:00:31,379 --> 00:00:37,500
hill in two thousand fifteen so here where
the five main point that will cover ah boolean
5
00:00:37,500 --> 00:00:44,149
algebra so boolean algebra is the algebra
basic bits how to represent positive integers
6
00:00:44,149 --> 00:00:49,350
with ah zero is in ones how to represent negative
integer with zero is an ones how to represent
7
00:00:49,350 --> 00:00:56,890
ah number to the decimal point ah call fourteen
points numbers with zero is an ones and how
8
00:00:56,890 --> 00:01:03,360
to represent pieces of text namely strings
with zero is an ones
9
00:01:03,360 --> 00:01:13,190
so what does the computer understand the computer
is not smart enough to understand languages
10
00:01:13,190 --> 00:01:21,290
that we human beings can understand and that
is language such as english or arabic or french
11
00:01:21,290 --> 00:01:25,560
computers are not even smart enough ah to
understand ah programming languages such as
12
00:01:25,560 --> 00:01:29,299
java and c plus plus thats the reason it is
typically necessary to use a complier which
13
00:01:29,299 --> 00:01:37,439
can convert a java program or c plus plus
or c program into a sequence of b six zeros
14
00:01:37,439 --> 00:01:43,829
and ones which the computer can understand
so this processes as we have discus in chapter
15
00:01:43,829 --> 00:01:48,509
one is known as compilation and this is typically
done by a compiler
16
00:01:48,509 --> 00:01:56,669
so lets define the terms ah with regards to
zeros and ones say bit mean ah basic variable
17
00:01:56,669 --> 00:02:06,509
which can take only two values which is the
zero or a one ah byte is the sequence of eight
18
00:02:06,509 --> 00:02:13,830
bits which means eight numbers for each number
can arrived the zero or one ah word is the
19
00:02:13,830 --> 00:02:24,080
sequence of four bytes or thirty two bits
and a kilo bytes so kilo here means thousand
20
00:02:24,080 --> 00:02:28,130
is defined as thousand twenty four bytes why
thousand twenty four is interesting so as
21
00:02:28,130 --> 00:02:35,660
will is see thousand twenty four is an interesting
number in the senses two race to the power
22
00:02:35,660 --> 00:02:42,040
ten is equal to thousand twenty four and this
gives us some interesting property is to reason
23
00:02:42,040 --> 00:02:51,200
about such systems so ah typically you know
when to use a word kilo ah you will find mix
24
00:02:51,200 --> 00:02:55,230
references in the senses some places it is
use for thousand and some cases its use for
25
00:02:55,230 --> 00:03:00,900
thousand twenty four typically in computer
science we would use ah kilo the term kilo
26
00:03:00,900 --> 00:03:05,970
as in kilo byte as thousand twenty four bytes
because thousand twenty four is two raise
27
00:03:05,970 --> 00:03:13,720
the power ten and as usually see in the latter
half of the chapter the this gives us some
28
00:03:13,720 --> 00:03:19,210
interesting properties
similarly we can defined mega so mega is ah
29
00:03:19,210 --> 00:03:29,590
kilo times a kilo which is roughly thousand
times thousand or a million and in computer
30
00:03:29,590 --> 00:03:37,560
science mega is typically two raise to the
power ten multiplied by two raise to the power
31
00:03:37,560 --> 00:03:47,150
ten which is two raise to the power twenty
so this is what ah million is ah ah mega byte
32
00:03:47,150 --> 00:03:52,430
and this is ah close to one million ten to
the power six so as a result you will find
33
00:03:52,430 --> 00:03:55,360
ah both the number being used and which variant
is being use needs to be in fort from the
34
00:03:55,360 --> 00:03:58,520
contest
so now lets take a look at some basic logical
35
00:03:58,520 --> 00:04:03,750
operations one bits so lets ah so bits ah
bit is also called a boolean variable in owner
36
00:04:03,750 --> 00:04:09,360
of ah gorge bull say bit is also called a
boolean variable so boolean variable can only
37
00:04:09,360 --> 00:04:12,640
take values zero or one so lets defined some
simple operations so lets first defined the
38
00:04:12,640 --> 00:04:17,160
or operation the or operation means either
ah so if before that let me defined the contest
39
00:04:17,160 --> 00:04:23,910
say a can take only two values zero or one
so typically zero is also called falls which
40
00:04:23,910 --> 00:04:28,990
means thats a statement is not correct and
one also means true so in the contest of this
41
00:04:28,990 --> 00:04:37,749
we can interpreted the or operation the or
operation says either a or b which been it
42
00:04:37,749 --> 00:04:46,449
either one of them is true so lets take a
look at what this means in the stable over
43
00:04:46,449 --> 00:04:53,669
here which is also called a truth table because
it truth table typically as all combinations
44
00:04:53,669 --> 00:05:02,050
of the input values and the final function
so as we can see from here if a and b both
45
00:05:02,050 --> 00:05:06,849
are zero ah which basically means it both
the values are falls say a or b so the also
46
00:05:06,849 --> 00:05:18,110
a mathematical symbols or is plus say a or
b is also zero so in terms of ah common sense
47
00:05:18,110 --> 00:05:28,529
it can say that look if two friends the name
of one friend is a and the name of the second
48
00:05:28,529 --> 00:05:36,479
friend is b if both of them are saying something
which is falls then we can say that the combination
49
00:05:36,479 --> 00:05:46,050
of a and b both of them together are also
saying something that is falls or nobody is
50
00:05:46,050 --> 00:05:52,620
telling the truth
now if it is possible that a is saying something
51
00:05:52,620 --> 00:06:04,039
that is true and b saying something that is
falls we can say that you know the combination
52
00:06:04,039 --> 00:06:14,979
of a and b at least one of them is speaking
the truth and this logic is the this or logic
53
00:06:14,979 --> 00:06:21,909
which means either a is true or b is true
is actually correct it is true because one
54
00:06:21,909 --> 00:06:27,819
of them is one so the final output is also
one over here similarly a symmetric situation
55
00:06:27,819 --> 00:06:36,719
holes over here that is a is zero and b is
one at least one of them is one say a or b
56
00:06:36,719 --> 00:06:42,430
here is also equal to one
finally if a is one and b is one at least
57
00:06:42,430 --> 00:06:50,410
one of them is one is correct so the final
output is one so this is the or logic the
58
00:06:50,410 --> 00:06:58,590
or logic basically says that only if a is
equal to zero and b is equal to zero is the
59
00:06:58,590 --> 00:07:07,710
final output equal to zero otherwise is it
is equal to one and all cases similarly lets
60
00:07:07,710 --> 00:07:14,919
defined the and operator on boolean variables
are boolean bits and typically the symbol
61
00:07:14,919 --> 00:07:21,949
for and is a dot as i have shown over here
so lets take a look so lets again assume two
62
00:07:21,949 --> 00:07:27,629
friends a and b we want only both of them
are speaking the truth which means one do
63
00:07:27,629 --> 00:07:35,779
you want to make a and b equal to one otherwise
it is zero and all cases so we can see in
64
00:07:35,779 --> 00:07:50,710
a sense this is similar to multiplication
as well so if a is zero and b is zero we see
65
00:07:50,710 --> 00:08:03,830
that a and b is zero because in the care in
lets say in the example of speaking they truth
66
00:08:03,830 --> 00:08:10,719
both ah both of them defiantly not speaking
the truth if a is one and b is zero both of
67
00:08:10,719 --> 00:08:16,240
them are also not speaking the truth because
in this case b is saying something that is
68
00:08:16,240 --> 00:08:18,919
falls so you can see that one and zero is
equal to zero
69
00:08:18,919 --> 00:08:23,000
similarly is symmetric situation also where
here where zero and one is equal to zero so
70
00:08:23,000 --> 00:08:26,309
vennius an and function positive it is positive
in only one case which is the last case that
71
00:08:26,309 --> 00:08:32,219
i am showing over here were a is equal to
one and b is equal to one this is when both
72
00:08:32,219 --> 00:08:37,669
are speaking the truth so let me give an example
lets assume that you have two friends right
73
00:08:37,669 --> 00:08:46,470
and or simplicity they are names are a and
b and lets assume that they go ah and you
74
00:08:46,470 --> 00:08:54,580
want to ask a that have you had an ice cream
if a speaks the truth then you gave a one
75
00:08:54,580 --> 00:09:06,610
point otherwise ah give a zero points similarly
we ask the same question to b and if b speaks
76
00:09:06,610 --> 00:09:13,010
the truth ah b gets one point ah otherwise
b gets zero points
77
00:09:13,010 --> 00:09:20,520
so in the case of ah you know in this particular
case ah we have if you want to have an and
78
00:09:20,520 --> 00:09:28,680
logic you say that the function a and b the
function a and b is true if both a and b individually
79
00:09:28,680 --> 00:09:33,810
its speaking the truth which means that a
is equal to one and b is equal to one then
80
00:09:33,810 --> 00:09:39,650
a and b is equal to one otherwise in all the
other cases the output is equal to zero as
81
00:09:39,650 --> 00:09:44,790
we can see over here
the we will be using these two basics functions
82
00:09:44,790 --> 00:09:53,170
the or and the and function in detail see
you can take a look at the book for more details
83
00:09:53,170 --> 00:09:58,900
or another book on boolean logic in boolean
algebra to get a slightly deeper perspective
84
00:09:58,900 --> 00:10:05,860
on the or and functions we can have a similar
function and nand function so an nand function
85
00:10:05,860 --> 00:10:12,660
is actually the boolean inverse so lets first
define at this compliment operator of a nand
86
00:10:12,660 --> 00:10:22,130
so what is the compliment ah compliment is
very simple the compliment or zero is equal
87
00:10:22,130 --> 00:10:29,332
to one is essentially inverts so if you have
a zero the compliment of the this is one and
88
00:10:29,332 --> 00:10:35,660
the compliment one is equal to zero so a nand
function whenever the and function yields
89
00:10:35,660 --> 00:10:44,280
a one nand yields a zero and when and yields
a zero nand yields a one it is like a inverse
90
00:10:44,280 --> 00:10:56,810
of it so as we can see take a look at the
truth table over here let be the show the
91
00:10:56,810 --> 00:11:09,910
previous one we have zero zero zero and one
so this is the exact inverse of a where we
92
00:11:09,910 --> 00:11:16,130
have one one one and zero
so this is ah the exact inverse of a nand
93
00:11:16,130 --> 00:11:24,670
it just a compliment or or not of the and
function similarly the or function has a inverse
94
00:11:24,670 --> 00:11:32,550
also which is the nor function over here n
o r and ah if i show you the or function if
95
00:11:32,550 --> 00:11:42,600
you take a look if zero one one one here he
have a rivers he have a one over here and
96
00:11:42,600 --> 00:11:48,760
the remaining three entries are zeros
so it turns out that both nand as well as
97
00:11:48,760 --> 00:11:58,120
nor are universal operations in the sense
the they can be use implement any boolean
98
00:11:58,120 --> 00:12:08,720
function we are not at the point where you
can proof this result but simply interesting
99
00:12:08,720 --> 00:12:16,300
result for student to remember that nand and
nor operations we can implement any kind of
100
00:12:16,300 --> 00:12:25,400
logic any kind of functions so ah you can
take a look at the book you can try proving
101
00:12:25,400 --> 00:12:31,050
yourself or look at sources on the vibe are
other book for a very detailed proof of this
102
00:12:31,050 --> 00:12:35,850
result let us now discuses the xor operation
or the exclusive or operation so it as a different
103
00:12:35,850 --> 00:12:43,960
truth table so one thing the readers might
have realize up to now that if i have two
104
00:12:43,960 --> 00:12:51,910
variables i can create ah lot of different
kinds of truth tables ah so how many truth
105
00:12:51,910 --> 00:12:58,241
tables that i can create actually i can create
a sixteen truth tables the reason is like
106
00:12:58,241 --> 00:13:04,140
this that every truth table that i have over
here will have ah precisely four rows right
107
00:13:04,140 --> 00:13:09,970
as you can see over here it will have precisely
four rows row one two three and four each
108
00:13:09,970 --> 00:13:14,610
row will have a combination of ah unique combination
of the different variables so ah it will have
109
00:13:14,610 --> 00:13:20,660
zero zero one zero zero one and one one and
for each combination we will store what is
110
00:13:20,660 --> 00:13:24,070
the output that ah this function is suppose
to give
111
00:13:24,070 --> 00:13:29,820
see in this case we have two variables so
for two variables we have four rows and for
112
00:13:29,820 --> 00:13:34,880
each row we have a choice that the output
can either be zero or one so essentially we
113
00:13:34,880 --> 00:13:39,390
have two choices per row so how many total
choices to we have we have two to the power
114
00:13:39,390 --> 00:13:45,800
four choices or sixteen possible truth tables
we can build or sixteen possible function
115
00:13:45,800 --> 00:13:51,970
we can build if we have two variables and
the xor function is one such function so lets
116
00:13:51,970 --> 00:14:01,900
take a look at it properties so the x or or
xor thats how it is called the x stands for
117
00:14:01,900 --> 00:14:05,220
exclusive or
exclusive or basically means that it is true
118
00:14:05,220 --> 00:14:13,140
only when one of the variables a is one and
b is zero or a is zero and b is one in the
119
00:14:13,140 --> 00:14:23,860
rest of the cases it is ah equal to falls
as we can see in the first row both a and
120
00:14:23,860 --> 00:14:35,450
b are zero one zero so a is xor b is zero
similarly in the last row both a and b or
121
00:14:35,450 --> 00:14:45,070
one and one so a xor b is also zero but in
the middle two rows the second row and the
122
00:14:45,070 --> 00:14:57,730
third row a is equal to one and b is equal
to zero or alternatively a ah and the third
123
00:14:57,730 --> 00:15:10,870
row a is zero and b is one so as a result
in these two rows a is or b is equal to one
124
00:15:10,870 --> 00:15:26,390
and in the rest of the two cases a is or b
is equal to zero so this is one more kind
125
00:15:26,390 --> 00:15:32,450
of function as we have seen so just a make
a review we saw the basic not operator so
126
00:15:32,450 --> 00:15:44,960
not operator or ah so not is also called the
compliment operator so what is does is that
127
00:15:44,960 --> 00:15:56,300
given a boolean variable you just place a
bar on top of it so if it is value of equal
128
00:15:56,300 --> 00:16:10,930
to zero after a not the combination will become
one and one bar or not a one will become zero
129
00:16:10,930 --> 00:16:21,300
so one property of the not operator is that
we the double negation in a sense are not
130
00:16:21,300 --> 00:16:29,720
of a not will essentially reduce it set to
the same variable right so not of not of a
131
00:16:29,720 --> 00:16:36,490
is equal to a itself then we saw the or and
nand operators so or and nand operators the
132
00:16:36,490 --> 00:16:39,280
truth table basically for the or cells we
one of the variable is equal to one the output
133
00:16:39,280 --> 00:16:47,970
is equal to one and the truth tables for and
cells that all the variables need to be one
134
00:16:47,970 --> 00:16:58,360
so lets take a look at some of their ah basic
properties so we have the property of identity
135
00:16:58,360 --> 00:17:04,010
the property of identity is like this that
a or zero is equal to a this is very easy
136
00:17:04,010 --> 00:17:11,890
to verified a is equal to zero then output
here is zero if a is equal to one then the
137
00:17:11,890 --> 00:17:17,650
output here is one similarly we can verified
the same property for the and operator ah
138
00:17:17,650 --> 00:17:24,890
if a is zero zero and one is zero if a is
one one and one is one so this is called identity
139
00:17:24,890 --> 00:17:31,950
ah which basically mean set any boolean variable
odd with zero is equal to the variable itself
140
00:17:31,950 --> 00:17:36,380
and any boolean variable and one is equal
to the variable itself we have a similar property
141
00:17:36,380 --> 00:17:38,390
ah in the same way in call annulment which
basically says that a or one is equal to one
142
00:17:38,390 --> 00:17:44,800
so lets see why if a is zero zero or one is
one if a is one one or one is one you can
143
00:17:44,800 --> 00:17:49,360
similarly verified the property annulment
for this any number ended with zero is zero
144
00:17:49,360 --> 00:17:58,500
say any any boolean number so in this case
away a is zero zero and zero a zero even if
145
00:17:58,500 --> 00:18:04,230
a is one one and zero is zero so as we see
the we can use the similar logic to prove
146
00:18:04,230 --> 00:18:09,280
properties for you know all kinds of boolean
formally so lets take ah look at some more
147
00:18:09,280 --> 00:18:14,980
i will be discussing some of this properties
i put it on the reader to actually considered
148
00:18:14,980 --> 00:18:22,220
ah more details text so it can be this book
or ah it can be other books that are fully
149
00:18:22,220 --> 00:18:28,250
devoted to boolean algebra to take a look
at these properties
150
00:18:28,250 --> 00:18:35,890
but they are simple properties so its not
necessary to consult a lot of ah yeah text
151
00:18:35,890 --> 00:18:43,990
for this ah you know there ah ah simple ah
if you just set down in work it out its good
152
00:18:43,990 --> 00:18:51,890
enough so lets take a look at this property
called idempotence its says at any number
153
00:18:51,890 --> 00:19:05,620
odd with itself is a same number you can easily
verify zero or zero is zero one or one is
154
00:19:05,620 --> 00:19:12,640
one similarly any number ended with itself
is equal to the number itself this also can
155
00:19:12,640 --> 00:19:18,230
be easily verified the property of complementarity
is interesting with says that any number odd
156
00:19:18,230 --> 00:19:26,660
with this compliments is equal to one easy
to verified considered zero then he or it
157
00:19:26,660 --> 00:19:34,083
so the not of zero is one zero or one is one
then you considered one and one will get ah
158
00:19:34,083 --> 00:19:40,070
one complement is zero so one or zero is equal
to one and similarly we have this property
159
00:19:40,070 --> 00:19:52,980
over here which is a and a bar is equal to
zero can easily we verified in the same fashion
160
00:19:52,980 --> 00:20:06,540
the next property of interest is commutativity
here a or b is equal to b or a means of the
161
00:20:06,540 --> 00:20:16,670
order a variable does not matter similarly
a and b is equal to b and a the order again
162
00:20:16,670 --> 00:20:24,600
does not matter we also have similar to normal
decimal addition and multiplication we have
163
00:20:24,600 --> 00:20:31,990
associativity which is a or b or c in the
b or c being here in brackets is same as a
164
00:20:31,990 --> 00:20:38,570
or b or c c it doesnt matter where you place
the brackets we can place them here and here
165
00:20:38,570 --> 00:20:44,910
or we can place them here and here for boolean
logic it does not matter we have the similar
166
00:20:44,910 --> 00:20:53,170
ah setup rules for ah the and operation as
well so we in for example here we can place
167
00:20:53,170 --> 00:21:05,610
ah b and c inside a bracket or we can place
a and b inside the bracket doesnt matter so
168
00:21:05,610 --> 00:21:16,510
you can ah readers can manually put in different
values of a b and c an verified the result
169
00:21:16,510 --> 00:21:23,270
will be as it is then we have distributivity
since distributivity what this means it similar
170
00:21:23,270 --> 00:21:33,080
to what we have in regular arithmetic like
x multiplied with y plus z is equal to x y
171
00:21:33,080 --> 00:21:38,380
x multiplied by by y plus x z so this is the
long distributivity that we get to see in
172
00:21:38,380 --> 00:21:42,810
regular math exactly the same thing also boolean
algebra as well so what we see over here is
173
00:21:42,810 --> 00:21:48,760
that a and b or c is exactly the same as a
and b or a and c so this particular formula
174
00:21:48,760 --> 00:21:56,010
over here should be verified by the students
a nice way of doing it is just create a simple
175
00:21:56,010 --> 00:22:04,390
truth table have a b c and then ah consider
the results consider the result of a and b
176
00:22:04,390 --> 00:22:16,300
or c and then consider this expression over
here just bring it here and computed so you
177
00:22:16,300 --> 00:22:24,130
will see that for each and every row the values
match say the values match for all the rows
178
00:22:24,130 --> 00:22:32,710
it means that both the formulae are the same
say exactly a similar formula holes if i interchange
179
00:22:32,710 --> 00:22:44,440
and an or say a or b and c in bracket is equal
to a or b and a or c so many such ah rules
180
00:22:44,440 --> 00:22:51,460
can be used ah these are all the basic rules
that we have and with that we can construct
181
00:22:51,460 --> 00:23:00,450
complex formulae so i request the readers
to go to the book read all the rules of handling
182
00:23:00,450 --> 00:23:05,630
bits of boolean algebra what is boolean algebra
its the rules for handling bits an operations
183
00:23:05,630 --> 00:23:11,870
with bits what are the basic operations well
is the not operation is a example this is
184
00:23:11,870 --> 00:23:20,060
a naught its the or operation something like
a or b when is a or b true when at least one
185
00:23:20,060 --> 00:23:27,520
of a or b is equal to true or equal to one
similarly we are the and operation
186
00:23:27,520 --> 00:23:36,040
when is the a and b equal to true when both
a is true and b is true so here are two very
187
00:23:36,040 --> 00:23:40,210
useful rules they are call the de morgans
laws so some of the students of the familiar
188
00:23:40,210 --> 00:23:46,510
with de morgans laws they were there in set
theory so what this say in this is exactly
189
00:23:46,510 --> 00:23:55,870
the formula that was there in set theory it
is it is essentially come to boolean logic
190
00:23:55,870 --> 00:24:06,780
wire set theory so the two very ah so this
say that a or b compliment is a compliment
191
00:24:06,780 --> 00:24:14,020
and b complement so lets verify this you know
lets see if this de morgans rule is actually
192
00:24:14,020 --> 00:24:21,310
correct or not so lets you know verify this
by so lets have a or b compliment and a compliment
193
00:24:21,310 --> 00:24:25,420
and b compliment (Refer Time: 25:00)
so lets consider all possible values so zero
194
00:24:25,420 --> 00:24:33,570
and zero a or b when both are zero this is
zero the compliment of zero is equal to one
195
00:24:33,570 --> 00:24:39,920
so a compliment is one b compliment is one
so one and one is equal to one so both of
196
00:24:39,920 --> 00:24:46,590
the match which is fantastic now lets consider
a to b one and b to be zero say a or b is
197
00:24:46,590 --> 00:24:54,580
one and one compliment is zero similarly here
one compliment is zero any number and it with
198
00:24:54,580 --> 00:25:00,730
zero is zero so here also the numbers match
and since this case is exactly symmetric to
199
00:25:00,730 --> 00:25:04,340
the case above and the expression here are
symmetric we can also write zero and zero
200
00:25:04,340 --> 00:25:10,540
but if you dont trust me lets work it out
say a is zero b is one a or b is one one compliment
201
00:25:10,540 --> 00:25:17,000
is zero a is zero zero compliment is one and
b is one the compliment of one is zero any
202
00:25:17,000 --> 00:25:21,070
number ended with zero is zero so write it
over here
203
00:25:21,070 --> 00:25:25,990
now lets consider the last row one a is one
b is one a or b is one one compliment is zero
204
00:25:25,990 --> 00:25:30,309
similarly here we have the compliment of a
is zero so doesnt matter what the value of
205
00:25:30,309 --> 00:25:43,890
b is the result is zero so one thing that
we can see is that all are rows match since
206
00:25:43,890 --> 00:25:51,390
all are rows match both the formulae are absolutely
equivalent they are the same formulae they
207
00:25:51,390 --> 00:25:57,490
are equivalent so what we have done is that
by the truth table we are verified this result
208
00:25:57,490 --> 00:26:06,950
is a very very important result that the compliment
of a or b is equal to a compliment and of
209
00:26:06,950 --> 00:26:14,690
b compliment we have a similar result where
which as replaced or by the and and the and
210
00:26:14,690 --> 00:26:22,700
by the or so a and b compliment is a compliment
or b compliments i will not be proving this
211
00:26:22,700 --> 00:26:33,920
so this is left to the student that unit to
prove this with a very similar approach that
212
00:26:33,920 --> 00:26:38,460
we have used
now its time to take a look at ah boolean
213
00:26:38,460 --> 00:26:41,940
relationship which is slightly difficult and
but we can work this out so this is called
214
00:26:41,940 --> 00:26:48,210
the consensus theorem and this is the statement
of the theorem this is the l h s and this
215
00:26:48,210 --> 00:26:54,160
the r h s and you will see many of such burger
i can throughout the presentation ah say burger
216
00:26:54,160 --> 00:27:01,260
means food for thought so you are suppose
to think so in this case what you are suppose
217
00:27:01,260 --> 00:27:05,380
to do is prove that this expression on the
left hand side is equal to the expression
218
00:27:05,380 --> 00:27:09,340
on the right hand side ah so if you want to
try you can always pause the video and think
219
00:27:09,340 --> 00:27:17,980
what the solution will be ah but let me never
the less work out the solution so the first
220
00:27:17,980 --> 00:27:22,809
thing that you need to see is you need to
take a look at this term this term is present
221
00:27:22,809 --> 00:27:28,850
on the left side and is not present on the
right side
222
00:27:28,850 --> 00:27:36,920
so this basically means we need to find a
way of eliminating this term from the expression
223
00:27:36,920 --> 00:27:45,670
so how would we do that the way that we would
do that is something like this
224
00:27:45,670 --> 00:27:50,620
now way expand this term something like this
that any number ended with itself is equal
225
00:27:50,620 --> 00:27:58,890
to itself so what we essentially do over here
is that ah we end it with one so so let me
226
00:27:58,890 --> 00:28:08,760
ah just expand the l h s side i will ignore
the r h s side ah so basically we still have
227
00:28:08,760 --> 00:28:12,330
the same terms
so in this case ah the term one can be replaced
228
00:28:12,330 --> 00:28:18,610
with x or x bar severe essentially doing this
to ah ensure that y and z can be eliminated
229
00:28:18,610 --> 00:28:32,210
ah so what have we done
we have essentially said that any number ended
230
00:28:32,210 --> 00:28:37,070
with one is itself any number meaning any
boolean number and now we have replace the
231
00:28:37,070 --> 00:28:43,620
term one with x or x bar after now we can
open up the expression slightly and use the
232
00:28:43,620 --> 00:28:57,700
distributive rule to open it up so ah keeping
the rest of the terms we can have
233
00:28:57,700 --> 00:29:03,309
so now what we need to do is we need to rearrange
the terms so let me rearrange them so let
234
00:29:03,309 --> 00:29:11,000
me consider the first and the third term so
since any number and it with one is itself
235
00:29:11,000 --> 00:29:16,090
so we can write now let me consider the third
term over here
236
00:29:16,090 --> 00:29:24,430
so i am using the commutative rule to in for
the z and x bar is the same as x bar and z
237
00:29:24,430 --> 00:29:28,860
so now we can go up say any number odd with
one is one so we can replace this with
238
00:29:28,860 --> 00:29:38,460
which is exactly what is there in the right
hand side or the r h s so this term is the
239
00:29:38,460 --> 00:29:45,120
same as this term and this term is the same
and this term so essentially we have proven
240
00:29:45,120 --> 00:29:52,440
or first complex boolean relationship or boolean
equation using the simple formulae that we
241
00:29:52,440 --> 00:29:59,530
have learned up till now so mind you this
is a very short presentation of boolean logic
242
00:29:59,530 --> 00:30:05,610
it is possible to ah work out mo much more
complex formulae but for that i would request
243
00:30:05,610 --> 00:30:10,260
the readers to ah consult the text book and
if they want more information they can look
244
00:30:10,260 --> 00:30:16,650
at the book by zecovi on switching theory
so lets ah move forward so we of covered ah
245
00:30:16,650 --> 00:30:26,280
some amount of boolean algebra what have we
learnt we are learnt a boolean variables so
246
00:30:26,280 --> 00:30:37,190
boolean variable lets say b you can take only
two values and so its a part of the set zero
247
00:30:37,190 --> 00:30:46,720
or one and the basic operations that we defined
on boolean variables is not and and or then
248
00:30:46,720 --> 00:30:51,090
we as some complicated operation like nand
and nor ah we also have the x or exclusive
249
00:30:51,090 --> 00:30:56,580
or operation so these are may be these four
operations can be considered to be basic and
250
00:30:56,580 --> 00:30:59,080
we looked at sudden simple rules of manipulating
boolean variables
251
00:30:59,080 --> 00:31:05,210
so now the question arises why did we learn
boolean algebra this is something where i
252
00:31:05,210 --> 00:31:09,620
didnt tell you but it clearly has some implication
for the rest of the four topics so lets see
253
00:31:09,620 --> 00:31:15,570
so ah let me slightly digress at this point
and then we will will stitch everything together
254
00:31:15,570 --> 00:31:26,040
so lets take a look at ah the ancient roman
system of how they were a present in numbers
255
00:31:26,040 --> 00:31:37,330
so they had roman number of the form one was
a single i five was represented with v type
256
00:31:37,330 --> 00:31:48,340
symbol ten by x fifty by l hundred by c five
hundred by d ah thousand by m so they did
257
00:31:48,340 --> 00:31:56,669
not follow a place value system the way that
you know modern numbers and made so it was
258
00:31:56,669 --> 00:32:01,090
very difficult to represent large numbers
and addition and subtraction was fairly difficult
259
00:32:01,090 --> 00:32:05,860
in the system but in an ancient civilization
didnt also have the requirement of representing
260
00:32:05,860 --> 00:32:12,700
very large numbers so this is something that
went in the favor so in comparison ah the
261
00:32:12,700 --> 00:32:18,020
indian system which ah later on begin indo
arabic numeral system had the number zero
262
00:32:18,020 --> 00:32:25,070
which is the crux of the idea right so this
is an old script ah recovered from bakshali
263
00:32:25,070 --> 00:32:31,740
which is on modern day pakistan actually ah
from the seventh century ad sit uses the place
264
00:32:31,740 --> 00:32:34,095
value system
so what is the place value system any number
265
00:32:34,095 --> 00:32:42,650
of this form is five times ten to the power
three plus three times ten square zero times
266
00:32:42,650 --> 00:32:47,110
ten to the power one plus one times ten to
the power zero so the number is ten over here
267
00:32:47,110 --> 00:32:54,470
can be considered to be the base so this particular
example is an example in base ten
268
00:32:54,470 --> 00:33:02,480
so why do we use base ten well simple we have
ten fingers thats how we learnt counting in
269
00:33:02,480 --> 00:33:10,490
the first place that ah we count with a fingers
from one to ten what if we go to another planet
270
00:33:10,490 --> 00:33:23,020
in our planet which is far far away where
people have only two fingers rights to the
271
00:33:23,020 --> 00:33:31,450
entire planet all the people there very intelligent
they have only two finger so instead of base
272
00:33:31,450 --> 00:33:38,940
ten they would actually use based two so in
base two how would you represent a number
273
00:33:38,940 --> 00:33:41,870
the way we would do that is you considered
five five would be represented as one times
274
00:33:41,870 --> 00:33:46,299
so two square plus zero times two to the power
one plus one multiplied by two to the power
275
00:33:46,299 --> 00:33:52,440
zero so you know sense the number would be
one zero one which is exactly what we get
276
00:33:52,440 --> 00:33:57,070
to see over here so similarly ah what would
the number three be the number three would
277
00:33:57,070 --> 00:34:01,000
be two to the power one plus two to the power
zero
278
00:34:01,000 --> 00:34:11,149
which can be represented as one one in lets
say based will use the subscript for the base
279
00:34:11,149 --> 00:34:18,389
so in is so this is also called the binary
notation or are the base two notation so what
280
00:34:18,389 --> 00:34:29,710
we see over here is that it is not necessary
to use a base of ten to represent a number
281
00:34:29,710 --> 00:34:39,369
we can use the different ways as well and
we use ten because we have ten fingers but
282
00:34:39,369 --> 00:34:47,190
you can use base two ah if you have just two
fingers and any numbers i have shown many
283
00:34:47,190 --> 00:34:52,869
examples can be represented in the base two
notation let me again one more example lecture
284
00:34:52,869 --> 00:35:00,880
number nineteen how would you represent that
so the its very simple its one times two to
285
00:35:00,880 --> 00:35:08,650
the power four which is sixteen plus zero
times two to the power three plus zero times
286
00:35:08,650 --> 00:35:17,660
two square plus one times two to the power
one plus one times two to the power zero so
287
00:35:17,660 --> 00:35:21,750
ah this would be equal to one zero zero one
one in base two
288
00:35:21,750 --> 00:35:29,620
so this is so one zero zero one one ah is
the way that we would represent the number
289
00:35:29,620 --> 00:35:33,880
nineteen in the base two system or the binary
system so now lets defined to terms the m
290
00:35:33,880 --> 00:35:38,190
s b the most significant bit and the least
significant bit so the leftmost bit of a binary
291
00:35:38,190 --> 00:35:44,070
number ah for example number one one one zero
the numbers shown over here the most significant
292
00:35:44,070 --> 00:35:52,350
bit is one and the least significant bit is
the rightmost bit and in this case it is zero
293
00:35:52,350 --> 00:36:03,250
so similarly we can define numbers in other
basis as well so it is very common in computer
294
00:36:03,250 --> 00:36:12,330
science and computer design to represent numbers
in base sixteen so these are called hexadecimal
295
00:36:12,330 --> 00:36:19,670
numbers so so what is the problem ah in representing
numbers in base sixteen so lets first take
296
00:36:19,670 --> 00:36:27,530
a look at base ten so in base ten what are
the our digits are digits are zero till nine
297
00:36:27,530 --> 00:36:35,230
so we have ten digits in base two how many
digits to we have we have two digits zero
298
00:36:35,230 --> 00:36:42,060
and one so in base sixteen we need to have
sixteen digits from zero to fifteen but the
299
00:36:42,060 --> 00:36:47,020
problem is that till nine we have digits define
but beyond ten right we dont have a digits
300
00:36:47,020 --> 00:36:53,070
define so thats the reason what we do is we
use the set from zero to nine and then we
301
00:36:53,070 --> 00:36:56,310
say that a represents ten in decimal of course
b represents eleven and in a same vein f represent
302
00:36:56,310 --> 00:37:02,480
fifteen so a b c d f are the six extra digits
that we create to represent a number in base
303
00:37:02,480 --> 00:37:06,000
sixteen or an hexadecimal number and these
six extra digits represent the numbers ten
304
00:37:06,000 --> 00:37:10,760
to fifteen
so the way we represent a number ah hex number
305
00:37:10,760 --> 00:37:14,849
is that we typically add zero x before it
for example zero x nine is actually nine ah
306
00:37:14,849 --> 00:37:20,520
in in a base ten similarly zero x thirty two
is equal to three times sixteen plus two times
307
00:37:20,520 --> 00:37:24,500
one which is actually equal to fifty in base
ten so i would like to request the reader
308
00:37:24,500 --> 00:37:27,850
at this point of time to take ah as many numbers
as she she wants and convert them to base
309
00:37:27,850 --> 00:37:28,850
sixteen and convert them to any base of their
choice and just see how this works out so
310
00:37:28,850 --> 00:37:36,370
similarly we can have octal numbers ah so
in octal number is in base eight and here
311
00:37:36,370 --> 00:37:42,910
ah we will have eight digits zero to seven
so which is fine we dont need to introduce
312
00:37:42,910 --> 00:37:45,770
any new digit and octal number start with
the zero so maybe the number ah zero four
313
00:37:45,770 --> 00:37:50,010
two ah will be equivalent to four times eight
plus two so this is equal to thirty four in
314
00:37:50,010 --> 00:37:51,859
base time
so we can work too many more examples but
315
00:37:51,859 --> 00:37:56,250
i would ah suggest that you know we move forward
at the reader spend some time at this particular
316
00:37:56,250 --> 00:38:03,550
ah you know at this slide which is slide nineteen
to convert numbers between arbitrary basic
317
00:38:03,550 --> 00:38:11,370
let us now discuss why we choose the binary
the octal and the hex formats will the binary
318
00:38:11,370 --> 00:38:12,760
is very straight forward ah computers understand
the language of only zeros and ones so as
319
00:38:12,760 --> 00:38:18,599
a result if you have a number system that
represents everything in terms of zeros and
320
00:38:18,599 --> 00:38:23,060
ones which is a binary or a based two number
system this is information that the computer
321
00:38:23,060 --> 00:38:29,940
scan process so what about base eight and
base sixteen well ah base eight and base sixteen
322
00:38:29,940 --> 00:38:31,740
ah well turn out to be short cut for the binary
form but how thats the case that is slightly
323
00:38:31,740 --> 00:38:32,740
more complicated so lets work it out so consider
any number right rather number be n so we
324
00:38:32,740 --> 00:38:34,790
can say there the number is the form
so we can sort of break it down into sums
325
00:38:34,790 --> 00:38:38,160
of powers of two and each of these number
a zero to a k can be a binary number in zero
326
00:38:38,160 --> 00:38:43,150
and one which is exactly are binary representation
so the binary number would essentially b so
327
00:38:43,150 --> 00:38:45,290
this is something that we already know now
we can alternatively say that this is equal
328
00:38:45,290 --> 00:38:48,380
to
so what we have essentially done is that we
329
00:38:48,380 --> 00:38:53,600
have group that terms into groups of three
terms and the way that we have group them
330
00:38:53,600 --> 00:38:56,421
is something like this that we take three
terms to the first term is really is is a
331
00:38:56,421 --> 00:39:01,950
zero and two to the power zero is one then
we take two times a one and four times a two
332
00:39:01,950 --> 00:39:07,220
which is also two to the power one and two
to the power two similarly when we come to
333
00:39:07,220 --> 00:39:08,850
the next term
so we again group the terms so the third term
334
00:39:08,850 --> 00:39:09,940
over here is a three multiplied by two to
the power three so what i have done is that
335
00:39:09,940 --> 00:39:11,290
i have brought two to the power three outside
the bracket and similarly ah we have ah something
336
00:39:11,290 --> 00:39:13,849
similar sorry this is the plus a three plus
two times a four plus four times a five and
337
00:39:13,849 --> 00:39:15,774
so on so the interesting thing is that if
you consider each of these numbers a zero
338
00:39:15,774 --> 00:39:18,090
a one a two all of these numbers still a k
are ah essentially all of these numbers are
339
00:39:18,090 --> 00:39:19,280
either zero or one they have boolean bits
so if i consider this term the maximum value
340
00:39:19,280 --> 00:39:23,650
of this term is four times one plus two times
one plus one which is seven and the minimum
341
00:39:23,650 --> 00:39:29,214
value for each of these terms this one or
this one or this one is zero when all three
342
00:39:29,214 --> 00:39:30,920
are the coefficients are zero
so alternatively the way that i can write
343
00:39:30,920 --> 00:39:34,270
is that this entire coefficient i can think
of this us b zero so i can write this as
344
00:39:34,270 --> 00:39:35,590
so what we have essentially done is that we
have expanded this number in terms of parts
345
00:39:35,590 --> 00:39:39,450
of two then group together three terms and
then essentially we have expanded the number
346
00:39:39,450 --> 00:39:40,450
in parts of eight so for those who have not
been ah who have not had that magical bulb
347
00:39:40,450 --> 00:39:43,070
light inside you up till now the magical bulb
is like this that we have essentially broken
348
00:39:43,070 --> 00:39:45,530
down n into a some of parts of eight which
is nothing but a number in the octal notation
349
00:39:45,530 --> 00:39:47,800
say lets assume that the last number in this
series is k dash times eight to the power
350
00:39:47,800 --> 00:39:52,100
k dash so essentially the number the octal
number will be equal so this is the number
351
00:39:52,100 --> 00:39:55,870
in base eight so what is the important thing
that we learn over here the important thing
352
00:39:55,870 --> 00:39:56,870
that we learn over here is that if we group
terms into groups of three and each of them
353
00:39:56,870 --> 00:39:57,870
is essentially an octal digit ah right so
basically ah if we lets say group them into
354
00:39:57,870 --> 00:39:58,870
four each of them is hexadecimal digit so
this gives us a very nice and short form of
355
00:39:58,870 --> 00:40:07,800
ah writing binary numbers in other bases there
are a power of two for example if you have
356
00:40:07,800 --> 00:40:08,900
this number over here we can group it into
blocks of three and each such block we can
357
00:40:08,900 --> 00:40:13,359
convert it into an octal octal digit ah so
this number i am sorry this is the mistake
358
00:40:13,359 --> 00:40:18,440
over here it should be seven ah so this number
is a seven this is a two and this is the six
359
00:40:18,440 --> 00:40:21,430
so this is zero six two seven
ah similarly we can take this number over
360
00:40:21,430 --> 00:40:23,960
here and if you want to convert it to base
sixteen that is also very easy ah we group
361
00:40:23,960 --> 00:40:24,960
four binary digit so we ah one one one one
is an f zero zero one zero is two and one
362
00:40:24,960 --> 00:40:26,320
one one zero is ah well was so one one one
zero is twelve which is the hex digit c so
363
00:40:26,320 --> 00:40:27,320
what we have is that we have a very compact
representation for twelve binary bits using
364
00:40:27,320 --> 00:40:28,320
three hexadecimal digit hexadecimal is abbreviated
as hex ah so what do we see over here what
365
00:40:28,320 --> 00:40:29,320
we see is a binary the octal and the hex formats
are essentially the same the binary format
366
00:40:29,320 --> 00:40:30,320
is varies parts the other formats are slightly
more dense so this in a sense is desirable
367
00:40:30,320 --> 00:40:31,320
if you want to represent binary bits installer
representing them as ones and zeros we can
368
00:40:31,320 --> 00:40:32,320
at least file writing or while programming
we can represent them as hexadecimal digits
369
00:40:32,320 --> 00:40:33,320
where we group digits into blocks of four
and each block is replaced by a hexadecimal
370
00:40:33,320 --> 00:40:34,320
digit
similarly when we need to expand a number
371
00:40:34,320 --> 00:40:35,320
in the hexadecimal notation to a number in
the binary notation all that we need to do
372
00:40:35,320 --> 00:40:36,320
is take each of these digits and replace them
with four binary numbers and we will have
373
00:40:36,320 --> 00:40:36,323
the binary notation