[CS61C FA20] Lecture 16.4 - Combinational Logic: Laws of Boolean Algebra — Transcript
Full transcript
- 0:00and welcome back now let's look at some
- 0:02of the
- 0:03laws of boolean algebra what are some of
- 0:05the rules we'll use what are some of the
- 0:07the principles properties identities
- 0:09we're going to use
- 0:10for boolean algebra i love this let's go
- 0:13one by one to take it really slow to
- 0:15make sure you understand how each one
- 0:17works
- 0:18so there's a kind of a parallel set of
- 0:21laws that are actually interesting in
- 0:22this way
- 0:23so there's like it's okay there's a
- 0:26beautiful duality
- 0:27that comes kind of comes to the front
- 0:29when we're talking about building
- 0:30algebra
- 0:31the duality is peril universes yin yang
- 0:34good versus evil dark side and the light
- 0:37side of the force
- 0:39you have here zero and one
- 0:43and an or okay so a lot of times you're
- 0:45seeing these
- 0:46your team these even these rules have
- 0:48kind of one side versus the other side
- 0:50of that so
- 0:51let's take a look the first is the law
- 0:53of complementarity
- 0:55this says x
- 0:59and its complement what is the property
- 1:02when you multiply them or when you add
- 1:05them where
- 1:06can you ever have a case where it can be
- 1:08both true
- 1:10and false i can both both x and not x at
- 1:13the same time
- 1:14never happens so that's zero
- 1:18contrast that with what happens
- 1:22i'll be happy if i have know a burrito
- 1:25for dinner
- 1:26or if i don't have a burrito well guess
- 1:28what you're always going to be happy
- 1:29because one of those is going to be true
- 1:30if either one is going to be true either
- 1:32one is going to be
- 1:32there x or not x yep that's always 1.
- 1:36so that's actually kind of neat so we
- 1:37can actually match that to here
- 1:39law of ones and zeros x and one is
- 1:43x and zero is zero i have to be x
- 1:46and false it can never be the false kind
- 1:49of cancels it in a way
- 1:51so x and zero is definitely x
- 1:54or 1 is 1. you know x or
- 1:57always true well that's true in fact
- 1:59i've actually written code where i
- 2:00wanted to
- 2:01i was testing some loop some test x okay
- 2:03and i wanted to go and make sure you hit
- 2:05this test and go in there
- 2:06i would write i would literally write in
- 2:08my code i had my test
- 2:09x and i would say or one
- 2:13and i know if it's or one meaning or
- 2:15true it's going to go into that piece of
- 2:17code
- 2:17and if i want if i have a piece of code
- 2:19as an x i i never wanted to go i would
- 2:20say
- 2:21and zero so i actually use these a lot
- 2:24in my coding
- 2:25to have it either always go in the loops
- 2:27or there or always get out of the but
- 2:28i'll make a note to say take this out
- 2:29later when the production code is out
- 2:31there
- 2:31but if i just want to really quick
- 2:33rather than delete the x and write true
- 2:35i'll actually say and one or i'll say
- 2:37i'll say and zero or
- 2:39one to either never have to go in the
- 2:40loop or yes always go in the loop kind
- 2:42of cool
- 2:44this one is from math nothing i need to
- 2:45tell you about there identity the
- 2:46identity of multiplication is one they
- 2:48did it which is
- 2:49and and is true the identity of or
- 2:52or addition is zero so uh it's like
- 2:55saying
- 2:56x or false is still x
- 2:59so the identity of or is false identity
- 3:02of
- 3:02and is true that's kind of neat so if i
- 3:04have this big and
- 3:06like the accumulator was adding things
- 3:07together the identity of
- 3:09of of addition is zero so i initialize
- 3:11it to zero if i'm going to and things
- 3:13together
- 3:14what do you initialize it with right
- 3:16there you initialize it with true
- 3:18if you know that with zero i don't care
- 3:19what else you have here it's zero
- 3:22okay i've got this one
- 3:28and this one is fun i'm going to play
- 3:30this song for you let me play it ready
- 3:31here we go three two one
- 3:32item potent let me play this here for
- 3:34you this is kind of a fun thing
- 3:35item pose you hear that do you hear that
- 3:38item potent
- 3:39okay this just basically says
- 3:42x and x it's not two x's i mean x
- 3:46x times x would be x squared in some
- 3:47other world but this is x and x it's
- 3:49just
- 3:49x it's gonna be x and also x well
- 3:52nothing happened nothing
- 3:53there was no new information there x or
- 3:56x same thing
- 3:57no new information item potent says this
- 3:59just replace anything of the same
- 4:01uh with itself this is a commutative law
- 4:05i've
- 4:05shared that before that's that's a
- 4:07principle now it isn't necessarily true
- 4:09but it is true in the boolean algebra
- 4:11and it's true in mathematics it's also
- 4:12true here showed you that we have
- 4:14associativity
- 4:16we have this this is the same doesn't
- 4:17matter how you parenthesize things
- 4:20also doesn't matter how you parenthesize
- 4:21the addition that's not new
- 4:23and not special all right distribution
- 4:26is kind of cool
- 4:28this means that i can take x and
- 4:29distribute x to both y and z
- 4:32and i can also reverse distribute if i
- 4:34have a common x
- 4:35i can pull the x out to have the x in
- 4:36the front now
- 4:38this is the width what's the equivalent
- 4:39on the other side it's this
- 4:42rule look at this rule this is a really
- 4:45interesting rule which i can prove for
- 4:46the other terms
- 4:48let's actually take a look at the deeper
- 4:49this rule well i'll start over here okay
- 4:51x this let's do the foil method right
- 4:54this is x
- 4:55x plus x y
- 4:59plus that's outside right x z
- 5:02plus y z okay
- 5:05let's start some using some rules i
- 5:07don't know what do you see you might see
- 5:09the the item potent rule
- 5:11x times x that's just x okay
- 5:14how about x or x y
- 5:18anybody see this rule before where's the
- 5:20x or
- 5:21x y actually that's this one that's this
- 5:24that's the uniting theorem we can get to
- 5:25that in a second
- 5:26um here is um
- 5:30y and z i'm trying to get to x plus y z
- 5:33so
- 5:34this is x or okay i'm gonna skip
- 5:38i'm skipping to the uniting theorem okay
- 5:41i'm skipping to the uniting theorem
- 5:43here we go uniting theorem which says
- 5:47x y or x is just
- 5:51x so meaning it says like it says okay
- 5:53it's true when x is true
- 5:55it's also true if x and y is true but
- 5:57you knew it was true when x is two
- 5:58already
- 5:59so this is no new information the y
- 6:01doesn't help at all that's just the same
- 6:02as x
- 6:03so if you add this x y term it's just x
- 6:07if i take that this is x or x y
- 6:10or xz this because of the uniting
- 6:13theorem
- 6:14just becomes x therefore this
- 6:17distribution law
- 6:18x plus y z is just
- 6:21x plus y z so you kind of need the
- 6:23uniting theorem to simplify that side of
- 6:25the distribution
- 6:26okay and similarly this uniting theorem
- 6:29on the right side
- 6:30says so let's do it okay x or y
- 6:33times x what is that which means x and
- 6:37some other thing that has an x in there
- 6:39well why does that the same as just
- 6:40saying x why can't i just drop that off
- 6:42and write a 1 there or just even just
- 6:44cancel it why can i just cancel this
- 6:46term and write a 0
- 6:47and why can't i can't determine write a
- 6:48one because x times one is x
- 6:50why well let's do it let's distribute
- 6:52this out this becomes x
- 6:53x or x y actually becomes y
- 6:56x i do this right well y x is the same
- 6:59as x y
- 7:00that's this term that's the commutative
- 7:02law here okay
- 7:03so i got that away this is this becomes
- 7:06x y
- 7:07x x becomes x what's that item potent
- 7:10item potent and x or x y
- 7:14is just x that's this guy that's the
- 7:16uniting theorem therefore
- 7:18this is also this kind of is used to
- 7:20prove that guy so
- 7:21the summary of these is that you
- 7:24probably saw that before you saw it
- 7:25before you saw it before
- 7:26this is new this is new you probably
- 7:29didn't know that one now you know this
- 7:31one
- 7:31this is kind of cool if you ever have an
- 7:34x term
- 7:35or something else that has an x in it as
- 7:37well cancel it out
- 7:39if i have an x term times something that
- 7:42has an addition of x terms i can cancel
- 7:44out as well
- 7:44you just get x that's kind of cool the
- 7:47last one is really powerful and you're
- 7:49going to see this
- 7:50a lot in logic de morgan's law this is a
- 7:53kind of neat thing
- 7:54this says what this says you know this
- 7:57gate is right by the way right here
- 7:58watch this
- 7:59this gate is a nand gate do you get this
- 8:04this says it's an i first take
- 8:07x times y x and y this is an and
- 8:10and then i put a bubble at the end
- 8:12that's the bubble at the end
- 8:14so this is the same as watch this
- 8:17an or gate in which the bubble
- 8:21is in the on the input okay x
- 8:24and y and here's the output
- 8:28here's how to memorize this it's pretty
- 8:30cool you can prove this in logic but
- 8:31here's a way to memorize this
- 8:33it's kind of fun i take my inversion
- 8:37and i distribute it to all
- 8:40three terms
- 8:44so i had this x and y and i i invert
- 8:47everybody
- 8:48if i invert everybody this
- 8:52becomes not x x becomes not x
- 8:55and becomes or and
- 8:59y becomes not y the same thing on this
- 9:02side
- 9:02i had x or y and i invert the whole
- 9:05thing again this is the same as a nor
- 9:06gate
- 9:07and i can it's the same as an and that
- 9:09has x and y inverted on the inputs so i
- 9:11can draw here same idea
- 9:12so this is the and this is the same as
- 9:16here's my this with that these are the
- 9:18same
- 9:20why i take my not and i apply it to
- 9:23every term including the operator so
- 9:27this becomes not x this becomes i invert
- 9:30addition to b multiplication i invert y
- 9:33to b not y
- 9:34that's the way to memorize that it's
- 9:35pretty cool de morgan's law
- 9:38so let's do an example here we go y is
- 9:41a b or a or c is that simplest form
- 9:45let's see well look at this wow i can
- 9:48now
- 9:49take this and remove the a
- 9:52i can distribute i call it reverse
- 9:54distribution reverse distribution there
- 9:56take that this a all right by the way
- 9:58this silently was a times one
- 10:01okay now i have a times b plus a times 1
- 10:04i can take the a's away
- 10:05that's both distribution and identity
- 10:07because a is really a times 1.
- 10:09the law of ones says that a times 1
- 10:12is just i'm sorry b plus 1 i'm sorry
- 10:15let's go back b plus one is just one
- 10:19b or one is one we kind of saw that that
- 10:22was the law of ones
- 10:23and a times one is a that's kind of
- 10:25remember that so there's only a coupling
- 10:27to memorize from the slide before
- 10:28if you go back here the law of zeros and
- 10:31ones is
- 10:32remember that one probably i item potent
- 10:34you probably need to memorize that one
- 10:36you know this one you know this one
- 10:37you know this one this one you might
- 10:39need to remember complementarity maybe
- 10:41you didn't know that before
- 10:42distribution you probably know this one
- 10:44you probably didn't know this one so you
- 10:46need to know that one
- 10:48uniting theorem also need to know so
- 10:50know that one that one and de morgan's
- 10:51laws it's really cool so there's some
- 10:52new ones you need to know
- 10:53from this as you go forward yielding
- 10:57this guy i i think of this as like
- 10:59dipping your hands in massage oil and
- 11:01you massage
- 11:02you you're working through you probably
- 11:04some nice music let's cue the music
- 11:07welcome to my massage clinic i'd like to
- 11:10give you
- 11:10and make you work all the kinks out of
- 11:12your muscles
- 11:13i see your muscles are very very very
- 11:16tight
- 11:17let me try to work those out hours later
- 11:20look at you you walk away at just a plus
- 11:22c do you feel better
- 11:24thank you i'm so happy please leave a
- 11:26tip in the tip chart wonderful
- 11:28okay so that's the idea if you can use
- 11:31that's why we use it okay pretty cool
- 11:33that's it
- 11:34uh next lecture is on canonical forms
- 11:36we'll see you there
About this transcript
This page contains the full transcript of [CS61C FA20] Lecture 16.4 - Combinational Logic: Laws of Boolean Algebra by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 2,183 words across 336 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.