1 00:00:18,790 --> 00:00:22,950 Hello and welcome to the first video on Boolean logic. 2 00:00:23,620 --> 00:00:27,850 And Boolean expressions. You might know this topic in an 3 00:00:27,850 --> 00:00:31,234 alternative name because the same topic sometimes also 4 00:00:31,234 --> 00:00:35,887 referred to as digital Logic or Boolean algebra or algebra of 5 00:00:35,887 --> 00:00:40,540 proposition. What this topic is looking at is looking at a 6 00:00:40,540 --> 00:00:42,232 collection of input values. 7 00:00:42,830 --> 00:00:44,930 A collection of operators. 8 00:00:45,520 --> 00:00:49,840 That sometimes we refer to as logic gates and looking at what 9 00:00:49,840 --> 00:00:54,160 happens at the end, what is a particular set of of these 10 00:00:54,160 --> 00:00:58,480 inputs and operators? What kind of outputs you can end up with? 11 00:00:58,480 --> 00:01:03,160 Now the origonal part of this coming from the at the very very 12 00:01:03,160 --> 00:01:06,760 beginning, the computer has been built up from logic circuits. 13 00:01:06,760 --> 00:01:10,360 Tiny, tiny little circuits and then depending on which circuits 14 00:01:10,360 --> 00:01:14,680 you connected together, you were able to tie the computer to do 15 00:01:14,680 --> 00:01:15,760 different things so. 16 00:01:15,910 --> 00:01:20,914 The input and output values can be recorded in a number of 17 00:01:20,914 --> 00:01:24,250 different ways. Again, there are two common ways. 18 00:01:24,890 --> 00:01:30,954 One is the true for set up and the other one is the 1 zero set 19 00:01:30,954 --> 00:01:35,502 up again. It comes from the fact that logic circuits can be 20 00:01:35,502 --> 00:01:40,808 turned on or off true and one is equal to the on position and 21 00:01:40,808 --> 00:01:44,977 force in OR equal to the off position. Remember circuits turn 22 00:01:44,977 --> 00:01:48,009 it on or turn it off. So let's 23 00:01:48,009 --> 00:01:53,926 look at. What are the basic Boolean operations? The 24 00:01:53,926 --> 00:01:55,750 first Boolean operation? 25 00:01:57,100 --> 00:02:02,010 Is the end operation now this end operation sometimes just 26 00:02:02,010 --> 00:02:07,411 written out as end in capital letters sometimes is referred to 27 00:02:07,411 --> 00:02:08,884 as this symbol? 28 00:02:09,650 --> 00:02:12,782 And sometimes it's referred to as a multiplication simple 29 00:02:12,782 --> 00:02:15,566 symbol because it works like ordinary multiplication within 30 00:02:15,566 --> 00:02:19,742 the binary system. Now it also has got in digital logic. If 31 00:02:19,742 --> 00:02:22,874 you're looking at the circuits themselves. If you're looking 32 00:02:22,874 --> 00:02:26,702 at how to build boards together, it has got a logic 33 00:02:26,702 --> 00:02:30,182 gate symbol and that logic gate symbol is this one. 34 00:02:32,490 --> 00:02:36,736 Now this tells you that this endgate can take a minimum 35 00:02:36,736 --> 00:02:40,982 of two input values and it will give you always one 36 00:02:40,982 --> 00:02:41,754 output value. 37 00:02:43,770 --> 00:02:48,281 So what does the end gate do now? The end gate is actually 38 00:02:48,281 --> 00:02:53,139 working as if you had a water pipe fixed with two taps on it, 39 00:02:53,139 --> 00:02:54,527 one after the other. 40 00:02:57,610 --> 00:03:01,966 So when we have water flow through, the water will flow 41 00:03:01,966 --> 00:03:06,718 through only if both of the tabs are open. If I turn 42 00:03:06,718 --> 00:03:07,906 this tab off. 43 00:03:09,040 --> 00:03:13,590 The voter will stop here if I turn this step on when I leave 44 00:03:13,590 --> 00:03:17,490 this tab of the water will stop here, so water still doesn't 45 00:03:17,490 --> 00:03:21,065 flow through an. Obviously, if I have both taps turned off, 46 00:03:21,065 --> 00:03:24,965 the water doesn't go further than here. So what are we only 47 00:03:24,965 --> 00:03:29,190 go through if all of these steps are on, so would have can 48 00:03:29,190 --> 00:03:33,090 go through only this way. Now how can we sort of summarize 49 00:03:33,090 --> 00:03:36,340 this information in a nice and simple visual format? That's 50 00:03:36,340 --> 00:03:37,315 why truth tables. 51 00:03:40,510 --> 00:03:44,173 Has been invented through. Tables are simple tables which 52 00:03:44,173 --> 00:03:48,650 tells you what are the input values or other possible input 53 00:03:48,650 --> 00:03:53,941 values that can come. What is the logic gate or what is the 54 00:03:53,941 --> 00:03:58,825 Boolean operation that we use here and then? What will be the 55 00:03:58,825 --> 00:04:02,488 end result of that Boolean operation for every possible 56 00:04:02,488 --> 00:04:06,151 income combinations? Now let's look at the simple examples. 57 00:04:06,151 --> 00:04:08,593 Let's see how does the P&Q 58 00:04:08,593 --> 00:04:13,230 operation works. B is an input queue, is a different input. 59 00:04:13,230 --> 00:04:17,410 What happens if I combine them together? What will be the 60 00:04:17,410 --> 00:04:18,930 common output so P. 61 00:04:20,390 --> 00:04:21,330 And Q. 62 00:04:23,450 --> 00:04:25,418 And here will be my output. 63 00:04:27,540 --> 00:04:33,364 Now what kind of setups can the two taps have? While I can turn 64 00:04:33,364 --> 00:04:35,028 both of them on? 65 00:04:37,120 --> 00:04:41,644 I can turn one of them on the other one off, all in 66 00:04:41,644 --> 00:04:42,688 the other combination. 67 00:04:43,980 --> 00:04:46,923 Or I can have both of them turned off. 68 00:04:48,140 --> 00:04:52,368 So what did we say? The water can only go through if both of 69 00:04:52,368 --> 00:04:53,576 the taps are on? 70 00:04:54,250 --> 00:04:58,570 Every other combination will stop the water from flowing, so 71 00:04:58,570 --> 00:05:02,026 this is the truth table accompanying the end. 72 00:05:02,750 --> 00:05:07,640 Operation. With this Boolean trip tables, you need to know 73 00:05:07,640 --> 00:05:11,600 them. You need to understand them because later on we'll be 74 00:05:11,600 --> 00:05:14,840 combining more than just one single operation together and 75 00:05:14,840 --> 00:05:19,880 see what happens if we start to mix them up. So this was the 76 00:05:19,880 --> 00:05:24,200 first one, the end operation. Let's have a look at the next 77 00:05:24,200 --> 00:05:28,520 one, which is the OR operator. Now the symbol for the OR 78 00:05:28,520 --> 00:05:32,480 operator can be this small away. The opposite, the turned upside 79 00:05:32,480 --> 00:05:35,720 of the end or the addition because it works. 80 00:05:35,830 --> 00:05:36,919 Like the audition. 81 00:05:39,120 --> 00:05:42,126 And if you are coming from the engineering background. 82 00:05:43,320 --> 00:05:45,880 You can see either this. 83 00:05:48,010 --> 00:05:51,150 Symbol or this symbol? 84 00:05:53,790 --> 00:05:58,014 For the OR gates, again it takes in at least two 85 00:05:58,014 --> 00:06:01,854 incoming values and gives you one outgoing value, so at 86 00:06:01,854 --> 00:06:03,774 least two inputs, one output. 87 00:06:05,390 --> 00:06:07,819 You can think about the OR gate. 88 00:06:08,370 --> 00:06:12,000 As water pipes but fixed 89 00:06:12,000 --> 00:06:17,750 now. In a different way now these water pipes I fixed 90 00:06:17,750 --> 00:06:21,458 together in a parallel fashion and on each branch 91 00:06:21,458 --> 00:06:23,518 we have got a tap. 92 00:06:24,760 --> 00:06:30,920 So what happens in this case? Now if I turn this tap off, stop 93 00:06:30,920 --> 00:06:35,760 the water flowing here, but I don't turn this stuff off. 94 00:06:36,400 --> 00:06:40,573 The water will be able to bypass that turned side and fluid flow 95 00:06:40,573 --> 00:06:44,104 through. Here the same the other way around. And obviously if 96 00:06:44,104 --> 00:06:48,598 both of the tabs are open then the voter have got the choice of 97 00:06:48,598 --> 00:06:51,808 flowing through one or the other, so the OR operation. 98 00:06:52,470 --> 00:06:56,370 Opposite to what the end does, it only stops the water. In one 99 00:06:56,370 --> 00:07:00,270 case it stops the water if both of the taps are turned off. 100 00:07:01,570 --> 00:07:05,509 So what does it look like in the truth table fashion? So again. 101 00:07:07,680 --> 00:07:12,360 P or Q. What are the possible income combinations and what are 102 00:07:12,360 --> 00:07:15,480 the possible outcome combinations of these? So again, 103 00:07:15,480 --> 00:07:17,430 I can have two values. 104 00:07:18,270 --> 00:07:19,710 Two input values P. 105 00:07:20,330 --> 00:07:20,780 K. 106 00:07:22,020 --> 00:07:26,992 So again, what are the different input combinations for these two 107 00:07:26,992 --> 00:07:29,252 values? The P&QA quick trick. 108 00:07:29,850 --> 00:07:37,270 True, true Force Force 3434. This fact comes from I've 109 00:07:37,270 --> 00:07:40,238 got two input values. 110 00:07:41,750 --> 00:07:47,836 P or K, but all both of them can be true or false, so I only have 111 00:07:47,836 --> 00:07:52,490 got two possible switch stands. So 2 to the power of two gives 112 00:07:52,490 --> 00:07:57,502 me 4, but two is the number of input values and two is the 113 00:07:57,502 --> 00:08:00,366 number of possible outcomes like trues or force. 114 00:08:01,420 --> 00:08:06,484 So what did we establish if both of the taps are turned 115 00:08:06,484 --> 00:08:11,548 on, then the voter can flow through. If one of the taps 116 00:08:11,548 --> 00:08:16,190 are turned on, then the water can flow through that branch 117 00:08:16,190 --> 00:08:18,300 and bypass the off tab. 118 00:08:19,480 --> 00:08:24,485 But if both of the taps are turned off than the water it 119 00:08:24,485 --> 00:08:27,950 stopped. So that's when this this operation is forced. 120 00:08:28,720 --> 00:08:33,556 So the next operation that I would like to talk about is the 121 00:08:33,556 --> 00:08:36,532 not operation, which sometimes also used this symbol. 122 00:08:37,310 --> 00:08:42,040 Sometimes this symbol and sometimes it used just by a bar 123 00:08:42,040 --> 00:08:46,770 over the input for the pictorial symbol for the Northgate. For 124 00:08:46,770 --> 00:08:51,930 engineers is this it's a little triangle with a little circle at 125 00:08:51,930 --> 00:08:53,220 the end now. 126 00:08:54,150 --> 00:08:59,140 Compared with the others, the not operation only have one 127 00:08:59,140 --> 00:09:01,635 input and has one output. 128 00:09:02,210 --> 00:09:08,990 OK, so that state to wait as you something. So if I have got just 129 00:09:08,990 --> 00:09:11,702 one input then that input P. 130 00:09:13,270 --> 00:09:17,790 Can only be true or false and then not P. 131 00:09:19,300 --> 00:09:24,508 But what is not true? What is not true is force and 132 00:09:24,508 --> 00:09:29,282 what is not force is true. So the not operation has 133 00:09:29,282 --> 00:09:34,056 got a very special role. It flips it inverts it changes 134 00:09:34,056 --> 00:09:36,226 the input to its opposite. 135 00:09:37,700 --> 00:09:40,340 The next simple operation is the X or. 136 00:09:41,850 --> 00:09:47,986 Which has got this symbol, so it doesn't have that many symbol as 137 00:09:47,986 --> 00:09:53,178 the not. So that's easier. And the exors pictorial symbol for 138 00:09:53,178 --> 00:09:54,594 joining as circuit. 139 00:09:55,720 --> 00:09:57,520 Is the OR gate? 140 00:10:00,400 --> 00:10:04,855 But with an extra leg added to it so it can take again at least 141 00:10:04,855 --> 00:10:08,716 two inputs. Or if we use the alternative way of the X or. 142 00:10:10,650 --> 00:10:11,690 And it would look. 143 00:10:12,420 --> 00:10:13,500 Something like that. 144 00:10:14,610 --> 00:10:20,010 OK, now this is called the axle operation because it's 145 00:10:20,010 --> 00:10:20,550 exclusive. 146 00:10:22,160 --> 00:10:22,630 Or 147 00:10:23,830 --> 00:10:29,176 so it's exclusively one or the other input, so the xclusive 148 00:10:29,176 --> 00:10:35,008 or the X or operation filters out the input values when the 149 00:10:35,008 --> 00:10:41,812 inputs are the same. So what do I mean by that? If I have 150 00:10:41,812 --> 00:10:43,270 got inputs P&Q? 151 00:10:45,390 --> 00:10:49,558 What will the acts or do to them? 152 00:10:51,790 --> 00:10:57,022 So again, be can be true to force force and Q is 153 00:10:57,022 --> 00:10:58,766 true force three force. 154 00:10:59,950 --> 00:11:04,498 So exclusive, or if the inputs are the same, which is this 155 00:11:04,498 --> 00:11:09,425 case? Because both of them are true. The Exor Gate gives you a 156 00:11:09,425 --> 00:11:13,215 4th signal. Basically the axle gates stops the signal going 157 00:11:13,215 --> 00:11:18,142 through. If one is to the other one is forced then that's when 158 00:11:18,142 --> 00:11:22,311 the signal can go through and again because force enforces the 159 00:11:22,311 --> 00:11:26,480 same input value that the EXOR gate stops your signal going 160 00:11:26,480 --> 00:11:30,270 through. And remember that I mentioned at the beginning of 161 00:11:30,270 --> 00:11:34,584 this video. These are based on the electric circuits and then 162 00:11:34,584 --> 00:11:38,500 you wanted to manipulate at the very, very early stages or 163 00:11:38,500 --> 00:11:42,060 lippit stages of computing you wanted to manipulate where the 164 00:11:42,060 --> 00:11:45,264 electrical signal goes doesn't go through here doesn't go 165 00:11:45,264 --> 00:11:48,468 through that you wanted to manipulate and filter out 166 00:11:48,468 --> 00:11:52,384 certain inputs in favor of other inputs. So these different gates 167 00:11:52,384 --> 00:11:56,656 give you that kind of option of turning them around. Saying, I 168 00:11:56,656 --> 00:12:00,572 don't want this input, I want that that input combination to 169 00:12:00,572 --> 00:12:02,352 go through and nothing else. 170 00:12:03,530 --> 00:12:06,720 There are a couple of more operations that I would like 171 00:12:06,720 --> 00:12:09,330 to talk about. These are slightly more complicated. I 172 00:12:09,330 --> 00:12:12,810 can't really give you any nice and simple example of why they 173 00:12:12,810 --> 00:12:16,580 work in here. We just have to learn that this is the way 174 00:12:16,580 --> 00:12:19,770 that they work, so one of them is that you've done. 175 00:12:22,050 --> 00:12:25,047 And the symbol for that is this forward error. 176 00:12:26,440 --> 00:12:30,350 So again. I've got inputs P&Q. 177 00:12:31,320 --> 00:12:35,220 And then what will be the Alpha output of the 178 00:12:35,220 --> 00:12:37,170 P IF then Q operation? 179 00:12:39,620 --> 00:12:46,586 So true true Force force three force, three force. 180 00:12:48,030 --> 00:12:51,060 Sometimes this also called the implies. 181 00:12:53,470 --> 00:12:57,196 So true implies true, that is 182 00:12:57,196 --> 00:13:04,340 true. But true cannot imply force, so this one is force 183 00:13:04,340 --> 00:13:06,592 force can imply true. 184 00:13:08,150 --> 00:13:11,290 And force can imply force that's true. Again, this is 185 00:13:11,290 --> 00:13:14,430 probably going to be the most difficult gate to understand 186 00:13:14,430 --> 00:13:18,198 why this works. You just have to learn the truth tables, and 187 00:13:18,198 --> 00:13:21,652 once you know the truth tables, you can apply it to 188 00:13:21,652 --> 00:13:22,908 any kind of combinations. 189 00:13:25,070 --> 00:13:29,308 And the last operation that I would like to talk about is that 190 00:13:29,308 --> 00:13:30,612 if and only if. 191 00:13:33,130 --> 00:13:36,903 And the symbol for that is an arrow that goes both 192 00:13:36,903 --> 00:13:40,676 ways. So if I have got the two inputs again P&Q. 193 00:13:42,840 --> 00:13:47,570 The P if and only Q will work this way. 194 00:13:49,130 --> 00:13:55,020 33443434. 195 00:13:57,240 --> 00:13:59,440 This one is only true. 196 00:14:00,420 --> 00:14:05,488 If both inputs are the same, so true and true are the same, so 197 00:14:05,488 --> 00:14:09,470 this will be true. True annefors are different, so the output 198 00:14:09,470 --> 00:14:14,538 will be force same for the third right and for some for side the 199 00:14:14,538 --> 00:14:19,968 same. So this is true in here. Now if you look at this one and 200 00:14:19,968 --> 00:14:24,312 if you remember the X or you can support that these two 201 00:14:24,312 --> 00:14:29,018 operations if and only if an the X or are doing exactly the 202 00:14:29,018 --> 00:14:30,828 opposite in this using this. 203 00:14:30,880 --> 00:14:37,312 Operation I can filter out the same input values and stop the 204 00:14:37,312 --> 00:14:38,920 different input values. 205 00:14:40,000 --> 00:14:43,132 So that's again a very useful operation to have. 206 00:14:46,120 --> 00:14:50,748 This short video was intended to expose you to the basics of the 207 00:14:50,748 --> 00:14:54,664 Boolean logic or digital logic and show you had the truth. 208 00:14:54,664 --> 00:14:58,936 Tables can be built up and what are the most commonly used 209 00:14:58,936 --> 00:15:03,208 operations to be able to follow up on digital logic? You will 210 00:15:03,208 --> 00:15:07,836 need to be able to know this by heart, so these are different 211 00:15:07,836 --> 00:15:12,108 operations that every time you need to apply them you will be 212 00:15:12,108 --> 00:15:15,668 have to be very, very confident knowing these operations how 213 00:15:15,668 --> 00:15:19,176 they work. What they do? What kind of inputs they let 214 00:15:19,176 --> 00:15:22,520 through an? What kind? What kind of inputs they stop from 215 00:15:22,520 --> 00:15:25,560 going through? And again, as I mentioned at the beginning, 216 00:15:25,560 --> 00:15:28,600 this is all coming from the basic principles that went 217 00:15:28,600 --> 00:15:31,640 first. Human started team when the computers they build them 218 00:15:31,640 --> 00:15:33,464 together from very tiny basic circuits.