now that we have come up with this set of gates these logic gates that we can create well logic circuits with let's put them together to create combinational logic combinational logic well it's exactly what it is it's it's combinations of these logic gates in order to create specialized truth tables you know we had those three well four truth tables if you include the inverter or the not gate but we had the truth table for the and gate and remember the and gate output a one when only when all of its inputs equaled one the or gate output a one if any of its inputs equaled one the exclusive or gate output a one if there were an odd number of ones at its input all right so and in fact we have done a little bit of a combinational logic circuit already whenever we cascaded those exclusive or gates to show that a multiple input exclusive or gate a three or more input exclusive or gate could be created with with exclusive or gates that only had two inputs so we have created a combinational logic circuit already now let's come up with a simple example imagine we have a classroom and in this classroom we have well there's a door there's windows and and you know seating for students and we have a door open sensor the door open sensor just simply is a contact switch which is closed whenever the door is closed open wherever the door is open we also have motion detectors to detect if there's any motion in the room and we have glass break detectors now we have an alarm system that is connected to these sensors it's monitoring these sensors to determine when to set an alarm off well when do we set an alarm off remember conjunction junction we are going to put together the states of these sensors in a sentence i want the alarm to go off if motion is detected or if the door is open or if glass is broken sounds like an or gate to me so let's make this circuit we're going to just simply make an or gate and have the three inputs and simply say door motion or glass now in this particular scenario well if any of those goes off the alarm is going to go off if any of the if the door is open or if motion is detected or if the glass is broken the alarm is going to go off that pretty much means that well maybe in my classroom the students aren't moving much but i'm moving so motion would be happening whenever i'm in a lecture and the alarm would be going off plus students will be leaving coming in and out i'll be coming in and out whenever the class is going so the door will be open the alarm will be going off this is not a good scenario so what do you need to have well most alarm systems have what's called an armed sense an armed signal now that signal is well let's just say it's a one whenever the system is armed and a zero when the system is disarmed then what we've got is well a new a new way of saying this sentence i want the alarm to go off when the system is armed and in parentheses i want to have the door is open or motion is detected or glass is broken the circuit will look something like this and i'm going to go ahead and instead of using door emotion and glass i'm going to go ahead and just use the letters d m or g so d m g so at this point what i've got is door is open or motion is sensed or the glass is broken and i'm going to put those in parentheses all right so this is basically a signal that says one of the sensors has been tripped which one we don't know but any of them have been the or gate then what we want to do is we want to say we want to set the alarm off if this is true and the system is armed so i'm going to take an and gate remember it's in a shape of a d and i'm going to have a signal a and this signal a represents the armed signal so the system is armed and then we'll have the alarm go off all right so our system's a little bit more well a little bit more robust at this point if the door is open or motion is detected or glass is broken and the door is armed or excuse me the alarm is armed the system is armed then the alarm's going to go off so what is the what is the boolean expression look like here well what we're going to do is we're going to take this input d or m or g and we're going to and it with the a so this becomes a and remember we use the dot or the the the the product for the symbol for the and in this class and then we have anded with d or m or g all right my sort of you know if i'm in a classroom and glass gets broken i kind of want somebody to know about it in fact what we're going to do is call and call this glass sensor we're going to make it so it can't be masked unmaskable non-maskable and so our our expression we may want to have something a little bit different in fact let's go ahead and start with the expression rather than starting with the the circuit what i'd like to see is the alarm to go off if the system is armed and the door is open or motion is detected all right so this this this is just simply monitoring the door and the motion or i want the system to go off if the glass is broken all right so if the glass is broken set off the alarm or if the door is open or motion is detected while the system is armed set off the alarm well what does this look like in the in the combinational logic well the way it looks like in combinational logic is hopefully you got this this idea of order of precedence whenever you were uh you know learning about math mathematical operations let's see uh there were things like powers and parentheses and and things this order that we're going to be doing operations in right now we have just the two operations actually the three if you include the parentheses these three symbols so the very first thing we're going to do is we're going to do anything inside of parentheses first once we do something inside of parentheses then we're going to do the products after we do products we do sums so the order goes something like this first prod at first parentheses then products then sums in the terms of logic first parentheses then ands then ors and it's not too difficult to wrap your mind around because it's similar whenever we do this order of precedence whenever we do multiplication versus addition multiplication comes before addition ands come from before ors so i'm going to start with my signals on this side i'm going to have my a for my armed my d for my door my m for my motion and my g for my glass all right now going left to right what's the very first thing that we do in this expression well the very first thing we do is since it's inside of the parentheses we combine d or m so we take an or gate that's the one with the curved input and the pointed output and we input d or m in order to get d or m here all right now looking at this expression what would be the next thing that we would do well we've got two options we basically have the a we have the d or m and we have the g how do we combine them well the order that we combine them in is that we first combine we first do the the the product the and so the next thing to happen is the and combining a armed with d or m so at this point we have a and d or m in parentheses what's the last step well the last thing to do is to take the g and or it with the output from this particular gate let's shorten this up a bit so i have some room on the board so i'm going to take this go into an or gate and combine it with the g and at this point right here we've got the alarm is going off or whether the alarm is going off or not all right in the next lesson what we're going to do is we're going to start out with this expression or this this circuit and we're going to convert it to a truth table we're also going to talk about the symbol that we're going to use for the inverter