电子电气工程导论9月24日第一至二节

实时字幕历史

And then we have made three different walls.

然后,我们制作了三种不同的墙。

The cavitation hypnosis, osmosis hypnosis and the dissociation hypnosis.

分别是空化催眠、渗透催眠和解离催眠。

So for the communicative hypnosis, you can just reach the position of the marbles.

那么,对于沟通催眠,你只需要到达弹珠的位置即可。

and for the osmosis hypnosis, that means you can combine

而对于渗透催眠,这意味着你可以将

both variables. either you combine the first two variables or you combine the second. so it makes no difference. in what order the variables are put. it makes no difference in what order the variables are grouped. you can first group b c or you can either first group a d. so it doesn't matter. so this is the distributive law.

这两个变量结合起来。你可以选择结合前两个变量,或者结合后两个。所以,这没有区别。变量的排列顺序无关紧要。变量的分组顺序也没有影响。你可以先把b和c分组,也可以先把a和d分组。所以,这都不重要。这就是分配律。

and this law states that only several variables and it's a single variables. it's equivalent to you add a single variables with each of the several variables and then all of it.

这条定律指出,无论有多少个变量,它都适用于单个变量。它相当于用一个变量分别与多个变量相加,然后再把结果全部加起来。

so this table shows some basic boolean algebra.

这张表格展示了一些基本的布尔运算。代数。

we have learned. especially pay attention to the eleventh. the eleventh equation we will use it today.

我们之前已经学过了。特别要注意第十一项。我们今天会用到第十一个公式。

pay attention to the eleventh. and de morgan's theory. there are two forms. two forms to express de morgan's theory. the first one is you add them and you apply the not. it's equivalent to you apply not first. or it is very close. and let's product them together.

请大家注意第十一项。还有德·摩根定律。它有两种形式。用两种形式来表达德·摩根定律。第一种是,把它们相加,然后取非。这等同于先对它们分别取非。或者说是非常接近的。然后把它们相乘。

second form of de morgan's you apply the product first. and then it's equal to you apply not for each variables. and or them together.

德·摩根定律的第二种形式是:先进行乘积运算。然后再取非。这等于对每一个变量分别取非。然后将它们进行或运算。

and there's only exercises.

接下来只有一些练习题。

and finally, we have learned and also the three de morgan's theory and also the three laws.

最后,我们学习了如何根据德·摩根定律来简化表达式。以及德·摩根的三条定律。

and finally, we have learned a universal logic gate. we can use the logic gate to express all the remaining gate.

最后,我们还学习了一种通用逻辑门。我们可以用这种逻辑门来表示所有其他的逻辑门。

and universal nor gate. You can also use it to express the remaining gate.

还有通用或非门。你也可以用它来表示其他所有的逻辑门。

and so in our last lecture, some student are asking about this question. a is the input, b is the input. so if a the input is like this. and b the input is like this. what is the output? so this slide shows the solution. if a is like this, the input is like this. what is the output of g? and what is the output of g2? and what is the should be g3. it's a typo here. it should be g3.

那么,在上一节课中,有学生提出了这个问题。其中,A是输入,B也是输入。如果输入A是这样的。而输入B是这样的。那么输出是什么?这张幻灯片展示了答案。如果A是这样的,那么输入就是这样。那么G的输出是什么?G2的输出又是什么?应该是G3。这里有个笔误。应该是G3。

so the output is determined. by the input. and the circuit can change. can change the form of the input.

所以,输出是确定的。由输入决定。而这个电路,是可以改变的。它可以改变输入的形式。

you can see the final output is quite different. it's quite different from the input, right? a is like this, b is like this, the final output is just looks very regular.

大家可以看到,最终的结果有很大的不同。和输入不一样,对吧?A是这样的,B是这样的,而最终的结果看起来非常规律。

and it's quite different from a, b. so the logical circuit has the function of changing the input.

而且和A、B都截然不同。所以,这个逻辑电路具有改变输入的功能。

and we have some secondary inputs on the x-axis.

在X轴上,我们还有一些辅助输入。

so we have done question one to six. and question seven.

我们已经完成了第一到第六题。还有第七题。

so i would like to maybe give you five minutes to solve question seven.

所以,我想给大家五分钟时间,来做第七题。

But before we do question seven, let me focus on B and C in question six. Some students are unclear about how to solve the problem. Question six is very similar to question seven. You should only use light and moderate heat. to express the equation.

不过,在我们回答第七个问题之前,让我先重点讨论一下第六题的B和C部分。有些同学对如何解决这个问题不太清楚。第六题和第七题非常相似。你只需要用小火和中火。来列出方程式。

Okay, this is the B.

好的,这就是B部分。

We know "lunch" is the symbol of "lunch".

我们知道,“lunch”是“热量”的符号。

like this, right?

就像这样,对吧?

So this is the basic form.

所以,这就是基本形式。

You add and then apply the log.

先相加,然后再取对数。

Okay, this is exactly what you want. This is the example form of "lunch". And this is also the form of "lunch". But here there's an "or". So we should try to remove remove the "or".

好的,这正是你想要的结果。这就是“热量”的示例形式。这也是“热量”的形式。不过,这里有一个“或”字。所以,我们应该试着把它去掉。去掉那个“或”。

But how could we remove the "or"? If you remember the De Morgan's theorem,

但是,我们该如何去掉“或”呢?如果大家还记得德·摩根定律,

it

那么它

you can remove the "or". by applying De Morgan's theorem.

就能帮你去掉“或”。只要应用德·摩根定律即可。

this is the De Morgan's theorem. So this equation

这就是德·摩根定律。所以,这个等式

we just put two log.

我们只是加了两个对数。

And for this part, we apply De Morgan's theorem.

至于这一部分,我们应用了德·摩根定律。

for the inverse x.

针对x的取反。

Okay, this we have two log.

好的,这里我们有两个对数。

is this same? from this to this one? yes, it is.

这是一样的吗?从这个到那个?是的,确实一样。

this is clear. and these two log we can remove, just remove. so it should be equivalent to A.

这一点很清楚。这两个对数我们可以去掉,直接去掉就行。所以应该是等于A。

and now we should stop here. we should not do anything. do any modification or do any revision anymore. because it's already the form. of NAND, right? you have AND, you have AND, and finally you have the NOT.

现在我们就应该停在这里了。不要再做任何操作了。不要再进行任何修改或 revisions了。因为它的形式已经符合要求了。就是与非门的形式,对吧?这里有与门,还有与门,最后还有一个非门。

so let's plot. draw the logical symbols.

那么,我们来画一下图。画出逻辑符号。

you have A, B, C, D. E, F.

这里有A、B、C、D。还有E和F。

okay, first A, B, C, D. and D is not, so we should first apply a NOT function.

好的,首先是A、B、C、D。而D是非门,所以我们应该先应用一个非函数。

D and C.

D和C。

this is C not, D not. okay, this term is exactly a NAND gate, right? so we put them together.

这是C非,D非。好的,这一项正好就是一个与非门,对吧?所以我们把它们组合在一起。

this is the first attempt.

这是第一次尝试。

okay, the second term.

好的,第二个项。

E.

E。

E is not, so we should also use a NOT function. here. and there's an F.

E也是非门,所以我们也应该使用一个非函数。在这里。还有一个F。

D, E not, F.

D、E非、F。

so we create a branch. create a branch from D. should be before the NOT function, not after. if you create a branch after the NOT function, you are getting NOT.

所以我们创建一个分支。从D这里分出来。应该放在非函数之前,而不是之后。如果你在非函数之后创建分支,得到的就是非。

and so this is D. this is D not F. and it's three variables. all and together and then apply the NOT. this is the second NAND gate.

所以,这就是D。这是D非F。而且它有三个变量。把它们全部放在一起,然后再取非。这就是第二个与非门。

right?

对吧?

and this is directly A F.

而这个直接就是A和F。

so the third step will be me create an

那么第三步,我将创建一个

branch. this is A.

分支。这是A。

this is F.

这是F。

right? A, F.

对吧?A,F。

and these three terms.

还有这三个项。

actually four terms, because it's A F.

其实有四个项,因为AF也算一个。

these four terms, they are added together. and a black box. the whole part is a logic gate.

这四个项是加在一起的。还有一个黑盒。整个部分就是一个逻辑门。

right?

对吧?

so the solution for question 6b. should look like this.

所以,这就是第6题b问的解法。看起来应该是这样的。

is it clear?

清楚了吗?

okay, so question 6c.

好的,那么第6题c问。

and for this equation, we should first use the distributive law.

对于这个方程,我们首先应该使用分配律。

okay, equals to B or

好的,等于B或

right? so this step is clear.

,对吧?所以这一步很清楚。

and let me do it further.

让我继续做下去。

okay, should be like this, right? when you use the distributive law.

好的,应该是这样的,对吧?就是使用分配律的时候。

and when you look at this equation, you compare it to this equation, b. they looks very similar. just three terms or together. three and terms, you or them together. so if you know how to solve question b, you should be able to solve this problem as well. they are the identical form. they have the same form, right? three terms, one term added together, and finally or them together. so we have already solved how to solve the question b. so you should be able to solve the problem for question c.

那么,当你看这个方程时,可以把它和这个方程进行比较,就是B。它们看起来非常相似。只有三项,加在一起。三个项,把它们全部进行“或”运算。所以,如果你知道如何解B题,你应该也能解这道题。它们的形式完全相同。它们有相同的形式,对吧?三项,一项加在一起,最后再对它们进行“或”运算。所以,我们已经解决了如何解B题的问题。因此,你应该也能解决C题。

as well. But if the point is like this.

同样。但是,如果情况是这样的。

and here we have a.

这里有一个A。

we have b.

还有一个B。

we have c.

还有C。

okay, first, we should use the de morgan's theory. right?

好的,首先,我们应该使用德摩根定律。对吧?

we put a two not.

我们加上两个非运算。

above.

在上面。

and then you will get

然后你会得到

this form.

这个形式。

right? if you apply de morgan's theory.

对吧?如果你应用德摩根定律的话。

you can get this form.

你就能得到这个形式。

now, let's just apply. okay, this part. we first apply a not. this is a not, you get a not.

现在,让我们直接应用一下。好的,这部分。我们先加上一个非运算。这是一个非运算,结果还是非运算。

a not and a b.

A的非和B。

this term is exactly a and gate.

这一项正好是一个与门。

so a not and a b get one.

所以,A的非和B的结果是1。

you use one and gate. so this is we already done this part. then use the term. and for this term is a not. we already have a not here. and c not.

这里用了一个与门。所以这部分我们已经完成了。接下来处理这一项。对于这一项,是A的非。这里我们已经有了A的非。还有C的非。

and we still have b.

我们还有B。

let's just create a branch here. should after this not, because you use a not here.

好的,我们在这里创建一个分支。应该在这个非门之后,因为这里用到了非门。

a not.

A的非。

this is a not, this is c not, this is b.

这是A的非,这是C的非,这是B。

and this term is another not.

那么这一项是另一个非门。

for the third one, you have a not. you have c not.

对于第三个,也有一个非门。还有C的非。

let's create a branch here.

我们在这里创建一个分支。

this c not, this a not. and we have e.

这是C的非,这是A的非。还有E。

let's make another branch. a not.

我们再做一个分支。A的非。

it's the a not, c not, e. the third AND gate.

就是A的非、C的非和E。第三个与门。

and finally, these three terms.

最后,这三项。

the whole three terms is a big AND gate.

这三项合起来就是一个大的与门。

is it clear? yeah.

清楚了吗?是的。

any questions?

还有问题吗?

okay.

好的。

is the branch is solid or hollow?

这个分支是实心的还是空心的?

hollow.

空心的。

any questions?

还有问题吗?

okay. any other questions?

好的。还有其他问题吗?

if there's no any other questions, that's solve the problem.

如果没有其他问题的话,那问题就解决了。

seven. first is a b c.

第七题。首先是a、b、c。

and we have learned before, if we apply, for example,

我们之前学过,如果应用,比如

if the input is the same, what is the output? for the and gate.

如果输入相同,输出是什么?对于与门来说。

you will get a not, right?

你会得到一个非门,对吧?

so if we apply a not again.

所以,如果我们应用一个非门,

using lunch.

用与非门。

you will get a not.

你会得到一个非门。

so in order to get a b c, you can just apply the logic device. just apply the and gate twice.

所以,为了得到A、B、C,你只需要应用逻辑器件。只需将与非门使用两次。

you will get the original variables.

你就能得到原始的变量。

oh, not like this.

哦,不是这样的。

this is a b c. and here is also a b c.

这是A、B、C。这里也是A、B、C。

and then you apply second

然后你再应用第二个

circle here.

圆圈。

then you will finally get a b c. that's our purpose.

这样,你最终就能得到A、B、C。这就是我们的目的。

is it clear? any questions?

清楚了吗?有什么问题吗?

can we send three sentences to one gate?

我们可以把三个句子送到一个门里吗?

no, you cannot just draw like this. if you draw like this, the expression is different. this is just means the a b c not.

不,你不能就这样画。如果这样画,表达的意思就不一样了。这仅仅表示A、B、C的非。

and what we actually want to input is the original number. for twice.

而我们实际上想要输入的是原始数字。两次。

but we should use gates to

但是,我们应该使用逻辑门来

put a b c together.

把A、B、C组合在一起。

let me think.

让我想想。

oh yeah, yeah, i think this is also correct.

哦,对,我觉得这样也是对的。

so this is a b c.

所以,这就是A、B、C。

and you apply one logic gate. you will get a b c not.

然后你应用一个逻辑门。就能得到A、B、C的非。

and use another logic gate.

再用另一个逻辑门。

if you use another logic gate, should be a b c

如果你再用一个逻辑门,应该是A、B、C

and is equals to a b c. and you will get a b c.

等于A、B、C。这样你就能得到A、B、C了。

so you can also draw like this. for simple. for simplification.

所以,你也可以这样画。这样比较简单。为了简化。

and by the way, we already solved the second. we already solved second. this is exactly a b c and not. second question.

对了,我们已经解决了第二个问题。是的,我们已经解决了第二个。这正是A、B、C的非。第二个问题。

so let's skip b. any questions about the first one?

所以我们跳过B。关于第一个问题,有什么疑问吗?

if there is no questions, we solve the question three. c.

如果没有问题,我们就来解决第三个问题。也就是C。

c is a or b.

C是A或者B。

okay.

好的。

please always remember, for land, we have to get from like this.

请大家记住,对于“非”,我们必须得到这样的结果。

so the or is not what we want. so just apply the de morgan's theory.

所以,“或”并不是我们想要的。所以,直接应用德摩根定律。

and you will get

这样你就能得到

right?

这个结果,对吧?

but now this question we should not use not. in the question six we can directly use not. yeah, a, you apply or not, you will get a not. but this we cannot get a not. so how can we use not? to get a not. we already know that is a universal. it can be used to express all the remaining gates.

但是现在这个问题,我们不应该使用“非”。在第六题中,我们可以直接使用“非”。是的,对a应用“非”,就会得到“非a”。但是在这里,我们无法得到“非a”。那么,我们该如何使用“非”呢?来得到“非a”。我们已经知道,NAND门是一个通用门。它可以用来表示所有其他的逻辑门。

and how can we get a not?

那么,我们如何得到“非”门呢?

yeah, just use a NAND.

是的,只需要使用一个NAND门。

use the NAND gate itself.

把NAND门自己连接起来就可以了。

so if you have two a,

所以,如果你有两个a,

as input, the same input. you will get a not.

作为输入,就是相同的输入。你就能得到“非”门。

so for this question,

那么对于这个问题,

in order to get a not,

为了得到“非”门,

first you have apply

首先你需要使用

a NAND.

一个NAND门。

so this is a not.

所以这就是“非”门。

similarly for b.

同样地,对于b也是如此。

and finally, these two terms,

最后,这两个项,

is another search.

是另一个搜索。

AND gate.

是与门。

okay, any questions?

好的,有什么问题吗?

yes.

有。

you can draw the logical circuit. it's actually is all here.

你可以画出逻辑电路图。其实这里都有。

but in that case, your logical circuit is going to be very complex. yes.

但那样的话,你的逻辑电路会变得非常复杂。是的。

and for the c, similarly, c is actually very same, very similar to b, right? you have a, or b, or c not.

那么对于c,同样地,c是实际上和b非常相似,对吧?你有a,或者b,或者非c。

okay, similarly, apply de morgan's theory.

好的,同样地,应用德摩根定律。

and what do you get?

那你得到了什么?

for the question three, if we apply de morgan's theory, we can get form like this.

对于第三题,如果我们应用德摩根定律,就可以得到这样的形式。

and we already know how to use logic to express not.

而且我们已经知道如何用逻辑表达式来表示“非”。

just use the same input, you will get a not.

只要使用相同的输入,你就能得到“非”的结果。

so for the a,

那么对于a,

use it twice as the input. you get a not.

把它作为输入使用两次。你就能得到a的非。

b, input twice.

对于b,同样输入两次。

you get b not.

你就能得到b的非。

and c, two not function can be removed.

而对于c,两个“非”函数可以抵消掉。

so you just connect them together.

所以你只需要把它们直接连接起来。

the big line again.

就是这条大的线。

any questions?

有什么问题吗?

no, okay. if you have questions, please raise your hand.

没有?好的。如果有问题,请举手。

okay.

好的。

for the logic gate, we don't like the or. so we should always try to remove.

关于逻辑门,我们不太喜欢“或”门。所以,我们应该尽量把它去掉。

remove the or. similarly, use the de morgan's theorem.

去掉“或”门。同样,可以使用德摩根定律。

right?

对吧?

if we apply de morgan's theorem, it will look like this.

如果我们应用德摩根定律,它看起来就会是这样。

it's just ab and ac.

其实就是AB和AC。

yes.

是的。

that's much simpler, just one gate. you have a, you have b. you have c. one gate.

这样就简单多了,只需要一个门。你有A,也有B。还有C。一个门。

and for the question a.

至于问题A,

we should firstly use the distributive law. okay, you have ac. or ad. or bc. or cd. okay. when you look at this term, when you look at this equation, it's very similar to questions c and d. so just apply the same process. using the de morgan's laws.

我们首先应该使用分配律。好的,你有AC。或者AD。或者BC。或者CD。好的。当你看到这个式子时,看这个等式,它和C、D两个问题非常相似。所以,只需应用同样的步骤即可。使用德摩根定律。

and you will get

这样你就能得到

ac times ad.

AC乘以AD。

times bc plus

再乘以BC,加上

cd.

CD。

now i believe you can do it. this is exactly one long gate. this is another long gate. the third. the fourth. and the big one is the

现在,我相信你能做出来了。这正好就是一个长门。这是另一个长门。第三个。第四个。而那个大的,是

last one.

最后一个。

the last nanogate.

最后一个纳米门。

okay, let's solve the last one. g is a little bit complex, but just do some simplification first. i think we have solved the last one. in our last course, but we haven't finished it.

好的,我们来解决最后一个。G稍微有点复杂,但我们先做一些简化。我觉得我们已经解决了最后一个。在上一节课里,但我们还没有完成它。

let's solve it together. so ad remains unchanged. and for this one, use the distributive law.

好的,我们一起来解决它。那么,AD保持不变。对于这个,使用分配律。

you want this c, right? and or b c e

你想得到这个C,对吧?还有,或者BCE。

you will get the form like this.

你会得到这样的形式。

any question like this?

有没有类似的问题?

and let me apply

让我来应用

the a b.

AB。

a b c d e.

A B C D E。

okay. here is something interesting.

好的。这里有个有趣的地方。

Hmm.

嗯。

Actually, you can't worry

其实,你不用担心,

you can already draw the circuit. But we can also maybe simplify the a little bit further.

你已经可以画出电路了。不过,我们也可以试着简化一下它。

because here we can see there is a v here. if we use thevenin's theory, we will get v and v now. v and v now is also zero.

因为这里我们可以看到有一个V。如果我们使用戴维南定理,就能得到V和V0。而且V0也是零。

but we can also stop here. if we stop here, because it's exactly the end, right? it's the second end. and what we have to do is remove or just apply the thevenin's theory.

不过,我们也可以在这里停下来。如果我们停在这里,因为这已经就是最终结果了,对吧?这是第二步的终点。接下来我们要做的,就是去掉或者直接应用戴维南定理。

so you will get a form like this.

这样你就能得到这样的结果。

and it's equivalent to this. right? and then we can draw the circuit.

这相当于这个。对吧?然后我们可以画出电路图。

okay, we have a we have b. we have c.

好的,我们有一个B。还有C。

we have a d. for this one, we apply a not gate first.

以及D。对于这个,我们先应用一个非门。

this is d in not.

这是D的非。

and this term, this bigger term is another not gate.

而这个项,这个更大的项,是另一个非门。

okay, this part, this is the circuit. we present the first term here.

好的,这部分就是电路图。这里表示的是第一项。

and similarly for the second one.

第二项也是如此。

we have a b here. already. and we have c.

这里我们有A和B。已经存在了。还有C。

okay, let's make a branch.

好的,我们来做一个分支。

we have c.

这里有C。

we have d.

还有D。

this is b, this c, this e. apply a not gate here. you will get b c e.

这是B,这是C,这是E。在这里应用一个非门。这样你就得到了B、C、E。

and should be use another not gate. this a b together.

而且,应该是再用一个非门。把A和B放在一起。

okay, this is b. let's create another one.

好的,这是B。我们再创建一个。

this is d.

这是D。

and we should have the a.

我们还应该有A。

let's create another one a.

我们来创建另一个A。

a, b, b c e not. and finally these two terms.

A、B、非B、C、E。最后,是这两个项。

this two terms is also a not gate.

这两个项也是一个非门。

any questions?

有什么问题吗?

let me check how many we still have time.

让我看看我们还有多少时间。

okay, we have two minutes. before the break.

好的,我们还有两分钟。在休息之前。

let's have a 10-minute break.

那我们休息十分钟吧。

那个那个大王录破译它那个有汉化包不 有

那个,那个《大王录破译》它那个有汉化包吗?有。

我看那个里边只有日文和英文啊

我看那个里面只有日文和英文啊。

So this is lecture three. Lecture three. Is there any problem for lecture two?

那么,这是第三讲。第三讲。第二讲有什么问题吗?

any problems?

有什么问题吗?

Okay, when you just have a look at the slides, lecture two is actually quite simple. it's only include the sex symbols. sex logical symbols. three laws. two forms of de morgan's theory. and two universal gates. That's it.

好的。那大家先看一下幻灯片,其实第二讲的内容挺简单的。它只包含了符号。也就是逻辑符号。还有三条定律。以及德·摩根定律的两种形式。还有两种通用门。就这些。

two universal gates, two forms of de morgan's theory, three laws, sex logical symbols. that's all the contents in lecture two.

两种通用门,德·摩根定律的两种形式,三条定律,逻辑符号。这就是第二讲的全部内容。

yeah. so if there's no any other questions, i would like to

是的。那么如果没有其他问题的话,我想

start a new chapter. lecture three.

开始新的一章。第三讲。

the main topic in lecture three is canal max. we will explain what convol max is.

第三讲的主要主题是卷积神经网络。我们将解释什么是卷积。

so first we want to understand why do we need the convol max.

首先,我们需要理解为什么我们需要卷积神经网络。

what is the purpose of convol map?

卷积神经网络的作用是什么?

when you look at the equation here, you have to do a lot of simplification, right? and you have to do boolean algebra. but sometimes could be quite difficult. to be manipulated.

大家看这里的公式,需要进行大量的简化处理,对吧?而且还要运用布尔代数。但有时候这会相当困难。难以操作。

depends on how long the equation is. If the equation is quite long, and there are many variables, you may make some mistakes. during the simplification process. So Karnaugh map is exactly try to address the problem. We do not do such kind of simplification anymore. We draw a Karnaugh map. and use the map to do the simplification. so we use the Karnaugh map to do the simplification. We do not use the boolean algebra anymore. because the boolean algebra could be very sometimes could be very tricky. and difficult.

这取决于公式的长度。如果公式很长,而且变量很多,就很容易出错。在简化的过程中。所以,卡诺图正是为了解决这个问题而设计的。我们不再进行那种手动简化了。我们直接画卡诺图。然后用这张图来进行简化。所以我们用卡诺图来简化,不再使用布尔代数了。因为布尔代数有时候会非常棘手。也很困难。

so the boolean algebra sometimes very difficult to tell whether simplest expression has been found.

所以,用布尔代数有时很难判断是否已经找到了最简表达式。

so Karnaugh map is exactly proposed to address this problem. That is the first two problems. And it's a method of rearranging truth table. We already know what truth table is. and Karnaugh map is a method of rearranging truth tables.

因此,卡诺图正是为此而提出的。为了解决这个问题。这就是前两个问题。它是一种重新排列真值表的方法。我们已经知道什么是真值表了。而卡诺图就是一种重新排列真值表的方法。

so that the terms can be simplified.

这样,这些项就可以被简化。

easily.

非常简单。

and it's a very powerful and widely used. graphic methods. of logical simplification. So the main purpose of Karnaugh map is to simplify the logical expressions.

它非常强大,且应用广泛。这是一种图形化的方法。用于逻辑化简。所以,卡诺图的主要目的就是简化逻辑表达式。

You don't have to do the process like this. like we have written in the screen. Instead, we use the Karnaugh map. for the simplification.

你不需要像这样一步步地进行运算。就像我们在屏幕上写的那样。相反,我们可以使用卡诺图。来进行化简。

And the Karnaugh map has several properties. First, it can gives you the simplest. sum of product form. So it can directly gives you the simplest.

卡诺图有几个特性。首先,它能给出最简的形式。也就是“与或”形式。所以,它可以直接得到最简的结果。

And it allow expression with up to four input variables. to be handled. in a straightforward manner.

而且,它适用于最多四个输入变量的表达式。可以进行处理。而且方法非常直接。

I will explain the second point later. So why for four input variables, it's very straightforward? and why for six input variables can be a little bit difficult?

第二点我稍后会解释。那么,为什么对于四个输入变量来说,就这么简单呢?而对于六个输入变量,为什么就会稍微有点困难呢?

and each cell in a Karnaugh map correspond to one line in a truth table.

卡诺图中的每一个单元格,都对应着真值表中的一行。也就是真值表。

we will go through these three points later. because currently, if you do not understand how Karnaugh map work, you may not fully understand what these three points mean. But no worries. we will go back and explain these three points.

我们稍后会详细讲解这三点。因为目前,如果你还不理解卡诺图的工作原理,可能就无法完全理解这三点的意思。不过不用担心。我们会回过头来解释这三点。

later. And here is the process. here is the process to create the Karnaugh map. First, you draw an empty Karnaugh map. and then you, here is the desired output. correspond to each input.

稍后。这里就是整个过程。这就是创建卡诺图的过程。首先,你要画一个空的卡诺图。然后,这里是期望的输出结果。它对应着每一个输入。

And the third point, you form groups of adjacent cells. can be ones.

第三点,你需要将相邻的单元格分组。这些单元格可以是1。

and then you find the expression for each group. get the entire logic expression.

然后,为每一组找出对应的表达式。最后得到完整的逻辑表达式。

And then maybe let's just have an example.

那么,我们来看一个例子。

here we have many one two three four five we have five. actually six. four. Four Karnaugh map. this is second, third, fourth. These are Karnaugh map.

这里我们有1、2、3、4、5,一共五个。实际上有六个。四个。这是四个卡诺图。这是第二个、第三个、第四个。这些就是卡诺图。

And let's repeat the process here.

让我们在这里重复一下这个过程。

For the first Karnaugh map, we have two variables.

对于第一个卡诺图,我们有两个变量。

We have two variables. So how many cells do we have?

就是两个变量。那么,我们有多少个单元格呢?

How many cells? One square is one cell. So for two variables,

多少个单元格?一个正方形就是一个单元格。所以对于两个变量来说,

two input variables.

就是两个输入变量。

we have four cells.

我们有四个单元格。

Four input variables.

四个输入变量。

We have four cells in the Karnaugh map.

卡诺图中有四个单元格。

The form of the Karnaugh map is like this. A could be 0 or 1. B could be also 0 or 1.

卡诺图的形式是这样的。A可以是0或1。B也可以是0或1。

So we have four outputs, right? Can you know what is the logic here? If you use the AND logical, it should be 0. and this should be 0 as well. But if you use the OR logic,

所以我们有四个输出,对吧?你能看出这里的逻辑是什么吗?如果你用与逻辑,结果应该是0。这里也应该是0。但是,如果你用或逻辑,

it's 1. so the output is unclear. until you specify

结果就是1。所以输出是不确定的。除非你明确指定,

until you specify the function.

也就是指定函数。

So here the cell is empty. This small number, 0, 1, 2, 3. are just the address.

所以这里的单元格是空的。这个小数字,0和1,分别是2和3。只是地址而已。

If you remember the computer system, everything has an address. right? For example, this address one. two, three, four. And for the address zero could be 100. It's saved in address zero. could be 200. It's saved in address one. So the index, the small number, are the address. it's not the output. The actual output is dependent on the function. If it's another function, you will get zero. If it's the or function, you will get a zero and a one. So here, the cell is empty.

如果你还记得计算机系统的知识,那么一切都有地址。对吧?比如,这个地址1。2、3、4。而地址0可能是100。它存储在地址0里。也可能是200。它存储在地址1里。所以,这个索引,也就是那个小数字,就是地址。它不是输出结果。实际的输出取决于函数。如果是另一个函数,你会得到0。如果是或函数,你会得到0和1。所以在这里,这个单元格是空的。

Is it clear? until now?

清楚了吗?到现在为止?

So for two variables, two input variables, we have four cells. And for four input variables,

那么,对于两个变量,也就是两个输入变量,我们有四个单元格。而对于四个输入变量,

we have 16.

就有16个。

For example, for this one, we have 16.

例如,对于这个,就有16个。

And if we have three input variables,

如果有三个输入变量,

it's eight.

那就是8个。

eight cells.

八个单元格。

So we can know the number of cells, is the power of the number of the input.

所以,我们可以知道单元格的数量,等于输入数量的幂。

And n is the number of the input variables.

这里的n就是输入变量的数量。

The power of n, you will get the number of cells.

n的幂,就是单元格的数量。

So this is the reason let's go back to the previous description. Okay, if you have four input variables, we have 16.

所以,这就是原因,让我们回到之前的描述。好的,如果你有四个输入变量,就有16个。

two to the power of four, you will get 16.

2的4次方,结果就是16。

It's very easy. to draw the Karnaugh map. like the last slide has showed. you have this D, A for example. these are two, four variables. And for this one, could be 00, 01, 10, 11. just similar here. you can draw the Karnaugh map. no problem. But if you have five, input variables,

这非常简单。绘制卡诺图。就像上一张幻灯片展示的那样。比如,你有这个D和A。这是两个,也就是四个变量。对于这个,可能是00、01、10、11。这里也是一样的。你可以绘制卡诺图。没问题。但是,如果你有五个变量,也就是五个输入变量,

if you have five input variables, you will get 6.

那么,就会得到6个。

62. Okay, if you still draw the Karnaugh map, it could be a little bit difficult.

62个。好的,如果你仍然要画卡诺图,可能会有点困难。

okay, yeah, you have 62.

好的,是的,你有62个。

that's a very big, very map. and if you have six,

这是一个非常大的,非常大的图。如果你有六个变量,

six input variables, it will be 64.

也就是六个输入变量,那就是64个。

that's even bigger. so depend on how many input variables you have,

那就更大了。所以,这取决于你有多少个输入变量。

and the size of the Karnaugh map also varies. that's the reason if you have too many input variables, the map is too complex and too too larger.

而卡诺图的大小也会随之变化。这就是为什么,如果你有太多的输入变量,这个图就会变得过于复杂,而且太大。

and here the sentence, if you have five or six variables, you might have to draw the three-dimensional map.

这里有一句话:如果你有五六个变量,你可能就得画一个三维的图了。

so this is a two-dimensional. if you have six variables, there's another direction, vertical direction, you have to draw 3d. you have a, b, c, d, and e, f.

所以,这是一个二维的图。如果你有六个变量,就需要增加一个方向,也就是垂直方向,就得画三维的图了。这里有a、b、c、d,还有e和f。

so the combination is six before, for example, if you have six variables. that could be a very large

所以组合数是6取4。举个例子,就是有六个变量的时候。那就会变得非常大。

and four variables, you have 16. Three variables, you have 8.

如果有四个变量,就有16种组合;三个变量,就有8种组合。

and importantly,

重要的是,

for the variables,

对于这些变量来说,

for example, a, could be zero, and one. b could also be zero and one. and it's more number. this small number is expressed by gray code.

比如a,可以是0,也可以是1。b同样也可以是0或1。而且还有更多的数字。这个较小的数字是用格雷码来表示的。

so we know the biggest property of gray code is that

所以我们知道,最大的特点是格雷码的最大特性是,

every adjacent number only one bit is changed.

每两个相邻的数字只有一位发生变化。

for gray code, the biggest advantage is that for two adjacent number, only one bit is changed.

对于格雷码来说,最大的优势就是对于两个相邻的数字,只有一位会改变。

here only zero is changed to one. and here is only zero changed to one.

在这里,只有0变成了1。而这里也是只有0变成了1。

it's the biggest property. so here you can see for three variables, for the a b, we have 0 0, 0 1. 1 1 and 1 0.

这就是它最大的特性。所以在这里,你可以看到对于三个变量来说,对于a和b,我们有00和01。还有11和10。

because if you use the decimal system, this is 0 1, and if it's false, this is 2. we do not use 1 0 to

因为如果你用十进制系统,这是01,如果是假的话,这就是2。我们不会用10来表示。

we do not use it. we use the gray code system. to make sure only one bit for two adjacent number, only one bit is changed.

我们不这么用。我们使用的是格雷码系统。这样做的目的是确保只有一位发生变化。对于两个相邻的数字,只有一位会改变。

so here you have 0 0, 0 1, 1 1, 1 0. and the small number is the address.

所以这里就是00、01、11、10。而较小的那个数字就是地址。

address is expressed by decimal number. so it is three.

地址是用十进制表示的。所以这里是3。

and if you combine,

如果你把它们组合起来,

c b a trigger is 1 1 0. 1 1 0 is 10.

CBA触发器的编码就是110。110等于10。

here we have c b a. let's just draw the table together. so every variables can be 0 and 1, right? and for b a can be 0 0.

这里我们有CBA。让我们一起画出这个表格。所以每个变量都可以是0或1,对吧?而BA可以是00。

so the right number

所以正确的数字

here in gray code. only one bit can be changed.

就在这里,也就是格雷码中的这个数。只有一位会发生变化。

1 1 1 0.

1110。

and for c can also be 0 and 1, right?

而C也可以是0或1,对吧?

and then we compute the address, exact address. so we combine them together. c b a is here is 0 0 0.

然后我们计算地址,也就是确切的地址。所以我们把它们组合在一起。CBA在这里是000。

here is 0 0 1.

这里是001。

0 1 1.

011。

0 1 0.

010。

yes 1 1 1.

对,111。

0 0 1. 1 1 1, 1 1 0.

001。111,110。

okay.

好的。

but we don't know the output. the output is here empty. depending on what kind of function you apply. it's just the address. so if you know the address, you can obtain the number. based on the address. But the number is the value here is still unknown. because we haven't defined the function.

但是我们不知道输出结果。这里输出是空的。这取决于你应用的是什么函数。这只是一个地址。所以,如果你知道地址,就能得到对应的数值。基于地址。但这里的数值仍然是未知的。因为我们还没有定义这个函数。

and each cell correspond to one state.

每个单元格都对应一个状态。

from the function's truth table. so this is one cell, right? one cell in the karnaugh map.

来自函数的真值表。所以,这是一个单元格,对吧?卡诺图中的一个单元格。

represents one row. one row in the truth table.

代表一行。真值表中的一行。

if you have a truth table, you have a, b, c here, right? and then here is the output.

如果你有一个真值表,这里就有a、b、c,对吧?而这里是输出结果。

for this one, for example, you have a, zero b, zero c, zero. and you have the output.

比如这个,你有a、0、b、0、c、0。然后你有输出结果。

depending on what function you apply. what logical symbols or logical gates you have applied.

这取决于你应用的是什么函数。也就是你使用了哪些逻辑符号或逻辑门。

in the karnaugh map. so this cell, one cell represents one row.

在卡诺图中。所以这个单元格,代表一行。

because here you have b zero, a zero and c zero. and you have an output here. So one cell in the karnaugh map, represents one row.

因为这里对应的是b为0,a为0,c也为0。而这里的输出是这里。所以,卡诺图中的一个单元格,就代表真值表中的一行。

one row in the truth table.

也就是真值表中的一行。

So one cell in the karnaugh map represent one row of the truth table.

因此,卡诺图中的一个单元格,代表真值表中的一行。

And each of the cells, correspond to one minterm. so what is the definition of minterm? the minterm is defined as the anding of one combinations of all the inputs.

而每一个单元格,都对应一个最小项。那么,最小项的定义是什么呢?最小项的定义是:所有输入变量的一个组合经过“与”运算的结果。

of a function.

也就是一个函数的最小项。

Each of the cells, this is one cell. every cell correspond to one minterm. So this is one minterm. this is another one.

每一个单元格,这就是一个单元格。每个单元格都对应一个最小项。所以,这就是一个最小项。这是另一个。

this is another minterm. One minterm is the and function.

这也是一个最小项。最小项就是“与”运算。

of all the input variables. So, for example, this is minterm. Let's call it m. The first one is m1. This one is m2.

对所有输入变量进行的“与”运算。所以,举个例子,这就是一个最小项,我们把它称为m。第一个是m1,这个是m2。

and the minterm is defined as

最小项的定义是:

the anding of all variables.

所有变量的“与”运算。

Because we know here is c is zero, so it's c not.

因为我们知道这里的c是0,所以就是c的非。

b zero. a zero. and then you and them together.

b是0。a是0。然后把它们“与”起来。

So this is one minterm. and for the second minterm, m2.

所以,这就是一个最小项。至于第二个最小项,就是m2。

this is m1 minterm, this is m2 minterm. second one is you have c zero, right?

这是m1最小项,这是m2最小项。第二个是c为0,对吧?

and you have b zero. you have a

还有b为0。a是

one. this is another minterm. defined as minterm.

1。这是另一个最小项。它的定义就是最小项。

Is it clear? Yes.

清楚了吗?是的。

Any questions?

还有问题吗?

Okay. If there's no questions,

好的。如果没有问题的话,

let's just do

我们就直接做

the exercise.

练习吧。

you have to draw the karnaugh map.

你需要画出卡诺图。

here i would like to explain what g equals to one, two, three mean.

在这里,我想解释一下g等于1、2、3是什么意思。

which means g you can use different variables. when you compare these two, for example, sometimes people use c. sometimes people use f. which means g one, two, three or f zero, five, six. these one, two, three are the small number. it's the address.

也就是说,g可以使用不同的变量。当你比较这两个的时候,比如,有时候人们会用c。有时候会用f。这意味着g是1、2、3,或者f是0、5、6。这些1、2、3是较小的数字。它们是地址。

of the cell. so for example, for one, two, three, this is zero, right? This is one. which means in this cell,

是单元的地址。所以,举个例子,对于1、2、3,这是0,对吧?这是1。这意味着,在这个单元里,

the output is one.

输出是1。

and for the address two,

而对于地址2,

this is also has output of one. so the question is,

这也是输出为1。那么问题来了,

given this information, we have to draw the Karnaugh map. this also the output identified.

根据这些信息,我们需要画出卡诺图。这也是已确定的输出。

because the question has already gives you if the index is one, two and three. the output is one. and for the remain is zero. only these three, these three are minterm. For minterm one, two, three, the output is one. and for the remain is zero.

因为题目已经给出了如果索引是1,那就是2和3。输出就是1。其余的都是0。只有这三个是最小项。对于最小项1、2、3,输出都是1。其余的都是0。

so how can we draw the karnaugh map?

那么,我们如何绘制卡诺图呢?

let's have a look at the

让我们来看一下

maybe you better understanding.

这样你可能会更容易理解。

if you have two variables a, b, a could be zero, a could be one. b could be zero, could be one. and the small number is the address. you have 00, 01. 10, 11. it's the index.

如果有两个变量A和B,A可以是0,也可以是1。B可以是0,也可以是1。而这里的数字就是地址。有00、01。还有10、11。这就是索引。

and this index is also the minterm. so this equation means if a minterm is one, two, three, you have output one. and for the remaining is zero.

这个索引同时也是最小项。所以这个式子的意思是,如果最小项为1,也就是2和3,那么输出就是1。其余的都是0。

so this is the karnaugh map.

所以,这就是卡诺图。

this is the karnaugh map for this question. and similarly, you can have k c b a. let's do it together. let's do the second exercise together.

这就是这个问题的卡诺图。同样地,你也可以画出k c b a的卡诺图。我们一起来做吧。我们来做第二个练习。

you have four variables, one, you have d, c, and b, a.

这里有四个变量,分别是1、d、c、b和a。

b a could be zero zero. zero one. should be one one. remember, one one here. not zero one.

b a可以是00。也可以是01。应该是11。记住,这里是11。不是01。

because these are gray codes.

因为这些都是格雷码。

zero zero, zero one, one one. one zero. okay, let's compute the index. zero. this is one.

00、01、11。10。好的,我们来计算一下索引。0。这是1。

these are not the output. just the address. and zero zero, one one. zero zero one one is three.

这些不是输出。只是地址。还有00,11。0011是3。

zero zero one zero, two.

0010是2。

zero one zero zero. it's seven.

0100。是7。

zero one zero one, five.

0101是5。

one one.

11。

what is it?

那是什么?

seven.

7。

six.

6。

one one zero.

110。

four.

4。

one zero. thirteen.

10。13。

one one one one.

1111。

fifteen.

15。

thirteen, right?

13,对吧?

one one one zero.

1110。

fourteen.

14。

zero zero zero.

000。

eight.

8。

eleven.

11。

okay, these are the index. and the question already gives you if the index is zero,

好的,这些就是索引。题目已经给出了如果索引是0,

if the index is five. you will get one. mean one as output. so zero, you get one. Five, this is five. The index is five. you get one output.

如果索引是5。你会得到1。也就是说,输出是1。所以,0的时候得到1。5的时候,这里是5,索引是5。也会得到1的输出。

if six, eight.

如果是6,是8。

twelve.

12。

thirteen.

13。

now the remaining cells are zero.

现在,剩下的单元格都是0。

because only this mean turn.

因为只有这一项等于10。

or one. then we have successfully created the kernel map. for four variables. d c b a.

或者等于1。这样,我们就成功地创建了一个核映射。用于四个变量。分别是d、c、b、a。

any questions?

有什么问题吗?

any questions?

还有问题吗?

we still have five minutes.

我们还有五分钟。

if there's no problems, let's continue. exercise two.

如果没有问题的话,我们继续。练习二。

i would like to do it with you.

我想和大家一起做。

remember,

记住,

this term is exactly one mean term, right? all the variables are undig. together.

这一项正好是一个最小项,对吧?所有的变量都出现了。一起出现了。

here we use a different expression. we do not give you c.

这里我们使用了一种不同的表达式。我们没有使用C。

what does it mean? for the index, and then the other thing is what? instead, use the min terms.

那是什么意思呢?对于索引来说,还有另外一点是什么?相反,我们使用最小项。

which means this interm, when you put the for the tables, the the comma.

这意味着,当把这个最小项填入表格中时,就是那个逗号。

this interm, output is one.

对于这个最小项,输出是1。

so we have a different expression of the min term.

所以我们有了最小项的一种不同表达方式。

the min term, as I said, is the min, for example, for a,

正如我之前所说,最小项就是最小项。比如,对于A来说,

b not c not d not. when you draw the table like this,

就是B非C非D非。当你像这样画出表格时,

what is for this min term?

这个最小项是什么?

what is the corresponding cell?

对应的单元格是什么?

a is true here.

这里A是1。

b is zero here.

B是0。

c is zero.

C也是0。

one.

所以是1。

this is the correct cell.

好的,这就是正确的单元格。

and this is one min term. so we plot one here. similarly for the other terms.

这是一个最小项。所以我们在这里标上1。其他项也是如此。

okay, let's have a look at the solution.

好的,我们来看一下答案。

so if you draw the table b c d a, and this is the gray code. and you combine b c d a here. get the index. address. one two three, zero one three two.

那么,如果我们画出BCDA的真值表,这就是格雷码。然后在这里进行组合。得到索引。也就是地址。1、2、3,不对,是0、1、3、2。

and for each term,

对于每一项,

for example, for a not c not d not, let's look at where is the a not.

比如对于A非C非D非,我们来看看A非在哪里。

a not, d not. let's look at. a is one. b is one, so it will be this column. a is one, b is one. c zero. d zero.

A非,D非。我们来看一下。A是1。B也是1,所以就是这一列。A是1,B是1。C是0。D是0。

okay, this position. right?

好的,就是这个位置。对吧?

this is one here.

这里是1。

so you have one here.

所以这里有一个1。

the corresponding position for each term.

这是每个项对应的位。

find the corresponding position. The corresponding is there.

找到对应的位置。对应的就在这里。

and write one as the output.

然后把1作为输出写出来。

make it a karnaugh map.

这样就形成了一个卡诺图。

yes. for sure, you can also write a b, c d, no problem. not a problem at all.

是的。当然,你也可以写成A B、C D,没问题。完全没问题。

and here is a different example. it gives you the truth table. right? you have the input for each variables. a b c d. and its outputs.

好的,现在这是一个不同的例子。它给出了真值表。对吧?这里有每个变量的输入。A、B、C、D。还有它的输出。

output is also given. And based on the truth table, i can be draw the corresponding karnaugh map.

输出也已经给出了。根据这个真值表,我可以画出对应的卡诺图。

as i said before, one cell. one cell is one row.

正如我之前所说,每个格子代表一项。一个格子就是一行。

one cell of the karnaugh map is one row. of the truth table.

卡诺图中的每一个格子都对应一行。对应真值表中的一行。

so based on the truth table, how can we draw?

那么,根据真值表,我们该如何绘制呢?

the corresponding karnaugh map.

画出对应的卡诺图。

let's take the last row. as an example. the last row is a1 b1 c1 d1. okay, let's find.

我们来先看最后一行。举个例子。最后一行是A1、B1、C1、D1。好的,我们来找一下。

a1 b1 is here.

A1和B1在这里。

and c1 d1 is here. okay, what is the output? the output is zero. then should be zero here.

C1和D1在这里。那么,输出是什么?输出是零。所以这里应该填零。

similarly for the other rows.

其他行也是如此。

let's take for example the second row. the second row is 0 0. a0 b0 c0 d is 1.

比如,我们来看第二行。这一行是0和0。A0、B0、C0,而D是1。

this is the position, right? this is the second row. the output is 1. you drag 1 here.

这就是对应的位置,对吧?这是第二行。输出结果是1。所以这里填1。

just iterate the process until all the 16. all the 16 rows are finished.

接下来就是重复这个过程,直到16个都处理完。也就是所有的16行都完成了。

and finally you will get the karnaugh map.

最后,你就会得到卡诺图。

based on the truth table.

它是根据真值表生成的。

now is the most important part. once we have the karnaugh map, how do we do the simplification? For example, here is a very long equation, right? if we follow what we have learned in lecture two, we have to use the three laws.

现在是最重要的一部分了。一旦我们有了卡诺图,我们该如何进行化简呢?举个例子,这里有一个非常长的表达式,对吧?如果我们按照第二讲中学到的方法,就必须使用那三条定律。

the distributive law, or the associative law. So we use the three laws to simplify the equation. But now we have the karnaugh map. We have a different way. to simplify.

也就是分配律,或者结合律。所以,我们用这三条定律来化简这个表达式。但是现在我们有了卡诺图,就有了一种不同的方法。来进行化简。

and how can we simplify?

那么,我们该如何化简呢?

These are the rules. You should follow the rules. and simplify a very complex and long equation.

这些就是规则。你应该遵循这些规则。然后用它们来化简一个非常复杂且长的表达式。

The first rule is

第一条规则是:

we should group.

我们应该进行分组。

group the ones. group ones together.

把那些1分组。把1放在一起。

We should group adjacent cells.

我们应该对相邻的单元格进行分组。

and each containing a one.

而且每个组里都必须包含1。

The adjacent cells is 2 the power of n. So it should be either a square. Square is four, right?

相邻的单元格数量是2的n次方。所以,它应该是一个正方形。正方形是四个,对吧?

or it should be a rectangle.

或者它应该是一个长方形。

including four cells.

同样包含四个单元格。

Because it should always include all four.

因为必须始终包含全部四个。

You cannot only include three cells. For example, if you group them together, that is wrong.

你不能只包含三个单元格。例如,如果你把它们 grouping 在一起,那就是错的。

because there are three cells.

因为那样只有三个单元格。

The number of cells should always be 2 the power of n.

单元格的数量必须始终是2的n次方。

and each should contain ones. For example, if you group these four together,

而且每个组里都必须包含1。比如,如果你把这四个 grouping 在一起,

even though it's four. you meet these requirements. but there's two zero here.

虽然数量是四个,也符合这些要求。但是这里有两个0。

and here we have zero, so it's not correct.

而这里有一个0,所以这是不对的。

So first we have a group.

所以,首先我们有一个组。

grouped cells.

就是 grouping 的单元格。

and each cell should have only one one.

而且每个组里只能有一个1。

and the group should be as larger as possible.

而且,这个组应该尽可能大。

The larger you group, the simpler the expression you will get.

分组越大,得到的表达式就越简单。

let's take an example. So if you have four one here, you group them together.

我们举个例子。如果这里有四个1,就把它们 grouping 在一起。

right? They are four cells, meet this requirement. and they are always one. But if you just group for example this one,

对吧?这里有四个单元格,符合这个条件。而且它们都是1。但是,如果你只是 grouping比如这一个,

and group this one, we have two groups. group this one, group this one, group this one, four groups. doesn't simplify the equation. But if you use a big group,

再 grouping 这一个,那就变成了两个组。 grouping 这一个,再 grouping 这一个,一共就是四个组。这样并没有简化表达式。但如果你使用更大的分组,

it has significantly simplified the equation.

就能显著简化表达式。

So please use the larger groups.

所以,请大家尽量使用更大的分组。

which can significantly simplify the expressions.

这样可以大大简化表达式。

The larger the group you chosen, the simpler the function.

你选择的分组越大,函数就越简单。

with each increased power of two in the size of the group, and the group becomes dependent on one less variable.

每当分组的大小增加一倍(即2的幂次方)时,那么该分组所依赖的变量就会减少一个。

So if you include one more cells, you will have one less variable. That is exactly what we want.

所以,如果你多包含一个单元格,变量就会少一个。这正是我们想要的结果。

We want to simplify and reduce the number of the variables.

我们希望简化表达式,并减少变量的数量。

and so the minimal form is obtained with the largest possible group. that are integer power of two.

因此,最简形式就是通过尽可能大的分组来得到的。这些分组的大小必须是2的整数次方。

It's always the power of two, the form of the group.

分组的形式总是2的幂。

And all the cells in the group should be one.

而且,组内的所有单元格都应该是1。

And one should be included at least one group. Which means if you have a group here, and this one is grouped. in this big group. But it can also be included in another group.

并且,每个1都必须至少被包含在一个组中。这意味着,如果你在这里有一个组,那么这个1也必须被分组。在这个大组里。但它也可以被包含在另一个组中。

So for these two group, they are overlapped.

所以,对于这两个组来说,它们是重叠的。

They are overlapped here.

就在这里重叠了。

All the cells containing a one, must be included. in at least one group. So all the ones should be included in a group.

所有包含1的单元格,都必须被包含在内。至少要属于一个组。所以,所有的1都必须被包含在某个组里。

at least for once.

至少一次。

The groups may overlap.

这些组可以重叠。

because all the ones can be included at least in one group. So the group can be overlapped. So one cell may be included in several groups. This cell is included in this group. And this cell is also included in this group.

因为所有的1都必须至少被包含在一个组中。所以,组之间可以重叠。因此,一个单元格可以属于多个组。这个单元格就包含在这个组里。而这个单元格也包含在这个组里。

But any group that has all its elements included, in other group, is not required.

但是,只要一个组的所有元素都被包含在内,就不需要再出现在其他组里了。

This sentence means if you

这句话的意思是,如果你

for example, you have 4, 1 here. and you can group these two ones. So one cell may be included in several groups. But any group that has all its elements included in other group is not required. Because all its elements is included in the big one. So small one is unnecessary because all elements in this small group are included in the big one.

举个例子,这里有一个4和1。你可以把这两个1归为一组。所以,一个单元格可以属于多个组。但是,如果某个组的所有元素都已经包含在其他组里了,那么这个组就是多余的,不需要保留。因为它的所有元素都已经包含在那个大的组里了。所以,这个小组是不必要的,因为这个小组里的所有元素都已经包含在大的组里了。

So any group that has all its elements, this group has all its elements, are included in other groups, is not required.

所以,任何一组,只要它的所有元素,比如这个组的所有元素,都已经包含在其他组里了,那么这个组就是多余的,不需要。

it's included in the big group, it's not required. they can be overlapped. but they cannot be completely overlapped. So this is called completely overlapped. One small group is totally inside. of a larger group. This is completely overlapped. But it can be some kind of overlap. This small arrow is overlap. That's fine. But not be completely, totally overlapped.

它已经被包含在大组里了,所以不需要。它们是可以重叠的。但是,它们不能完全重叠。所以,这就叫做完全重叠。一个小组完全包含在另一个小组里面。也就是完全重叠。但也有其他形式的重叠。这个小箭头就代表重叠。这样是可以的。但不能是完全、彻底的重叠。

And there may be several correct minimal forms for a given logic function. This is very important. That's the reason why we have different solutions. for the exercise two, right? If you do the simplification, everybody will get different solutions. That's the reason. There are several correct minimal forms for a given logic function.

对于一个给定的逻辑函数,可能存在多种正确的最简形式。这一点非常重要。这就是为什么我们会得到不同的解法。就像练习二那样,对吧?如果你进行化简,每个人得到的结果都会不一样。这就是原因。对于一个给定的逻辑函数,存在多种正确的最简形式。

If the logic function is given, if you do the simplification, there are several different correct solutions.

如果逻辑函数已经给出,那么进行化简后,会有几种不同的正确解法。

depending on how do you group.

这取决于你如何进行分组。

Okay, the last point is also very important. The edges of a Karnaugh map. are adjacent to each other.

好的,最后一点也非常重要。卡诺图的边界。是相互相邻的。

Which means when we group the cells, the cells should be adjacent, right? This sentence means this one. It's also adjacent to this one. They are at the edge. They are at the edge of the Karnaugh map.

这意味着,我们在对单元格进行分组时,这些单元格必须是相邻的,对吧?这句话的意思就是这个。它也和这个是相邻的。它们位于边缘。它们位于卡诺图的边缘。

Because when you compare the gray code, when you compare the gray code, only one bit is changed. so they are also adjacent.

因为当你比较格雷码时,格雷码之间只有一位不同。其他位都保持不变。所以它们也是相邻的。

It's very important. So even though these two cells, one is at the bottom left, one is at the bottom right, but they are still adjacent.

这一点非常重要。所以,即使这两个单元格,一个在左下角,另一个在右下角,但它们仍然是相邻的。

So when you do the group, these two can also be grouped together. And similarly, this one, can also be grouped.

所以在进行分组时,这两个也可以归为一组。同样地,这个,也可以分组。

It's this one. One is bottom, one is at the top. You can also group them together. if both output are ones. because when you compare the gray code, 1001, 001, only one bit is changed. they are also adjacent.

就是这个。一个在下面,一个在上面。你也可以把它们放在一起分组。如果它们的输出都是1的话。因为当你比较格雷码时,1001和001,只有一位发生了变化。所以它们也是相邻的。

This is the property of gray code.

这就是格雷码的特性。

every adjacent number, only one bit is changed.

每一个相邻的数字,只有一位发生了变化。

yeah, so that's the meaning of the last sentence.

是的,这就是最后一句话的意思。

Great.

很好。

and we can take a break time.

我们可以休息一下了。

any questions?

有什么问题吗?

what's the function of grouping them?

把它们分组的作用是什么?

what is the function of the group?

这个组的功能是什么?

the main reason that we want to group

我们想要分组的主要原因,

is to simplify the expressions.

是为了简化表达式。

the main reason that we want to group, for example, these four cells together,

比如,我们把这四个单元格放在一起分组,主要原因就是

is to do simplification. because you just use one group. to represent four cells. so if you write the equation like this, the corresponding terms for this one is

为了进行简化。因为这样只需要用一个组。来代表四个单元格。所以,如果你这样写方程,那么对应的项就是

a is one. b is zero.

a等于1。b等于0。

c is one, d is zero. We have four terms plus together.

c等于1,d等于0。我们有四项,把它们加在一起。

If you group them together,

如果你把它们分组,

you can just use one term. so these four terms can be simplified. simplified by one, just one terms.

就可以只用一项来表示。所以这四个项就可以简化了。简化成一项,就只剩下一项了。

So the reason we want to group is that we want to do the simplification.

所以我们想要分组的原因,就是为了进行简化。

All the four terms in each cell, can be replaced by one term.

每个单元格里的这四个项,都可以用一个项来代替。

it should be always the power of two.

而且它应该总是2的幂次。

the number of cells should always be the power of two.

单元格的数量也应该是2的幂次。

Okay, any questions? otherwise, let's see each other in the evening.

好的,有什么问题吗?如果没有的话,我们晚上见。

课堂最终稿

And then we have three different laws: the commutative laws, associative laws, and distributive laws. For the commutative law, you can just switch the positions of variables. For the associative law, you can combine…

然后我们有三种不同的定律:交换律、结合律和分配律。对于交换律,你可以直接交换变量的位置。对于结合律,你可以将……组合起来……

For two variables, I combine first the two variables or combine the second two variables. It makes no difference in what order the variables are grouped. You can group B, C first, or you can either group A, B first. So it doesn't matter. Third law is distributive law.

对于两个变量,我先合并前两个变量,或者先合并后两个变量,变量的分组顺序没有任何影响。你可以先对 B、C 进行分组,也可以先对 A、B 进行分组,结果都一样。第三条定律是分配律。

This law states that ORing several variables together and then ANDing the result with a single variable is equivalent to ANDing that single variable with each of the several variables individually and then ORing the results.

该定律指出:将多个变量进行OR运算后再与单个变量进行AND运算,等价将该单个变量分别与每个变量进行AND运算,再将结果进行OR运算。

Pay attention to the variables. De Morgan's theorem has two expressions. The first one is: you AND, then apply NOT. This is equivalent to applying NOT first for each variable, then OR them together.

注意变量。德摩根定理有两种表达式。第一种是:先做与运算,再取非。这等价于先对每个变量分别取非,再做或运算。

The second form of De Morgan's law: you apply the product first and then use the bar. This equals applying the bar for each variable and OR-ing them together. There are some exercises, and finally, we have learned how to simplify expressions based on De Morgan's law.

德摩根定律的第二种形式:先对乘积整体取反,再使用非号。这等于对每个变量分别取非,然后将它们进行或运算。这里有一些练习题,最后我们已经学会了如何基于德摩根定律简化表达式。

We have learned the universal NAND gate. We can use the NAND gate to express all the remaining gates. And the universal NOR gate—we can also use it to express the remaining gates. In our last lecture, some students asked about this question: A is the input, B is the input. So if A's input is like this and B's input is like this, what is the output of X? This slide shows the solution. If A is like this, B's input is like this, what is the output of G?

我们已经学习了通用与非门。我们可以用与非门来表示所有其余的门电路。还有通用或非门——我们同样可以用它来表示其余的门电路。在上一次课中,有同学提出了这样一个问题:A是输入,B是输入。如果A的输入是这样的,B的输入是这样的,那么X的输出是什么?这张幻灯片展示了解法。如果A是这样的,B的输入是这样的,那么G的输出是什么?

G1, and one is the output of G2, and one is G3. The output is determined by the input and the logic of the circuit. The circuit can change the form of the input.

G1,一个是G2的输出,一个是G3。输出由输入和电路的逻辑决定。电路可以改变输入的形式。

The output is quite different from the input. A is like this, B is like this, but the output just looks very regular. It is quite different from A and B. So the logic circuit has the function of changing the form of the input. We will subsequently do some exercises.

输出与输入有很大不同。A是这样的,B是这样的,但输出看起来非常规则,与A和B截然不同。因此,逻辑电路具有改变输入形式的功能。我们随后会做一些练习。

We have completed questions one through six. For question seven, I would like to give you five minutes to solve it.

我们已经完成了第一题到第六题。第七题,我给大家五分钟时间来做。

[No intelligible lecture speech detected in this segment. Audio consists of ambient classroom noise: paper rustling, page turning, coughing, and student movement.]

[该时段未检测到可辨识的课堂讲授语音。音频内容为教室环境噪音:翻纸声、翻页声、咳嗽声及学生活动声。]

Before we proceed to Question 7, let us focus on parts B and C of Question 6. Some students are unclear about how to solve those parts. Question 6 is very similar to Question 7; you should only use "land" and "locate" to express the—

在进入第七题之前,我们先聚焦第六题的B和C部分。部分同学对如何解答这两部分不太清楚。第六题与第七题非常相似,你们只需要使用"land"和"locate"来表达——

To express an equation, we use the symbol λ. This is the basic form for lambda. You add an open bracket.

要表达一个方程,我们使用符号 λ。这是 lambda 的基本形式。你加上一个左括号。

This is exactly what we want. This is the NAND form of AND. And this is also the NAND form of NAND. But here there is an OR. So we should try to remove the OR. But how can we remove the OR? If you remember the De Morgan's theorem — De Morgan's theorem.

这正是我们想要的。这是与门的与非形式。这也是与非门的与非形式。但这里有一个或门,所以我们需要尝试去掉这个或门。那么如何去掉或门呢?如果你还记得德摩根定理——德摩根定理。

By applying De Morgan's theorem—right, this is De Morgan's theorem. Similarly, for this equation, we just put two NOTs. And for this part, we apply De Morgan's theorem. What do we get?

通过应用德摩根定理——对,这就是德摩根定理。类似地,对于这个等式,我们只需加上两个非号。而对于这一部分,我们应用德摩根定理,会得到什么?

This is the step from this to this one. Is this clear?

这就是从这一步到下一步的过程。清楚了吗?

This NOT we can simply remove, so it should be equivalent to AF. Now we should stop here — no further modification or revision, because it is already in the form of LAMS. You have AND, you have AND, and finally you have NOT. So let's plot.

这个 NOT 可以直接去掉,因此它等价于 AF。现在我们应该停在这里——不再做任何修改或修订,因为它已经是 LAMS 的形式了。你有 AND,有 AND,最后有 NOT。那么我们来画图。

Draw the logical symbols. We have A, B, C, D. D is negated, so we should first apply a NOT function to D and C.

画出逻辑符号。我们有 A、B、C、D。D 是取反的,所以我们应该先对 D 和 C 应用非门函数。

This C naught, D naught—this term is exactly lambda k, right? Lambda k. So we put them together. This is the first term. Now the second term: E naught. For E naught, we should also use a known function here. You will get E naught, and there is an f here.

这个 C 零、D 零——这一项恰好等于 lambda k,对吧?lambda k。所以我们将它们合在一起。这是第一项。接下来看第二项:E 零。对于 E 零,我们这里也应该使用一个已知函数。你会得到 E 零,这里还有一个 f。

D is not F. We create a branch from D. The branch must be placed before the log function, not after it. If you create a branch after the log function, you end up with not D instead of D. So D is not F, and three variables are added together, then the log is applied. This gives us a second candidate.

D 不是 F。我们从 D 创建一个分支。该分支必须放在对数函数之前,而非之后。如果在对数函数之后创建分支,得到的将是否定 D 而非 D。因此 D 不是 F,三个变量相加后再取对数,这就得到了第二个候选项。

This is the branch CAF. The search state will create a branch. This is A.

这是分支CAF。搜索状态将创建一个分支。这是A。

This is f. And these four terms—actually four terms, because this is af—they are added together and applied. This whole part is one gate. So the solution...

这是 f。这四项——实际上是四项,因为这里是 af——它们相加后一起应用。整个部分构成一个门。所以解法……

Please look at Section B. Is it clear? Now, for Section C: for this equation, we should first use the distributive law. If equals to—

请看B节。清楚了吗?现在来看C节:对于这个方程,我们应首先使用分配律。如果等于——

B, 4. This value is pretty high. Let me distribute further. When you use the distribution law, it should be like this.

B,4。这个值相当高。让我继续分布下去。当你使用分布律时,结果应该是这样的。

Look at this equation. Compare it with question B. They look very similar — just three terms added together. They have the identical form. So if you know how to solve question B, you should be able to solve this problem as well.

来看这个方程。将它与问题B进行比较。它们看起来非常相似——都是三项相加。它们具有完全相同的形式。因此,如果你知道如何求解问题B,那么你也应该能够解决这个问题。

Like this. And here we have A, we have B, we have C. First, we should use De Morgan's theorem. We put two NOTs above.

像这样。这里我们有A,有B,有C。首先,我们应该使用德摩根定理。我们在上方放两个非门。

And now you will get this form. If you apply De Morgan's theorem, you can get this form.

现在你会得到这个形式。如果应用德摩根定理,就可以得到这个形式。

Now, let's apply this. For this part, we first apply a NOT gate to get A-not. For A-not and B, this term is exactly a NAND gate, so we use one NAND gate. We have already completed this term. For this term, we already have A-not here, and C-not...

现在我们来应用这个。对于这一部分,我们首先施加一个非门得到A非。对于A非和B,这一项恰好是一个与非门,所以我们使用一个与非门。我们已经完成了这一项。对于这一项,我们这里已经有A非了,还有C非……

A naught, and it should have D. That is just the third round here. After this knot, because you use A naught here—this is A naught, this is C naught, this is D. And this term is another knot. For the third one, you have A naught, you have C naught.

A零,并且它应该含有D。这只是这里的第三轮。在这个节点之后,因为你在这里使用了A零——这是A零,这是C零,这是D。而这一项是另一个节点。对于第三项,你有A零,你有C零。

Here we have a branch: this is C₀, this is A₀, and we have E. Let us make another branch—A₀, C₀, E—that is the third branch. And finally, these three terms together constitute the B branch.

这里有一个分支:这是 C₀,这是 A₀,还有 E。我们再做一个分支——A₀、C₀、E——这是第三个分支。最后,这三项合在一起构成 B 分支。

The horse returns, a big line gate. Is it clear? Any questions? Go ahead.

马回来了,一道大门。清楚吗?有问题吗?请说。

Any questions? Any other questions? If there are no other questions, let's solve Problem 7. First is A, B, C. We have learned before—if we apply, for example, H...

有问题吗?还有其他问题吗?如果没有其他问题,我们来解第七题。首先是A、B、C。我们之前学过——如果我们应用,例如H……

If the input is the same, what is the output for the NAND gate? You get a NOT. Now, if you apply a NOT again using NAND, you get AND. Therefore, in order to obtain A AND B, you simply apply the NAND gate twice.

如果输入相同,NAND门的输出是什么?得到NOT。现在,如果用NAND再施加一次NOT,就得到AND。因此,要获得A与B,只需对NAND门使用两次即可。

The original variables. This is ABC, and here is also ABC.

原始变量。这里是ABC,这里也是ABC。

And then you apply the second function to the circle here. Then you finally get ABC as output. Is it clear? Any questions?

然后你对这里的圆应用第二个函数,最终得到 ABC 作为输出。清楚了吗?有问题吗?

No, you cannot just draw like this. If you draw like this, the expression is different. This is just A, B, C naught. What we actually want to input is the original number for twice.

不,你不能这样画。如果你这样画,表达式就不同了。这只是 A、B、C 零。我们实际要输入的是原始数字的两倍。

Student: Is there any difference? We should use gates to put A, B, C together. Teacher: This is also correct. This is ABC.

学生:有没有什么区别?我们应该用门电路把A、B、C组合在一起。教师:这也是正确的。这就是ABC。

If you apply one lattice, you will get ABC. If you use another lattice, you should also get ABC. This equals ABC. So you can also draw it like this.

如果你应用一个格,你会得到ABC。如果你使用另一个格,你也应该得到ABC。这等于ABC。所以你也可以这样画。

For simplification, we have already solved the second question — this is exactly the ABC and NOT second question. So let's skip B. Any questions about the first one?

为简化起见,我们已经解完了第二题——这正是关于ABC与NOT的第二题。所以我们跳过B部分。关于第一题有什么问题吗?

For question three, the answer is C. C is A or B. For the negation, we derive it from this form. The "or" is not what we want, so we apply De Morgan's theorem.

第三题的答案是C。C是A或B。对于否定形式,我们从这个式子推导。"或"不是我们想要的,因此我们应用德摩根定理。

But now, in this question, we cannot simply use NAND the same way. In Question 6, we can directly apply A to NAND and obtain A NOT. But here, we cannot get A NOT. So how can we use NAND to obtain the NOT function? We already know that NAND is a universal gate—it can be used to express all remaining gates. How can we get A NOT?

但是现在,在这道题中,我们不能像之前那样直接使用与非门。在第6题中,我们可以直接将A输入与非门得到A非。但在这里,我们无法直接得到A非。那么,我们如何使用与非门来获得非门功能呢?我们已经知道与非门是万能门——它可以用来表示所有其余的门电路。我们如何得到A非?

Just use a NAND gate itself. If you have two A's as input—the same input—you will get A naught. So for this question, in order to get A naught, first you have to apply...

直接使用一个与非门即可。如果将两个A作为输入——即相同的输入——你将得到A非。因此对于这道题,为了得到A非,首先你需要施加……

The first one — this is a₀. Similarly for b — this is b₀. And finally, these two terms give another result that I obtain.

第一个——这是 a₀。类似地,对于 b——这是 b₀。最后,这两项给出了我所得到的另一个结果。

Any questions? Yes, you can draw the logical circuit without simulation. It's okay. But in that case...

有什么问题吗?可以,你可以在不做仿真的情况下画出逻辑电路,这没问题。但在那种情况下……

Your logical circuit could be very complex. For C, similarly, C is very similar to B. You have A or B or C naught. Similarly, apply De Morgan's theorem.

你的逻辑电路可能非常复杂。对于C,类似地,C与B非常相似。你有A或B或C非。类似地,应用德摩根定理。

From Question 3, if we apply De Morgan's theorem, we can get from NAND gates. And we already know how to use a NAND gate to express NOT. Just use the same input, and you will get A NOT.

从第三题出发,如果我们应用德摩根定理,可以从与非门得到结果。我们已经知道如何用与非门来表示非门。只需将同一输入接入两个输入端,即可得到A的非。

For A, you use it twice as the input, and you get A naught. For B, you use the input twice, and you get B naught. For C, two loss functions can be removed, so you just get C. Then you combine them together—this is the big line again.

对于A,将其作为输入使用两次,得到A零。对于B,将输入使用两次,得到B零。对于C,两个损失函数可以被移除,所以直接得到C。然后将它们组合在一起——这就是那条大线。

Any questions? If you have questions, please raise your hand.

有问题吗?如果有问题,请举手。

For the lambda case, we do not like the "or." We should always try to remove the "or." Similarly, use De Morgan's theorem.

在 lambda 情形下,我们不希望出现"或"。我们应当始终尝试消除"或"。类似地,可以使用德摩根定理。

The moment sequence looks like this: it is just A, B, C, D. That is much simpler—just one gate. You have A, you have B, you have C, D—one gate.

这个时序序列看起来是这样的:它只是 A、B、C、D。这就简单多了——只有一个门。你有 A,你有 B,你有 C、D——一个门。

For Question A, we should first use the distributive law. You get AC or AD or BC or BD. This equation is very similar to Questions C and D; just apply the same process using De Morgan's laws.

对于问题A,我们应首先使用分配律。得到AC或AD或BC或BD。这个方程与问题C和问题D非常相似;只需应用相同的过程,使用德摩根定律即可。

AC times AB times BC. Right? Now I believe you can do it. This is exactly one lunch gate. This is another lunch gate. The third, the fourth, and the big one is the last lunch gate.

AC 乘以 AB 乘以 BC。对吧?现在我相信你们可以做到了。这正好是一个 lunch gate。这是另一个 lunch gate。第三个、第四个,而最大的那个是最后一个 lunch gate。

Let's solve the last one, G. G is a little bit complex, but just do the simplification first. I think we have solved C and the last one. We are on the last course, but we haven't finished it.

我们来解最后一题,G。G稍微复杂一些,但先做简化。我想我们已经解了C和最后一题。我们已经在最后一节课上了,但还没有完成。

Let us solve this together. AB remains unchanged. For this term, apply the distributive law. You will get C plus… over BCD. You will obtain an equation of this form.

我们一起来解这道题。AB保持不变。对于这一项,应用分配律,你会得到C加上……除以BCD,从而得到如下形式的方程。

We apply A, B, C, D, E. Here is something interesting.

我们应用 A、B、C、D、E。这里有一个有趣的内容。

You can already draw the circuit, but we can simplify it a little bit further. Here we can see there is a B. If we use Thévenin's theorem, we will get B and B₀. B and B₀ is also zero.

你已经可以画出这个电路了,但我们还可以进一步简化。这里可以看到有一个B。如果使用戴维南定理,我们会得到B和B₀。B和B₀也等于零。

Here is something interesting. This term—what is the output of this term? Zero. Yes, exactly. If you consider A and B together, it is just like A and A-not, which equals zero. So you can get A, B, C.

这里有一个有趣的地方。这一项的输出是什么?零。没错。如果你把 A 和 B 放在一起考虑,就相当于 A 与 A非,结果为零。因此你可以得到 A、B、C。

We can also stop here. This is exactly the second nth. What we want to do is remove O—just apply De Morgan's theorem. Just apply De Morgan's theorem, so you will get...

我们也可以在这里停下来。这恰好是第二个第n项。我们要做的就是去掉O——只需应用德摩根定理。只需应用德摩根定理,你就会得到……

You will get a form like this, and it should be equivalent to this form. Then we can draw the circuit. We have A, we have B, we have C.

你会得到这样一个形式,它应该与这个形式等价。然后我们可以画出电路。我们有A,有B,有C。

We have B and E. For this one, we apply another gate first. Another gate for C—this is D·E mod. This big term is another NAND gate. This circuit represents the first term here. And similarly…

我们有 B 和 E。对于这一项,我们先施加另一个门电路。C 对应的另一个门——这是 D·E mod。这个大项是另一个 NAND 门。这个电路表示这里的第一项。类似地……

For the second one, we have AB here already, and we have BCE. Let's make a branch at B. We have C, BC, and E. Apply a NAND gate here; you will get BC NOT. Then use another NAND gate with AB together.

对于第二个,我们这里已经有AB,还有BCE。在B处做一个分支,我们有C、BC和E。在此处应用一个与非门,得到BC的非。然后再用另一个与非门与AB结合。

This is B. Let's create another one. This is B. And we should have A. Let's create another one: A. A, B, B, C not. I am following these two terms.

这是B。再写一个。这是B。然后我们应该有A。再写一个:A。A,B,B、C没有。我在跟踪这两项。

This is also a lot of gates. Any questions? We have two minutes before the break.

这也是大量的门电路。有问题吗?我们还有两分钟就休息。

Right, let's have a break.

好,我们休息一下。

This is Lecture Three. Are there any problems with Lecture Two?

这是第三讲。大家对第二讲有什么问题吗?

Any problems? When you have a look at the slides, Lecture Two is actually quite simple. It only includes six logical symbols, three laws, two forms of De Morgan's theory, and two universal gates. That's all the content in Lecture Two.

有问题吗?大家看一下幻灯片,第二讲其实很简单。它只包含六个逻辑符号、三条定律、德摩根定律的两种形式以及两个通用门。这就是第二讲的全部内容。

That concludes Lecture Two. If there are no further questions, we will now begin Lecture Three. The main topic of Lecture Three is kernel maps. We will explain what a kernel map is. First, we want to understand: why do we need kernel maps? What is the purpose?

Lecture Two 的内容到此结束。如果没有其他问题,我们现在开始 Lecture Three。Lecture Three 的主要主题是核映射(kernel maps)。我们将解释什么是核映射。首先,我们要理解:为什么需要核映射?它的目的是什么?

The purpose of a Karnaugh map: when you look at an equation, you have to do a lot of simplification using Boolean algebra. But it can sometimes be quite difficult to manipulate, depending on how long the equation is. If the equation is long and has many variables, you may make mistakes during the simplification process. A Karnaugh map is exactly designed to address this problem. Instead of performing Boolean algebra simplification directly, we draw a Karnaugh map and use it to simplify the expression.

卡诺图的目的:当你面对一个逻辑方程时,需要进行大量的化简,而这通常要借助布尔代数。但布尔代数的操作有时相当困难,具体取决于方程的长度。如果方程很长且变量很多,在化简过程中就容易出错。卡诺图正是为了解决这一问题而设计的。我们不再直接用布尔代数进行化简,而是画出卡诺图,利用它来简化表达式。

Boolean algebra can sometimes be very tricky and difficult. It is often hard to tell whether a simplified expression has been found. The Karnaugh map is exactly proposed to address this problem—specifically, to address the first two problems. It is a method of rearranging truth tables. We already know what a truth table is. The Karnaugh map is a method of rearranging truth tables. Then the terms...

布尔代数有时非常棘手且困难。我们往往难以判断是否已经找到了最简表达式。卡诺图正是为解决这一问题而提出的,具体来说,是为了解决前两个问题。它是一种重排真值表的方法。我们已经知道什么是真值表。卡诺图就是一种重排真值表的方法。接下来是术语……

The next term can be simplified easily. It is a very powerful and widely used graphic method of logical simplification. The main purpose of the Karnaugh map is to simplify logical expressions. You do not have to go through the process we have written on the screen; instead, we use the Karnaugh map for the simplification.

下一项可以被轻松简化。卡诺图是一种非常强大且广泛使用的逻辑化简图形方法。卡诺图的主要目的是化简逻辑表达式。你不需要按照屏幕上写出的过程逐步操作,而是直接使用卡诺图来完成化简。

The Karnaugh map has several properties. First, it directly gives you the simplest sum-of-products form. Second, it allows expressions with up to four input variables to be handled in a straightforward manner.

卡诺图具有若干性质。第一,它能直接给出最简的积之和形式。第二,它允许以简便的方式处理最多四个输入变量的表达式。

I will explain the second point later. So why for four input variables it is very straightforward, and why for six input variables it can be a little bit difficult. Each cell in a Karnaugh map corresponds to one line in a truth table.

我稍后会解释第二点。为什么对于四个输入变量来说非常直观,而为什么对于六个输入变量来说会有些困难。卡诺图中的每个单元格对应真值表中的一行。

We will go through these three points later, because currently, if you do not understand how a Karnaugh map works, you may not fully understand what these three points mean. But no worries, we will go back and explain these three points later. And here is the process to create a Karnaugh map. First, you draw an empty Karnaugh map. Then you fill in the desired output corresponding to each input.

我们稍后会详细讲解这三个要点,因为目前如果你还不了解卡诺图的工作原理,可能无法完全理解这三个要点的含义。不过不用担心,我们之后会回来解释这三个要点。下面是创建卡诺图的步骤。首先,画一个空的卡诺图。然后,将与每个输入对应的期望输出填入图中。

To certain points, you form groups of adjacent cells containing 1s. Then you find an expression for each group, and you get the entire logical expression. Let's have an example. Here we have four Karnaugh maps. This is the first Karnaugh map, this is the second, third, fourth. These are Karnaugh maps.

对于某些点,你将包含1的相邻单元格组成组。然后为每个组求出一个表达式,从而得到整个逻辑表达式。我们来看一个例子。这里有四个卡诺图。这是第一个卡诺图,这是第二个、第三个、第四个。这些就是卡诺图。

Let's repeat the process here. For the first Karnaugh map, we have two variables. How many cells do we have? One square is one cell. So for two variables, two…

让我们在这里重复这个过程。对于第一个卡诺图,我们有两个变量。我们有多少个单元格?一个方格就是一个单元格。所以对于两个变量,两……

Four variables. We have four cells. Four inputs, variables. We have four cells in the Karnaugh map. The form of the Karnaugh map is like this: A could be 0 or 1, B could be also 0 or 1.

四个变量。我们有四个格子。四个输入,即变量。在卡诺图中有四个格子。卡诺图的形式如下:A 可以是 0 或 1,B 也可以是 0 或 1。

Four outputs. If you don't know what the logic is here—if you use AND logic, it should be zero, and this should be zero as well. But if you use OR logic, this is zero, this is one. So the output is unclear until you specify the function. Here the cell is empty. These small numbers—0, 1, 2, 3—are just addresses.

四个输出。如果你不知道这里的逻辑是什么——如果使用 AND 逻辑,结果应为零,这个也应为零。但如果使用 OR 逻辑,这个是零,这个是一。所以在指定函数之前,输出是不明确的。这里单元格为空。这些小数字——0、1、2、3——只是地址。

If you remember the computer system, every cell has an address, right? For example, address one, two, three, four. And for address zero, it could be one hundred, saved in address zero; two hundred, saved in address one. So the index, the small number of the address, is not the output. The actual output depends on the function. If it is the AND function, you will get zero, zero. If it is the OR function, you will get zero and one. So here, the cell is empty.

如果你还记得计算机系统的结构,每个单元都有一个地址,对吧?例如,地址一、二、三、四。对于地址零,它可能是一百,保存在地址零中;二百,保存在地址一中。所以索引,也就是地址的那个小数字,并不是输出。实际的输出取决于函数。如果是与函数,你将得到零、零。如果是或函数,你将得到零和一。所以这里,该单元是空的。

Is it clear until now? For two input variables, we have four states. For four input variables, we have...

到目前为止清楚吗?对于两个输入变量,我们有四种状态。对于四个输入变量,我们有……

For example, for this one we have sixteen cells. If we have three input variables, it's eight cells. So we can know that the number of cells is two raised to the power of the number of input variables.

例如,这个例子中有十六个单元格。如果我们有三个输入变量,就是八个单元格。因此我们可以知道,单元格的数量等于二的输入变量数次方。

n is the number of input variables. Two to the power of n gives the number of cells. So this is the reason—let's go back to the previous discussion. If you have four input variables, two to the power of four gives sixteen cells. It is very easy to draw a Karnaugh map. As the last slide showed, you have BC, BA—for example, these are four variables. And for this one, it could be 00, 01, 10, 11; it is similar here, 00. You can draw the Karnaugh map, no problem. But if you have five input variables, if you have five input variables...

n 是输入变量的个数。2 的 n 次方给出卡诺图的格子数。这就是原因——让我们回到之前的讨论。如果你有四个输入变量,2 的 4 次方等于 16 个格子。画卡诺图非常容易。正如上一张幻灯片所示,有 BC、BA——例如,这是四个变量。对于这个,可以是 00、01、10、11;这里也是类似的,00。你可以画出卡诺图,没有问题。但如果你有五个输入变量,如果你有五个输入变量……

With six input variables, you have sixty-four cells. If you see a drawn Karnaugh map with six variables, it could be very difficult. With thirty-two cells, that is already a very big map. And if you have six input variables, you have sixty-four cells — that is even bigger. So it depends on how many input variables you have.

六个输入变量对应六十四个单元格。如果你看到一个画出的六变量卡诺图,那会非常困难。三十二个单元格已经是一个很大的图了。而如果有六个输入变量,就有六十四个单元格,那就更大了。所以这取决于你有多少个输入变量。

The size of the Karnaugh map also varies. That is the reason: if you have too many input variables, the map is too complex and too large. If you have five or six variables, you will have to draw a three-dimensional map.

卡诺图的尺寸也会变化。这就是原因:如果输入变量太多,卡诺图就会过于复杂且过大。如果有五个或六个变量,你就必须绘制三维卡诺图。

Two-dimensional. If you have six variables, that is another direction, a vertical direction, you have to draw 3D. In 3D dimension, you have ABCD and EF. The total combination is 64. For example, if you have six variables, that could be very large. And four variables, you have 16. Three variables, you have 8.

二维的。如果你有六个变量,那就是另一个方向,一个垂直方向,你就需要画三维图。在三维空间中,你有ABCD和EF。总组合数是64。例如,如果你有六个变量,这个数可能非常大。四个变量,你有16种组合。三个变量,你有8种组合。

For the variables, for example, A could be 0 and 1, B could also be 0 and 1. This small number is expressed by Gray code.

对于变量,例如,A 可以取 0 和 1,B 也可以取 0 和 1。这个较小的数用格雷码来表示。

The biggest property of Gray codes is that for any two adjacent numbers, only one bit is changed. Here, only zero is changed to one, and here, only zero is changed to one.

格雷码最大的性质是:对于任意两个相邻的数,只有一个比特发生了变化。这里,只有零变成了一;这里,也只有零变成了一。

This is the text property for Gray codes. For three variables, for A and B, we have 000, 001, 011, 111, 110. We do not use 0 to 4 or 2 to 1; we do not use those. We use...

这是格雷码的文本性质。对于三个变量,对于A和B,我们有000、001、011、111、110。我们不使用0到4或2到1的转换;我们不使用这些。我们使用……

Gray code system. We use Gray code to ensure that for two adjacent numbers, only one bit is changed. Here you have 00011110. The small number is the address. The address is expressed by a decimal number—decimal, so this is three, two. If you combine...

格雷码系统。我们使用格雷码来确保对于两个相邻的数,只有一位发生变化。这里你有 00011110。较小的数是地址。地址用十进制数表示——十进制,所以这是三、二。如果你将……组合起来……

Here we have CBA—that is just the truth table together. Variable A can be zero or one, and BA can be zero zero. We should write the numbers here in Gray code. Only one bit can be changed. For instance, CBA is one one zero, and one one zero is ten. Then one one one, one one zero.

这里我们有CBA——这就是完整的真值表。变量A可以取零或一,BA可以取零零。我们应该用格雷码来书写这里的数值。相邻之间只能有一位发生变化。例如,CBA为一一零,一一零等于十。然后是一一一,一一零。

And for C, it can also be 0 or 1, right? And then we compute the address—it's like an address—so we combine them together. CPA here is 000, 001, 011, 010, 100, 101, 110, 111.

对于C,它也可以是0或1,对吧?然后我们计算地址——它就像一个地址——所以我们将它们组合在一起。这里的CPA是000、001、011、010、100、101、110、111。

We don't know the output. The output is still empty, depending on what kind of function you applied. This is just an address. If you know the address, you can obtain a number based on the address. But the value here is still unknown because we haven't defined a function.

我们不知道输出是什么。输出仍然是空的,取决于你应用了什么样的函数。这只是一个地址。如果你知道这个地址,就可以根据地址获取一个数值。但这里的值仍然是未知的,因为我们还没有定义函数。

Each cell corresponds to one state from a function's truth table. So this is one cell, right? One cell in the Karnaugh map represents one row in the truth table. If you have a truth table, you have eight...

每个单元格对应函数真值表中的一个状态。所以这是一个单元格,对吧?卡诺图中的一个单元格代表真值表中的一行。如果你有一个真值表,你有八个……

Here we have BC, and here is the output. For example, we have A0, B0, C0, and the output depends on what function—what logical symbols or logic gates—you have applied. In the Karnaugh map, this is one cell. One cell represents one row, because here you have B0, A0, and C0, and you have the output here. So one cell in the Karnaugh map represents one row in the truth…

这里是BC,这里是输出。例如,我们有A0、B0、C0,而输出取决于你所应用的函数——即你使用了哪些逻辑符号或逻辑门。在卡诺图中,这是一个单元格。一个单元格代表一行,因为这里有B0、A0和C0,并且这里有输出。所以卡诺图中的一个单元格代表真值表中的一行……

One cell in a Karnaugh map represents one row of the truth table. Each cell corresponds to one minterm. So what is the definition of a minterm? A minterm is defined as the ANDing of one combination of all the inputs of a function.

卡诺图中的每一个单元格代表真值表中的一行。每个单元格对应一个最小项。那么最小项的定义是什么?最小项定义为函数所有输入的一种组合的与运算。

Each cell here corresponds to one minterm. One minterm is the AND function of all the input variables. For example, let's call this minterm m₁, and this one m₂.

这里每个单元格对应一个最小项。一个最小项是所有输入变量的与函数。例如,我们将这个最小项记为 m₁,这个记为 m₂。

We find the ANDing of all variables. Because we notice C is zero, so this is C naught; B is zero, A is zero, and we AND them together. So this is one minterm. As for the second minterm, m₂—this is m₁ minterm, this is m₂ minterm. On the second line, you have C is zero, right, and you have...

我们求所有变量的与运算。由于注意到 C 为零,所以这里取 C 非;B 为零,A 为零,将它们相与。这就是一个最小项。至于第二个最小项 m₂——这是 m₁ 最小项,这是 m₂ 最小项。在第二行中,C 为零,对吧,然后你还有……

With B equal to zero and A equal to one, this is defined as a minterm. Is this clear? Any questions? If there are no questions…

当B等于零、A等于一时,这被定义为一个最小项。清楚吗?有问题吗?如果没有问题……

Next, just do the exercise. You have to draw the Karnaugh map. Here I would like to explain what g equals 1, 2, 3 means. Which means g—you can use different variables when you compare these two examples. Sometimes people use g, sometimes people use f, use h. Which means g(1, 2, 3) or f(0, 5, 6). These 1, 2, 3 are the small numbers; it's the address of the cell.

接下来,大家做一个练习,画出卡诺图。这里我想解释一下 g 等于 1、2、3 的含义。也就是说,g——你可以使用不同的变量来比较这两个例子。有时人们用 g,有时用 f,有时用 h。即 g(1, 2, 3) 或 f(0, 5, 6)。这里的 1、2、3 是小数字,代表的是单元格的地址。

For example, for one, two, three — this is zero, this is one. This means this is zero, this is here. The output is one. And for address two, this is address two, this also has an output of one. So the question is...

例如,对于一、二、三——这是零,这是一。这意味着这是零,这是这里。输出为一。而对于地址二,这是地址二,它的输出同样为一。那么问题是……

We have this information here. We have to draw the color map. This also outputs identified. Because the question has already given you: index is one, two, and three. The output is one, and for the remaining, it is zero. Only these three are mentioned. For the mentioned ones—one, two, three—the output is one; for the remaining, they are zero. How can we draw the...

我们这里有这些信息。我们需要绘制颜色映射图。这也输出了已识别的结果。因为题目已经给出了:索引为一、二、三。输出为一,其余为零。只有这三个被提及。对于被提及的一、二、三,输出为一;对于其余的,输出为零。我们该如何绘制……

If you have two variables, A and B. A could be zero, A could be one; B could be zero, B could be one. The small number is the address: 00, 01, 10, 11. This is the index, and this index is also the minterm.

如果你有两个变量,A 和 B。A 可以为零,A 可以为一;B 可以为零,B 可以为一。小数是地址:00、01、10、11。这就是索引,而这个索引也是最小项。

This equation means if the midterm is one, two, three, you have output of one, and for the remaining, it is zero. This is the Karnaugh map for this equation. And similarly, if you have DCBA, let's do the second exercise together. You have four variables. You have DC, you have BA.

这个方程的含义是:如果中间项为一、二、三,则输出为一;其余情况输出为零。这就是该方程对应的卡诺图。类似地,如果有DCBA,我们一起来做第二个练习。你有四个变量,有DC,有BA。

BA could be 00, 01. It should be 11. Remember, 11 here, not 01. Because we have—these are Gray codes: 00, 01, 11, 10. Let's compute the index. This is zero. This is one. These are not the output; just the address. And 0011 is three.

BA可以是00、01。应该是11。记住,这里是11,不是01。因为这些是格雷码:00、01、11、10。我们来计算索引。这是零。这是一。这些不是输出,只是地址。而0011等于三。

Zero zero one zero. Two. Zero one zero zero. Four. Zero one zero one. Five. One one one. Seven. One one zero. Six.

零零一零。二。零一零零。四。零一零一。五。一一一。七。一一零。六。

These are the indices. The question already gives you: if the index is zero—

这些就是索引。题目已经给出了条件:如果索引为零——

If the index is zero, you get one. If the index is five, you get one. f(6), f(8), f(12), f(13) — you get one for these as well. The remaining cells are zero because only these indices produce output.

如果索引为零,则输出为一。如果索引为五,则输出为一。f(6)、f(8)、f(12)、f(13) 同样输出为一。其余单元均为零,因为只有这些索引会产生输出。

We have successfully created a Karnaugh map for four variables D, C, B, A.

我们已经成功创建了四变量 D、C、B、A 的卡诺图。

Any questions? Let me check how much time we have. We still have thirty minutes. If there are no problems, let's continue. Exercise two.

有问题吗?让我看一下我们还有多少时间。我们还有三十分钟。如果没有问题,我们继续。练习二。

Remember, this term is exactly one mean term. All the variables are added together — this is one mean term.

请记住,这一项恰好是一个均值项。所有变量相加在一起——这就是一个均值项。

Here we use a different expression. We do not just give 1, 2, 3 for the index; instead, we use minterms. This means that when you put all four truth tables together, you can identify this minterm of this one, for this minterm of this one. So we have a different expression of the minterm.

这里我们使用一种不同的表达方式。我们不仅仅给出索引1、2、3,而是使用最小项。也就是说,当你把四个真值表放在一起时,你可以识别出这个最小项对应这个,那个最小项对应那个。因此,我们得到了最小项的一种不同表达式。

The minterm, as I said, is first of all for A, B not, C not, D not. When you draw the table like this, what is the corresponding cell for this minterm? A is true, A true here. B zero, B zero here.

正如我所说,这个最小项首先对应的是 A、B非、C非、D非。当你画出这样的表时,这个最小项对应的单元格是哪一个?A为真,A为真在这里。B为零,B为零在这里。

C is zero. The vector is [0, 0, 1]. This is correct. This is one Newton, so we plot one here. Similarly for the other terms.

C为零。向量为[0, 0, 1]。这是正确的。这是一牛顿,所以我们在此处标一。其余各项同理。

[No intelligible speech detected in this segment. The audio contains only ambient sounds such as footsteps, coughing, throat clearing, and rustling.]

[该片段未检测到可辨识的语音内容。音频仅包含脚步声、咳嗽声、清嗓子声和窸窣声等环境噪音。]

Let's have a look at the solution. If you draw table PCB A...

我们来看一下解答。如果你画出PCB A表……

This is the Gray code ordering. You combine these together with the index address following Gray code: 1000, 0100, 0110, 0010, 0011, 0001, 0101, 1101, 1100, 1110, 1010, 1011, 1001. For each term—for example, A′B′C′D′—let us look at where A′ and D′ are. A′, or base A, and D′, C′, D′—this one here, the value is 1. For the second term, ABC′D′: A is 1, B is 1, so it should be this column. C is 0, D is 0—this position.

这是格雷码排列。你将这些组合在一起,索引地址按格雷码顺序排列:1000、0100、0110、0010、0011、0001、0101、1101、1100、1110、1010、1011、1001。对于每一项——例如 A′B′C′D′——我们来看 A′ 和 D′ 所在的位置。A′,即基变量 A,以及 D′、C′、D′——就是这里,值为 1。对于第二项 ABC′D′:A 为 1,B 为 1,所以应该是这一列。C 为 0,D 为 0——就是这个位置。

This is one here. So you have one here. Similarly, for the remaining terms, just find the corresponding position for each term, and write 1 as the output. You will get the Karnaugh map. For sure, you can also write a, b, c, d — no problem at all.

这里是1。所以这里有一个1。类似地,对于其余各项,只需找到每一项对应的位置,并在输出处写1,即可得到卡诺图。当然,你也可以写成 a、b、c、d,完全没有问题。

Here is a different example. It gives you the truth table. This is the truth table. You have the input for each variable A, B, C, D, and the output is also given. Based on the truth table, I can draw the corresponding Karnaugh map.

这里是一个不同的例子。它给出了真值表。这就是真值表。每个变量 A、B、C、D 都有输入,输出也已给出。根据真值表,我可以画出对应的卡诺图。

As I said before, one cell of the Karnaugh map is one row of the truth table. Based on the truth table, how can we draw the corresponding Karnaugh map? Let's take the last row as an example. The last row is A1 B1 C1 D1. Let's find A1 B1 here.

如前所述,卡诺图的一个单元格对应真值表的一行。基于真值表,我们如何画出对应的卡诺图?以最后一行为例,最后一行是A1 B1 C1 D1。我们来找A1 B1的位置。

C equals 1, B equals 1, A equals 1 here. What is the output? The output is 0. Then it should be 0 here. Similarly for the other rows. For example, the second row: A is 0, B is 0, C is 0, D is 1. This is the position, right? The second row's output is 1. Write 1 here.

C等于1,B等于1,A等于1,在这里。输出是什么?输出是0。那么这里应该填0。其他行同理。例如第二行:A是0,B是0,C是0,D是1。这就是对应的位置,对吧?第二行的输出是1,在这里写1。

Just iterate the process until all 16 rows are finished. Finally, you will get the Karnaugh map based on the truth table. Now is the most important part. Once we have the Karnaugh map, how do we do the simplification? For example, here is a very long equation. If we follow what we have learned in Lecture 2, we have to use the three laws—the distributive...

只需迭代该过程,直到全部16行完成。最终,你将基于真值表得到卡诺图。现在是最重要的部分。一旦我们有了卡诺图,如何进行化简?例如,这里有一个非常长的方程。如果我们按照第二节课所学的内容来做,就必须使用三条定律——分配律……

We previously used the three laws—the distributive law and the associative law—to simplify equations. But now we have the Karnaugh map. We have a different way to simplify expressions and equations. How can we simplify? These are the rules. You should follow the rules and simplify a very complex and long equation. The first one is—

我们之前使用了三条定律——分配律和结合律——来简化方程。但现在我们有了卡诺图。我们有了一种不同的方法来简化和表达式与方程。如何简化?这些就是规则。你应该遵循这些规则来简化非常复杂且冗长的方程。第一条是——

The first rule is to group ones together. Group adjacent cells, each containing a one. The number of adjacent cells must be two to the power of n. So it should be either a square — a square is four, right? Two...

第一条规则是将1分组。将相邻的、每个包含1的单元格归为一组。相邻单元格的数量必须是2的n次方。所以它应该是一个正方形——正方形是4,对吧?两……

It should be a power of two, or it should be a regular hypercube, including for layers. Because it should always include one, two, or four adjacent layers. It cannot include three layers. For example, if you group them together, that is wrong, because there are three layers. The number of layers should always be a power of two.

它应该是2的幂,或者应该是一个正则超立方体,包括对层数而言。因为它应该始终包含一层、两层或四层相邻层。它不能包含三层。例如,如果你将它们归为一组,那是错误的,因为有三层。层数应该始终是2的幂。

Each group should contain only one value. For example, if you group these four together, even though it is four cells and meets the size requirement, there are two zeros here, so it is not correct. A group should always contain only one value, and here we have zeros, so it is not correct.

每个组只能包含一个值。例如,如果你把这四个格组合在一起,虽然它是四个格且满足大小要求,但这里有两个零,所以是不正确的。一个组应该始终只包含一个值,而这里有零,所以不正确。

Group the cells, and each cell should have only one group. The groups should be as large as possible. The larger the group, the simpler the expression you will get. Let's take an example: if we have four 1s here, we group them together—four cells.

对卡诺图中的方格进行分组,每个方格只能属于一个组。分组应尽可能大。组越大,得到的表达式就越简单。我们举一个例子:如果这里有四个1,就将它们归为一组——即四个方格。

These requirements are always one. But if we just group this one and group this one, we have two groups. Group this one, group this one, group this one, group this one—four groups. That does not simplify the equation at all. But if we use a big group, it can significantly simplify the equation. So please use the larger group.

这些要求始终为一。但如果我们只是把这一个分组,再把这一个分组,我们就有两个组。这个一组,这个一组,这个一组,这个一组——四个组。这根本不能简化方程。但如果我们使用一个大组,就能显著简化方程。所以请使用更大的分组。

To a larger group, which can significantly simplify the expressions. The larger the group you choose, the simpler the function. With each increase by a power of two in the size of the group, the group becomes dependent on one less variable. If you include one...

选择更大的组,可以显著简化表达式。所选的组越大,函数就越简单。组的大小每增加一个2的幂次,该组就少依赖一个变量。如果你将一个...

One more group means you will have one less variable. That is exactly what we want. We want to simplify and reduce the number of variables. So the minimal form is obtained with the largest possible groups that are integer powers of two.

多一个组意味着少一个变量。这正是我们想要的。我们希望简化并减少变量的数量。因此,最小形式是通过尽可能大的、且为2的整数次幂的组来获得的。

It is always the power of the form of the group. And all sets in a group should be one. And one should be included in at least one group. Which means, if you have a group here, and this one is grouped in this big group, but it can also be included in another group.

它始终是群的形式幂。群中所有集合都应当为一。而一应当被包含在至少一个群中。也就是说,如果你这里有一个群,而这个一被归入这个大群,但它也可以被包含在另一个群中。

These two groups overlap here. All cells containing a 1 must be included in at least one group. The groups may overlap because all the 1s can be covered.

这两个组在此处重叠。所有包含1的单元格必须至少被一个组包含。组可以重叠,因为所有的1都可以被覆盖。

An element is included in at least one group, so groups can overlap. One cell may be included in several groups. However, any group that has all its elements included in another group is not required.

一个元素至少被包含在一个组中,因此组之间可以重叠。一个单元格可能被包含在多个组中。但是,如果一个组的所有元素都已被另一个组包含,则该组是不需要的。

For example, you have four ones here. You can group these two ones, or you can group these four ones. This small group is unnecessary because all its elements are included in the big one.

例如,这里你有四个一。你可以将其中两个一分组,也可以将这四个一分组。这个小分组是不必要的,因为它的所有元素都包含在那个大分组中。

A group that has all its elements included in other groups is not required. If it is included in the big group, it is not required. Two groups can be overlapped, but they cannot be completely overlapped. Completely overlapped means one small group is totally inside a larger group. Some kind of overlap is fine, but not completely or totally overlapped.

如果一个组的所有元素都包含在其他组中,则该组不是必需的。如果它包含在大组中,也不是必需的。两个组可以重叠,但不能完全重叠。完全重叠是指一个小组完全包含在一个大组内部。某种程度的重叠是可以的,但不能完全或彻底重叠。

There may be several correct minimal forms for a given logic function. This is very important — that is the reason why we have different solutions for Exercise 2. If you do the simplification, everybody will get different solutions. That is the reason: there are several correct minimal forms for a given logic function. If a logic function is given and you do the simplification, there are several different correct solutions.

对于一个给定的逻辑函数,可能存在多个正确的最简形式。这一点非常重要——这正是我们在练习2中拥有不同解的原因。如果你进行化简,每个人都会得到不同的解。原因就在于此:对于一个给定的逻辑函数,存在多个正确的最简形式。如果给定一个逻辑函数并进行化简,会有多个不同的正确解。

The last point is also very important: the edges of a Karnaugh map are adjacent to each other. This means when you group the cells, the cells should be adjacent. A cell on one edge is also adjacent to a cell on the opposite edge, because they are at the edge of the Karnaugh map.

最后一点也非常重要:卡诺图的边缘彼此相邻。这意味着在对单元格进行分组时,单元格应当是相邻的。位于一侧边缘的单元格与位于对侧边缘的单元格也是相邻的,因为它们都处于卡诺图的边缘。

When you compare two adjacent Gray codes, only one bit is changed. This property is very important. Even though these two cells—one at the bottom left and one at the bottom right—are still adjacent, when you do the grouping, these two can also be grouped together. Similarly, this one can also be grouped with this one.

比较两个相邻的格雷码时,只有一个比特发生了变化。这一性质非常重要。即使这两个单元格——一个在左下角,一个在右下角——它们仍然是相邻的,在进行分组时,这两个也可以被归为一组。类似地,这一个也可以与这一个归为一组。

One bit is at the bottom, one is at the top. You can also group them together. If both outputs are ones—because when you compare the Gray codes 1001 and 0001, only one bit has changed—they are also adjacent. This is the property of Gray code: every adjacent number differs by only one bit. That is the meaning of the last sentence.

一个位在底部,一个位在顶部。你也可以将它们归为一组。如果两个输出都是1——因为当你比较格雷码1001和0001时,只有一个位发生了变化——它们也是相邻的。这就是格雷码的性质:每对相邻数之间仅有一个位不同。这就是最后一句话的含义。

Right. Any questions? What's the function of groupings? Huh?

好。有什么问题吗?分组的目的是什么?嗯?

Student: What is the function of a group? Teacher: The main reason we want to group is to simplify expressions. For example, we put these four cells together into one group to represent them. If you write the equation like this, the corresponding terms for this one are…

学生:分组的函数是什么? 教师:我们进行分组的主要原因是为了简化表达式。例如,我们将这四个单元合并为一组来表示它们。如果你这样写方程,这一项对应的项是……

A is one, B is zero; C is one, D is zero. We have four terms added together. If you group them together, you can reduce them to one term—these four terms can be simplified into just one term. The reason we want to group is to perform this simplification across all four terms.

A为1,B为0;C为1,D为0。我们有四个项相加。如果将它们分组在一起,就可以化简为一个项——这四个项可以简化为仅一个项。我们进行分组的目的,就是对全部四个项执行这一化简。

Each cell can be replaced by one term. The number of cells should always be a power of two.

每个单元格可以用一个项来替代。单元格的数量始终应为2的幂。

Any questions? If not, we will see each other in the evening.

还有问题吗?如果没有,我们晚上见。

课程总结

课程概览

本次课堂材料显示,课程先从第二讲复习与答疑开始,随后讲评第 6、7 题,并进入第三讲“卡诺图(Karnaugh map)”的引入。第二讲的核心内容被概括为:六个逻辑符号、三条布尔代数定律、德摩根定理的两种形式、两个通用逻辑门。第三讲的核心问题是:为什么需要卡诺图,以及如何用卡诺图代替繁琐的布尔代数化简。

课堂反复强调的逻辑是:逻辑电路输出由输入和电路逻辑共同决定,电路可以改变输入信号的形式;在逻辑门实现中,教师不喜欢直接保留 OR 项,通常要用德摩根定理把 OR 消去,并尽量用 NAND 等通用门实现;卡诺图的作用则是通过重新排列真值表,让逻辑表达式更容易、更可靠地化简。

需要特别注意的是,自动字幕存在大量术语误转,例如把 commutative / associative / distributive laws 误转成 hypnosis 一类词,把 NAND 误转成 lunch、land、lambda 等,把 Karnaugh map 误转成 canal max、convol max、kernel map 等。以下总结优先采用精修稿,并用实时字幕补足上下文。

主要内容

第二讲复习:布尔代数三定律、德摩根定理与通用门

教师先回顾第二讲内容,指出第二讲其实不复杂,主要包括:六个逻辑符号(six logical symbols)、三条定律(three laws)、德摩根定理的两种形式(two forms of De Morgan’s theorem)以及两个通用门(two universal gates)。

三条定律是:

  1. 交换律(commutative law):可以交换变量的位置。例如在 AND 或 OR 运算中,变量的前后顺序不影响结果。
  2. 结合律(associative law):变量的分组顺序不影响结果。例如可以先组合前两个变量,也可以先组合后两个变量。
  3. 分配律(distributive law):一个变量与多个变量的 OR 结果相 AND,等价于这个变量分别与每个变量相 AND,再把结果 OR 起来。课堂精修稿明确表述为:将多个变量 OR 后再与单个变量 AND,等价于将该单个变量分别与这些变量 AND,再将结果 OR。

德摩根定理(De Morgan’s theorem)有两种形式:

  • 第一种:先 AND,再取 NOT,等价于先对每个变量取 NOT,再 OR。
  • 第二种:先 OR,再取 NOT,等价于先对每个变量取 NOT,再 AND。

更常见的写法是:

  • (A · B)’ = A’ + B’
  • (A + B)’ = A’ · B’

教师特别提醒学生注意布尔代数基本公式表中的第十一条,并说明当天会用到。德摩根定理在本节课中的主要用途是:去掉表达式中的 OR 项,把逻辑表达式转化为更适合用 NAND 门实现的形式。

通用门(universal logic gate)包括:

  • NAND 门(NAND gate):可以用它表示所有其余逻辑门。
  • NOR 门(NOR gate):也可以用 NOR 门表示所有其余逻辑门。

教师强调,NAND 是通用门,因此如果题目要求只用 NAND 实现,理论上可以实现所有逻辑功能。

逻辑电路的作用:改变输入形式并产生规律输出

教师用一个波形输入输出的例子说明:如果 A 是输入,B 是输入,经过逻辑电路后,G1、G2、G3 等节点的输出会逐步变化。幻灯片中 G3 处有笔误,教师说明应为 G3。最终输出看起来与输入 A、B 完全不同,并且非常规律。

结论是:输出由输入和电路逻辑决定;逻辑电路具有改变输入形式的功能。也就是说,逻辑电路不是简单传递输入,而是根据门电路结构对输入进行重新组合、取反、与、或等操作,从而得到新的输出波形。

第 6 题 B、C 讲评:从表达式化简到逻辑符号图

教师先讲第 6 题 B、C,因为部分学生不清楚如何下手。第 6 题与第 7 题非常相似。

第 6 题 B 的思路:

  • 首先识别表达式的基本形式。
  • 如果式中出现 OR,要尝试用德摩根定理去掉 OR。
  • 化简时要注意 NOT 的位置。
  • 当表达式已经转化为“AND—AND—最后 NOT”的形式时,就可以停止,因为这种形式适合用 NAND 门实现。
  • 画逻辑符号图时,先处理取反变量。例如 D 需要取反,所以先用 NOT 函数;C 也需要取反。
  • 第一项可由 C’、D’ 等构成,形成一个 NAND 门。
  • 第二项涉及 E’ 和 F 等变量。教师特别强调:如果要从某个变量分出一个分支,分支应放在 NOT 函数之前,而不是之后。若在 NOT 之后分支,得到的将是取反后的信号,不是原信号。
  • 例如 D 的分支应在 NOT 之前取出,才能同时用于 D 和 D’。若在 NOT 之后取,就会得到 D’。
  • 第二项是多个变量先 AND,再整体取 NOT,因此是另一个 NAND 门。
  • 第三项涉及 A 和 F,直接形成 AF 或相关项。
  • 最后这些项再通过一个大的逻辑门组合。教师用“黑箱”或“大逻辑门”描述整体结构。

第 6 题 C 的思路:

  • 首先使用分配律(distributive law)展开或重排表达式。
  • 展开后会发现它与第 6 题 B 非常相似:都是若干项先 AND,再 OR 起来,或者可以转化为适合 NAND 实现的形式。
  • 如果 B 会做,C 也应该会做,因为二者形式相同。
  • 对含取反变量的项,先产生 NOT 信号,再送入 NAND 门。
  • 教师再次强调分支位置:某些分支应在 NOT 之后,因为后面需要的是取反后的信号;某些分支应在 NOT 之前,因为后面需要原变量。
  • 最后多个项汇总到一个大的逻辑门中。

这部分最重要的易错点是:分支位置、NOT 的位置、是否已经把 OR 消去,以及是否停在正确的 NAND 形式。

第 7 题讲评:用 NAND 实现 NOT、AND 和 OR

第 7 题的主题是用 NAND 门实现不同逻辑功能。

第一小题:得到 A、B、C 的原变量形式。

教师回顾:NAND 门的输出是“先 AND 再 NOT”。如果 NAND 门两个输入相同,例如输入 A 和 A,则输出为 A’。因此:

  • 若想得到 NOT,可以把同一信号接到 NAND 门的两个输入端。
  • 若想得到原变量,可以连续使用两次 NAND 取反:第一次得到 A’ 或 ABC’,第二次再取反,回到原变量。

对于 A、B、C,教师说:为了得到 ABC,可以应用 NAND 门两次。先用一个 NAND 组合得到 ABC’,然后再用另一个 NAND 反相,最终得到 ABC。

学生问:能不能把三个信号直接送进一个门?教师回答:不能那样简单画。如果这样画,表达式会不同,只表示 A、B、C 的 NOT 形式。实际想要的是原始变量的结果,因此需要用门电路正确组合。若只是为了简化画法,可以用两次 NAND 的方式。

教师还指出,第二小题其实已经解决,因为它正是 ABC 的 NOT 形式,可以跳过 B。

后续小题:实现 A OR B 以及类似形式。

教师说:对于 OR 门,我们不喜欢 OR,应尽量去掉 OR。方法是应用德摩根定理。例如:

  • A OR B 可以转化为对 A’ 和 B’ 做 NAND。
  • 为了得到 A’,可以把 A 作为 NAND 的两个输入;为了得到 B’,可以把 B 作为 NAND 的两个输入。
  • 然后把 A’ 和 B’ 送入最后的 NAND,就得到 A OR B。

教师还提到一个类似形式:A OR B OR C’。此时同样用德摩根定理。对 A 使用两次 NAND 得到 A’,对 B 使用两次 NAND 得到 B’,C 的两个 NOT 可以抵消,所以 C 直接连接。最后用一个大的 NAND 门组合。

课堂问答中,有学生问分支是实心还是空心。教师回答:空心。

第三讲引入:为什么需要卡诺图

第三讲的主题是卡诺图(Karnaugh map)。教师先问:为什么需要卡诺图?它的目的是什么?

原因在于:当逻辑表达式很长、变量很多时,使用布尔代数进行化简会非常困难,而且容易出错。布尔代数有时很棘手,也很难判断是否已经得到最简表达式。卡诺图正是为了解决这个问题而提出的。

卡诺图的特点:

  • 它是一种重新排列真值表的方法。
  • 它是一种非常强大、广泛使用的逻辑化简图形方法。
  • 它可以直接给出最简的“积之和”形式(sum-of-products form)。
  • 它适合处理最多四个输入变量的表达式,方法直接。
  • 如果输入变量太多,例如五个或六个,卡诺图会变得很大、很复杂,甚至需要三维图。

教师说,卡诺图的主要目的是简化逻辑表达式。使用卡诺图后,不再需要像布尔代数那样一步步写很长的化简过程,而是通过画图和分组来完成。

卡诺图的基本结构:单元格、地址、最小项

卡诺图由许多单元格(cell)组成。单元格数量由输入变量数量决定:

  • 2 个输入变量:4 个单元格。
  • 3 个输入变量:8 个单元格。
  • 4 个输入变量:16 个单元格。
  • 5 个输入变量:32 个单元格。
  • 6 个输入变量:64 个单元格。

一般规则是:单元格数量 = 2 的 n 次方,其中 n 是输入变量数量。

卡诺图中的每个小数字是地址(address)或索引(index),用十进制表示。地址不是输出。输出取决于所实现的逻辑函数。单元格在未指定函数前可以是空的。若知道地址,就知道它对应哪一个输入组合;但输出值仍由函数决定。

卡诺图中的每个单元格对应真值表中的一行。每个单元格还对应一个最小项(minterm)。最小项的定义是:所有输入变量的一种组合经过 AND 运算。每个变量以原变量或反变量形式出现一次。例如某个单元格对应 C=0、B=0、A=0,则其最小项由 C’、B’、A’ 相 AND 构成。

教师用“地址”类比计算机系统中的内存地址:每个单元有地址,地址只是索引,不是内容;内容即输出,取决于函数。

卡诺图的排列:格雷码与相邻性

卡诺图的行列变量组合不是按普通二进制顺序排列,而是按格雷码(Gray code)排列。格雷码最大的特点是:任意两个相邻数字之间只有一位发生变化。

例如二变量卡诺图中,变量组合顺序是: 00,01,11,10。

而不是普通二进制的: 00,01,10,11。

三变量或四变量时也遵循格雷码。教师举例:对于 A、B,可以有 00、01、11、10。对于四变量 D、C、B、A,行和列也按格雷码排列。四变量卡诺图的地址组合通常为: 0,1,3,2,4,5,7,6,12,13,15,14,8,9,11,10。

这些数字只是地址,不是输出值。

格雷码的重要性在于:它保证相邻单元格只有一个变量变化,因此可以用于分组化简。卡诺图的边缘也彼此相邻:最左列与最右列相邻,最上行与最下行相邻。即使两个单元格一个在左下角、一个在右下角,只要输出都是 1,也可以组合。这是因为它们的格雷码只有一位不同。

绘制卡诺图的流程

教师给出创建卡诺图的过程:

  1. 画一个空的卡诺图。
  2. 根据每个输入组合填入期望输出。
  3. 将相邻的、包含 1 的单元格分组。
  4. 为每一组找出对应的逻辑表达式。
  5. 得到整个逻辑表达式。

从最小项表达式画卡诺图时,要找到每个最小项对应的单元格,并在该位置写 1。例如 A’B’C’D’ 对应 A=0、B=0、C=0、D=0 的位置;ABC’D’ 对应 A=1、B=1、C=0、D=0 的位置。其余位置按题目要求填 0 或保持未指定。

从真值表画卡诺图时,每个真值表行对应卡诺图一个单元格。逐行找到输入组合对应的位置,把输出值填入。完成所有行后,就得到对应真值表的卡诺图。

卡诺图化简规则

一旦画出卡诺图,就进入最重要的部分:如何用卡诺图化简。教师列出以下规则:

  1. 把 1 分组。只分组相邻的、包含 1 的单元格。
  2. 每组单元格数量必须是 2 的幂,即 1、2、4、8、16 等。不能是 3 个、5 个、6 个等。
  3. 每组必须只包含 1,不能包含 0。若四个格中有 0,则这四格不能作为一组。
  4. 分组应尽可能大。组越大,表达式越简单。
  5. 组越大,依赖的变量越少。每增加一个 2 的幂次大小,组就少依赖一个变量。
  6. 最简形式由尽可能大的、2 的整数次幂的分组得到。
  7. 所有包含 1 的单元格都必须至少被一个组覆盖。每个 1 至少要参加一次分组。
  8. 组可以重叠。一个单元格可以属于多个组。
  9. 但如果某个组的所有元素都已经被另一个更大的组完全包含,则该组是不必要的,应去掉。
  10. 组之间可以部分重叠,但不能完全重叠。完全重叠是指一个小组完全在另一个大组内部。
  11. 卡诺图边缘相邻,因此最左与最右、最上与最下也可以分组。
  12. 对于同一个逻辑函数,可能存在多个正确的最简形式。分组方式不同,化简结果可能不同。

教师用例子说明分组的目的:如果把四个 1 分成一个大组,就可以用一个项代表四个单元格,从而把四个项简化成一个项。若只把两个 1 分成一组,或者分成很多小组,表达式不会明显简化。所以分组的主要功能就是简化表达式。

课堂问答中,学生问分组的函数或作用是什么。教师回答:主要原因是为了化简表达式。例如四个单元格合成一组,就可以用一项代替原来的四项。

关键知识点与详细解释

  1. 布尔代数三条定律

    • 交换律:变量位置可以交换。
    • 结合律:变量分组顺序不影响结果。
    • 分配律:一个单项与多个项的 OR 相 AND,可分配给每个项后再 OR。 这些定律用于在布尔代数中重排和化简表达式。
  2. 德摩根定理

    • (A · B)’ = A’ + B’
    • (A + B)’ = A’ · B’ 课堂中强调,德摩根定理是去掉 OR 项的关键工具。因为逻辑门实现,特别是 NAND 实现中,教师不喜欢保留 OR。
  3. NAND 是通用门

    • NOT:A NAND A = A’
    • 两次取反可以恢复原变量。
    • OR 可以用德摩根转化后用 NAND 实现。
    • 因此只用 NAND 可以实现 NOT、AND、OR 及其他门。
  4. 逻辑电路改变输入形式 教师用波形说明,逻辑电路输出不一定像输入,而是由电路逻辑决定。最终输出可能非常规律,但和输入波形差别很大。

  5. 卡诺图的目的 卡诺图用于避免长表达式布尔代数化简的困难和易错。它是重排真值表的图形方法,可以直接给出最简积之和形式。

  6. 卡诺图单元格与最小项

    • 单元格数 = 2^n。
    • 每个单元格对应真值表一行。
    • 每个单元格对应一个最小项。
    • 最小项是所有输入变量的一种 AND 组合,变量以原变量或反变量出现一次。
    • 地址或索引是十进制数字,不是输出。
  7. 格雷码 卡诺图行列按格雷码排列,例如 00、01、11、10。相邻格雷码只有一位变化。因此卡诺图边缘也相邻,最左与最右、最上与最下可以分组。

  8. 卡诺图分组规则

    • 只能圈 1。
    • 每组大小必须是 1、2、4、8、16 等 2 的幂。
    • 尽量圈大。
    • 所有 1 至少圈一次。
    • 圈可以重叠,但不能有完全冗余的圈。
    • 圈越大,项越简单,变量越少。
    • 可能有多个正确最简结果。
  9. 易错点

    • 把 OR 保留在最终 NAND 实现中。
    • 分支取在 NOT 之前或之后混淆,导致得到原变量还是反变量错误。
    • 卡诺图中把地址误认为输出。
    • 卡诺图分组包含 0。
    • 分组数量不是 2 的幂。
    • 忘记卡诺图边缘相邻。
    • 在布尔代数化简中无法判断是否最简。
    • 字幕中的 Thévenin’s theorem 疑为转录错误;逻辑化简中实际使用的是布尔恒等式,如 X·X’=0、X+X’=1。

课堂示例与问题

  1. 第二讲复习问题

    • 教师问第二讲有什么问题。
    • 回顾第二讲只包含六个逻辑符号、三条定律、德摩根定理两种形式、两个通用门。
    • 提醒注意布尔公式表第十一条,当天会用到。
  2. 波形输入输出问题

    • A、B 为输入,波形不同。
    • 经过 G1、G2、G3 等节点后,输出与输入差异很大。
    • 结论:逻辑电路可以改变输入形式,输出由输入和电路逻辑决定。
  3. 第 6 题 B

    • 要求用指定逻辑门形式表达方程。
    • 关键步骤:识别基本形式;用德摩根去掉 OR;注意 NOT 和分支位置;化成 NAND 形式后停止;画逻辑符号。
    • 第一项涉及 C’、D’。
    • 第二项涉及 D、E’、F,其中 D 的分支必须在 NOT 之前取出。
    • 第三项涉及 A 和 F。
    • 最后多项汇总到一个大逻辑门。
  4. 第 6 题 C

    • 先使用分配律。
    • 展开后与第 6 题 B 形式相似。
    • 同样使用德摩根定理和 NAND 实现。
    • 教师强调:会做 B 就应该会做 C。
  5. 第 7 题

    • 第一小题:得到 A、B、C 的原变量。用两次 NAND 取反。若直接把三个输入画进一个 NAND,只会得到 ABC’,不是 ABC。
    • 第二小题:是 ABC 的 NOT,已经解决,可以跳过。
    • 后续小题:A OR B,以及类似 A OR B OR C’。用德摩根定理转化为 NAND 实现。A 和 B 分别用 NAND 接成反相器得到 A’、B’;C 的两个 NOT 抵消;最后大 NAND。
    • 课堂问答:分支是实心还是空心?答:空心。
  6. 卡诺图练习一

    • 给定 g(1,2,3)=1,其余为 0。
    • 需要画出二变量卡诺图。
    • 索引 1、2、3 对应的输出为 1。
    • 地址顺序用格雷码:00、01、11、10。
  7. 卡诺图练习二

    • 四变量 D、C、B、A。
    • 给定 f(0,5,6,8,12,13)=1,其余为 0。
    • 行和列按格雷码排列。
    • 计算每个单元格地址,例如 0011=3,0010=2,0100=4,0101=5,0111=7,0110=6 等。
    • 在指定索引处填 1,其余填 0。
  8. 从最小项表达式画卡诺图

    • 例如 A’B’C’D’ 对应某个单元,填入 1。
    • ABC’D’ 对应 A=1、B=1、C=0、D=0 的位置,也填入 1。
    • 每个最小项都要找到对应位置。
  9. 从真值表画卡诺图

    • 一个单元格对应真值表一行。
    • 例如最后一行 A=1、B=1、C=1、D=1,输出为 0,则在对应位置填 0。
    • 第二行 A=0、B=0、C=0、D=1,输出为 1,则在对应位置填 1。
    • 重复直到 16 行全部填完。
  10. 最后较复杂的 G 题

    • 先做简化。
    • 若表达式中出现某变量与其反变量相与,可使该项为 0;字幕中写成 Thévenin’s theorem,疑为转录错误。
    • 也可在适当位置停止,因为已经是可画电路的形式。
    • 画电路时涉及 A、B、C、D、E 等变量,多个 NAND 分支和最后的汇总门。
  11. 课堂问答

    • 分组的作用是什么?答:简化表达式,用一个组代表多个单元格,减少项数和变量数。
    • 为什么不同同学化简结果不同?答:同一逻辑函数可能存在多个正确最简形式,取决于分组方式。
    • 卡诺图为什么适合四变量而不适合六变量?答:单元格数随变量数指数增长,四变量 16 格较直观,五变量 32 格,六变量 64 格,图太大,可能需要三维图。

AI 延伸解释

以下内容是为了帮助理解而补充,并非教师原话。

  1. 布尔代数标准公式补充

    • 交换律:A + B = B + A,AB = BA。
    • 结合律:(A + B) + C = A + (B + C),(AB)C = A(BC)。
    • 分配律:A(B + C) = AB + AC;A + BC = (A + B)(A + C)。
    • 德摩根: (AB)’ = A’ + B’;(A + B)’ = A’B’。
  2. 用 NAND 实现基本门

    • NOT:把 A 接到 NAND 的两个输入,输出 A NAND A = A’。
    • AND:先做 A NAND B 得到 (AB)’,再用一个 NAND 接成反相器,输出 AB。
    • OR:先分别得到 A’ 和 B’,再计算 A’ NAND B’ = (A’B’)’ = A + B。 这与课堂中“NAND 是通用门”的说法一致。
  3. 卡诺图圈组技巧补充

    • 优先圈只有一个 1 且无法与别人合并的项。
    • 每个圈尽量大,圈数尽量少。
    • 圈中保持不变的变量保留,发生变化的变量消去。
    • 每个圈对应一个乘积项,所有圈对应的乘积项再 OR,就是最简积之和。
    • 卡诺图四角在二变量和四变量中也可能相邻,例如最左列与最右列、最上行与最下行。
  4. 最小项编号补充 通常若变量顺序为 A、B、C、D,A 为最高位,则最小项编号可用二进制转十进制理解。例如 0000 对应 m0,0001 对应 m1,0011 对应 m3,1101 对应 m13。但课堂若采用 D、C、B、A 顺序,必须按题目行列约定确定地址,不能混用。

  5. 关于 Thévenin’s theorem 的澄清 在逻辑化简中,戴维南定理并不用于布尔表达式化简。若课堂字幕出现 Thévenin’s theorem,很可能是转录错误。逻辑化简中常用的是布尔恒等式:

    • X · X’ = 0
    • X + X’ = 1 这两个恒等式可解释为什么某些项可以消去或使整个乘积项为 0。
  6. 多维卡诺图补充 五变量和六变量卡诺图可以看作两个或多个四变量卡诺图的叠加。工程中常用“两个四变量图对应第五变量”的方式,或者使用计算机辅助化简。课程此处只作概念性提醒,不要求手动画超大图。

英语术语学习表

English term 中文含义 课堂语境与用法 Example sentence
Boolean algebra 布尔代数 用于逻辑表达式化简,教师指出长表达式用布尔代数易错。 Boolean algebra is useful, but it can be difficult for long expressions.
commutative law 交换律 变量位置可以交换,不影响结果。 A OR B = B OR A illustrates the commutative law.
associative law 结合律 变量分组顺序不影响结果。 The associative law allows us to group variables in different ways.
distributive law 分配律 用于展开或重排逻辑表达式,第 6 题 C 首先使用。 We use the distributive law to expand A(B + C).
De Morgan’s theorem 德摩根定理 用来去掉 OR,把表达式转化为 NAND 可实现形式。 De Morgan’s theorem converts an OR term into a NAND form.
NAND gate 与非门 通用门,可实现 NOT、AND、OR 等。 A NAND gate can be used to build all other basic gates.
NOR gate 或非门 另一个通用门。 The NOR gate is also a universal logic gate.
universal logic gate 通用逻辑门 NAND 和 NOR 都属于通用门。 NAND and NOR are called universal logic gates.
NOT gate 非门 用于取反。 A NOT gate changes A into A’.
AND gate 与门 实现逻辑乘法。 The output of an AND gate is 1 only when all inputs are 1.
OR gate 或门 实现逻辑加法;课堂中不喜欢保留 OR。 We try to remove the OR gate by using De Morgan’s theorem.
logic gate 逻辑门 构成逻辑电路的基本单元。 The circuit is built from several logic gates.
input 输入 逻辑电路的输入变量或波形。 A and B are the inputs to the circuit.
output 输出 由输入和电路逻辑决定。 The output waveform is different from the input waveform.
truth table 真值表 卡诺图是对真值表的重排。 Each row of the truth table gives one input combination.
Karnaugh map 卡诺图 用于逻辑化简的图形方法。 A Karnaugh map can simplify a logic expression quickly.
cell 单元格 卡诺图中的一个方格,对应真值表一行。 Each cell in the Karnaugh map represents one row of the truth table.
address 地址 卡诺图中小数字,表示单元格索引,不是输出。 The small number is the address of the cell.
index 索引 与地址类似,常和最小项编号对应。 The index tells you which minterm the cell represents.
minterm 最小项 所有输入变量的一种 AND 组合。 A minterm is formed by ANDing all input variables.
sum-of-products 积之和 卡诺图可直接给出最简积之和形式。 The Karnaugh map directly gives the simplest sum-of-products form.
Gray code 格雷码 卡诺图行列排列方式,相邻仅一位变化。 Gray code ensures that adjacent cells differ by only one bit.
adjacent cells 相邻单元格 卡诺图中可以合并的单元格。 We group adjacent cells that contain 1s.
grouping 分组 卡诺图化简的核心操作。 Grouping larger blocks gives a simpler expression.
overlap 重叠 卡诺图分组可以部分重叠,但不能完全冗余。 The groups may overlap, but completely redundant groups are not needed.
edge 边缘 卡诺图边缘彼此相邻。 The edges of a Karnaugh map are adjacent to each other.
power of two 2 的幂 每组单元格数量必须是 1、2、4、8 等。 The number of cells in a group must be a power of two.
simplification 化简 第二讲用布尔代数,第三讲用卡诺图。 Karnaugh maps make simplification more reliable.
variable 变量 如 A、B、C、D 等逻辑输入。 Each variable can be either 0 or 1.

复习提纲

一、概念复习

  1. 第二讲核心内容

    • 六个逻辑符号分别是什么?
    • 三条布尔定律分别是什么?
    • 德摩根定理两种形式如何表示?
    • 哪两个门是通用门?
    • 为什么 NAND 可以用同一输入实现 NOT?
  2. 逻辑电路基础

    • 逻辑电路的输出由什么决定?
    • 为什么说逻辑电路可以改变输入形式?
    • 分支应放在 NOT 之前还是之后,取决于什么?
  3. 卡诺图基础

    • 为什么需要卡诺图?
    • 卡诺图与真值表的关系是什么?
    • 一个单元格对应真值表的什么?对应什么最小项?
    • 地址和输出的区别是什么?
    • 为什么卡诺图用格雷码排列?

二、公式与规则复习

  1. 布尔代数

    • 交换律、结合律、分配律的表达式。
    • 德摩根定理: (AB)’ = A’ + B’;(A + B)’ = A’B’。
    • 布尔恒等式:X·X’ = 0,X + X’ = 1。
  2. NAND 实现

    • NOT:A NAND A = A’。
    • AND:A NAND B 后再反相。
    • OR:A’ NAND B’ = A + B。
    • 两次取反可恢复原变量。
  3. 卡诺图规则

    • 单元格数 = 2^n。
    • 2 变量 4 格,3 变量 8 格,4 变量 16 格,5 变量 32 格,6 变量 64 格。
    • 每组大小必须是 2 的幂。
    • 每组只能包含 1。
    • 组尽量大。
    • 所有 1 至少覆盖一次。
    • 组可重叠,但不可完全冗余。
    • 边缘相邻,最左与最右、最上与最下可合并。
    • 可能存在多个正确最简形式。

三、操作步骤复习

  1. 用 NAND 实现逻辑表达式

    • 先用德摩根去掉 OR。
    • 把需要取反的变量用 NAND 接成反相器。
    • 注意分支位置。
    • 化成 NAND 形式后停止,不要过度修改。
    • 画出逻辑符号图。
  2. 从最小项画卡诺图

    • 找出每个最小项对应的输入组合。
    • 在对应单元格填 1。
    • 其余按题目要求填 0 或留空。
  3. 从真值表画卡诺图

    • 一个真值表行对应一个单元格。
    • 按输入组合找到行列位置。
    • 填入对应输出。
    • 重复直到所有行完成。
  4. 用卡诺图化简

    • 圈出所有 1。
    • 每组大小为 2 的幂。
    • 优先圈大组。
    • 允许边缘和四角相邻。
    • 写出每组的乘积项。
    • 将所有乘积项 OR,得到最简积之和。

四、核心问题自测

  1. 为什么教师不喜欢在最终逻辑门实现中保留 OR?
  2. 德摩根定理如何帮助去掉 OR?
  3. NAND 门为什么被称为通用门?
  4. 卡诺图为什么能避免布尔代数化简中的错误?
  5. 一个卡诺图单元格为什么对应真值表一行和一个最小项?
  6. 格雷码在卡诺图中起什么作用?
  7. 为什么卡诺图分组数量必须是 2 的幂?
  8. 为什么组越大,表达式越简单?
  9. 为什么同一个逻辑函数可能有多个正确最简形式?
  10. 卡诺图边缘相邻性如何影响分组?

通过你的捐助帮助此项目持续运行

这个项目完全免费,赞助不是强制的,也不会影响任何功能的使用。实时转录会持续产生模型服务费用,软件开发和服务器维护也需要长期投入,由个人一直承担这些成本有些困难。如果这个项目对你有帮助,希望你愿意赞助一两块钱;不需要很多,大家的一点支持就足以让它运行很久。

支付宝

请使用支付宝扫码

微信

请使用微信扫码