Part 1 of a digital logic desing tutorial series. Boolean Algebra & Demorgan's Theorems explained and how they are useful for circuit simplification.
EEVblog Main Web Site: http://www.eevblog.com
The 2nd EEVblog Channel: http://www.youtube.com/EEVblog2
Support the EEVblog through Patreon!
http://www.patreon.com/eevblog
EEVblog Amazon Store (Dave gets a cut):
http://astore.amazon.com/eevblogstore-20
T-Shirts: http://teespring.com/stores/eevblog
EEVblog Main Web Site: http://www.eevblog.com
The 2nd EEVblog Channel: http://www.youtube.com/EEVblog2
Support the EEVblog through Patreon!
http://www.patreon.com/eevblog
EEVblog Amazon Store (Dave gets a cut):
http://astore.amazon.com/eevblogstore-20
T-Shirts: http://teespring.com/stores/eevblog
Hi. In a previous video, we took a look at basic digital logic gates, truth tables, and basic boolean algebra. Now it's time to move on to theorems, more specifically, boolean and Demorgan's Theorum Switch allow us to do circuit or digital logic simplification. so let's take a look at boolean theorems first.
It won't be complex at all, so don't worry about theorems you might think are hard, but these are pretty basic concepts. So there are two types of boolean theorems. There are single variable theorems and multivariable theorems. Now, single variable theorems are really easy.
Let's take the example of we have an end gate here like this: We have an output, we have an input and the other input here is inverted like that and our input is A like this. Then our theorem can said to be A and not A because it's inverted over here. If you remember your truth tables from before, you can just figure it out from your knowledge of our n gates. Both of the inputs can never be high at the same time because there's an inverter in there giving you the not So the output is always going to be 0 And that right.
There is a single variable theorem because we've only got one variable I here. that's all there is to it and you can have any combination of I gates doing the same thing. Let's for example, say we had an or gate here and we actually tied the inputs to the or gate together like that. Then if we had A here then that would give us A on the output.
So the theorem would be A or which is the plus symbol I Like that is always equal to a very simple, just a single variable theorem because we only have the one variable involved in the equation. Now we move on to multivariable theorems. Now, a theorem is not an equation. so we're not going to put say output ZB here or anything like that because this we're not dealing with equations are just propositions based on in this case, logical conclusions based on these gates.
So let me try and explain this a bit better. So we've got an and an gate here with A and B on the input. So this can be A and B. But it can be said that A and B can also be equal to B and A.
We don't care about the order in which they go, and likewise, we can do A or B is actually equal to B or A And these two laws or theorems here are called community of laws and these basically mean we don't care in which order those terms go. It makes absolutely no difference. and if we introduce a third variable here, then we can go A and B and C is equal to A and B and C and is also equal to A and B and C. Like that, the brackets, it makes no difference in which order you actually group them.
And likewise, we can do the exact same thing with the all function. A plus B plus C equals a plus Li group together or C It makes absolutely no difference and you can actually represent those with external I gates as well, not just with 1 3 input or gate. for example, you could actually add extra gates in here. So these are called associative laws in that we can group the variables of or or ends together in any combination we like. so you might be able to see where we're going here if you know basic out. If you don't this might not make you know a huge amount of sense, but hopefully you can follow through. We've now got what's called distributive laws and these work just like regular algebra, except in digital form. They follow the same grouping expressions just like you find in regular algebra.
So just like regular algebra, we can expand these by multiplying or and in the terms out. just like that. So these are all these three different laws here have direct correlation to a regular algebra you might have learned. And likewise, just like regular algebra if we have a common term.
So let's take this logic function here A and not B and C or not A not B and not C. We have the common term here. we have B not B as common and not B is common over here. we can actually simplify that out so we can take out our not B and then we can end it with we can go a and C or not A and not C.
We can take that out and of course, you can put parentheses around there just to group the expressions if you really want to, but that's just like regular algebra you no doubt learn at school works exactly the same on multi variable boolean logic. Awesome! So the reason we're doing all this is for circuit simplification, because over here, we've got three input and gates for example, and we might need a lot more gates and more gates to implement this, then we do for this function over here. And if I rather crudely draw out the expression on the left hand and the right hand side of this equivalency here. Please excuse the crude: B I Didn't have time to build a scale or to paint it.
You'll notice that we have one, two, three, four, five, two input gates here and three inverters. Where is this equivalent circuit? Over here, we've simplified it only by a little smidgen by one gate. Now, we've only got one, two, three, four, two input gates, plus three inverters. so we've eliminated one whole gate.
Now, this isn't the best example, but you can see that we have simplified the circuit and they're completely equivalent using standard boolean algebra. in this case, using distributive law Algebra or distributive Law boolean algebra. Beautiful! Now let's take a look at a way to simplify things much easier using Demorgan's theorum. Now De Morgan's theorem or De Morgan's Laws However, you want to call as is common in electronics, the name It comes from the person who found it in this case Augustus De Morgan Real, clever dude in the 19th century came up with two very simple laws for boolean algebra here.
Now if we've got A or B and there's a bar right over the top like that, it's equal to not A and not B, you'll notice that it's changed from an Or to an end. And the second one is, if we've got A and B with a not right over the top, it's equal to not A or not. B You'll notice that it's changed from an end here, to and or here. Now these. That's all there is to De Morgan's laws. De Morgan's theorem. Now you should memorize these, but there's a much easier way to think about it. Let me show you, let's say you've got any expression like A or B or C.
It can have as many terms as you want. if you've got a bar over the top of all that, what you want to do is, instead of remembering these laws over here, what you can do is just remember, if you've got a bar on top, what you do is you drop the bar, drop the bar down like this, and change any signs so this will become not A and not B and not C. Drop the bar And of course the bar remains okay When you drop it like this. it changes the signs here and here and it just simply leaves about that bar over the top.
so you can't drop the bar through a term. But those operations there change and that follows this law. This theorem over here. drop the bar, change the operator.
That's all you need to remember for anything to do with De Morgan's theorem. Simple, Let's go more complicated. Let's say we've got a bar like this and B or C bar like this with a bar all the way over the top. What's that one began occur Going to turn out to be I hear you ask? Well, that's what we do is we drop the bar down and we change the sign like this.
So we're going to end up with a baa baa black sheep plus B a bar like that and we've got to change the sign there because we're dropping the bar down and C with a jewel bar. Now, what do you do with these when you've got two bars like this? Well, if you've got a here and you put an inverter like that and then you have another inverter because that's basically what is saying? Well, what are the output here? This point is going to be ie. bar, but this one is just going to be A again. So I equals A.
So if you've got two bars like that, they cancel out so that actually becomes a or B bar and C. That's it. easy. We've simplified the expression.
So what is the implication of this? If we have a look at our function over here, which is just a Nor function, we represent by the Nor gate here. There it is that is equivalent to a NAND gate with the inputs inverted like this. Now you can produce a NAND gate from a NAND gate up here by simply shorting the two inputs. A NAND gate can become an inverter.
Go have a look at the truth table. you should learn previously so we can. You might start to see that we can create an or gate from NAND gates. And likewise, we can create a NAND gate from nor gates down here.
because once again, you tie both inputs of an or gate together like this. then that becomes an inverter, You invert that, it becomes an or gate. and then of course, you can just go up, invert, invert the inputs like this, short those together and that becomes your inverter and put a loop like that inverter input. Bingo, We've created that NAND gate from nor Gates and vise. In fact, I'll go in further this and claim it. And which is true? You can go try it for yourself that you can create any combinatorial logic circuit right up to the complexity of an Intel I7 processor or whatever complex digital system you like using just NAND gates or just nor gates and that includes exclusive or and every other function you can possibly think of. You only need one type of gate. Brilliant! So let's use the example of this little combinatorial circuit here.
We've got two two input nor gates here with the input shorted together so they're acting as inverters, inverting the inputs to this nor gate here. Now, this could be part of a more complex circle or never, but we'll take it just on its own. So the if we call the output C here, then we can actually give that an expression a bar because it's inverted or B bar because it's inverted and we put the bar over the top like that and that is the expression. Now if we apply De Morgan's theorem to this, what do we get? We drop the bar and change the operator sign.
So we've got naught naught A and B with a knot like that and we can eliminate these knots. They cancel each other out, right? So get rid of that. What are we left with La I and B It's equal to a simple and gate like that. simple.
We've completely simplified. so if you saw a circuit that had these gates in it, you know I can simplify that bugger off using three two input gates. I can replace that with one and gate and it's a functionally equivalent circuit that's the power of boolean theorems and De Morgan's theorem to simplify circuits. So if we go, have a look at a datasheet for an exclusive or gate for example, seven for H Cat6 Absolute Classic.
you'll notice there's no exclusive or gate it's made from. Well, in this case, our inverters and gates and nor gates and another inverter. but we've already determined that we can make this nor gate here. For example, we can actually make this Nor gate from NAND gates.
We can make the An gate from NAND gates or we can make the An gates from nor gates, etc. So we can build that exclusive nor function or exclusive all functions sorry out of just a regular gates. So that's how they're physically well. that's similar to how they would physically be implemented in the actual silicon itself.
Everything would be made out of even or gates or NAND gates. so simple as that. So I hope you found that interesting. It's a bit a little bit theoretical this I you know, boolean and De Morgan's theorem spot.
It is one way that we do simplification circuit simplification. Another more advanced way might be say Carnot maps which we'll have to leave to another video. but anyway I hope you found the interesting. If you did, please give it a big thumbs up. And as always comments down below catch you next time you.
Cool! That's a really interesting and complicated implementation of an XOR gate on the chip. Why didn't they just use an OR gate and NAND gate connected to an AND gate? Or an OR gate and an AND gate with a P-channel FET that turns off the output.
do anyone know if he didd a video on K-maps?
thanks bro
Excellent and thanks!!
whatever anything
whatever anything
Break the line, change the sign.
I love this guy teaching ❣️
This was very useful thank you
The best lesson I have found reference Boolean. Thank you.
Demorgan's theorem: "Break the line, change the sign". That's how i've learnt this.
Really enjoyed this, please do more
This takes me back.. spread the knowledge 👍🏿
Will you make part 3?
please help us to make a Rotary Encoder circuit as simple as possible. with out any software. A circuit wich we use in any project. wich will give us simply 0V-10V at output. please.
Great Video Dave !, honestly this is the fist video on your academy series I understand and like
Karnaugh next? Quine-McCluskey too?
Dave, you've made a mistake when explaining Demorgan's laws on inverting boolean formulas. In the video you mention that you should 'drop' the bar and change the operator and that's completely true. What you forgot to mention however is that the order of operation must remain the same. In your example you've got the formula: [(A'.B+C')'] which you rewrite as [A+B'.C] but you also should have added a few brackets to keep the order of operation the same, which results in [(A+B').C]
Just fill in the truth table if you like to check.
I dread these things, every time I have to do them in class I just want to commit suicide.
You should consider releasing educational vids like this to a smaller test audience first (on a second channel or exclusive to Patreon subscribers, etc) so they can catch any minor or major errors before wider release