And in particular, the hack computer that we are going to build in this

course consists of something like 30 different chips.

And we are going to build them one step at a time.

And in the first project we start with Nand, which is God given, or given by us,

or you can think about it as some sort of an axiom that you can assume.

And using Nand, we want you to build the following gates.

Not, And, Or, Xar, and so on and so forth.

So that's what you have to do for Project 1.

And why these particular 15 gates?

That's a good thing to ask, and the answer is two fold.

First of all, every one of these gates is widely used in almost

any construction of a digital device or some version of these gates.

And the second answer, which is more practical, is that these gates comprise

all the elementary logic gates which are needed in order to build our computer.

So Project 1 lays out the foundation that we are going to use

in subsequent projects, because in other projects, we're going to use these chips,

in order to build more complex and more interesting functionality.

So, once again, here are the chips that we have to build, and

I have separated them into three categories,

just that we can discuss it in a more organized fashion.

So we have some elementary logic gates, widely familiar: Not, And, Or, and so on.

We have 16-bit variants of some of the logic gates.

And we have some multi-way,

and also multi-way 16-bit variants of the previous gates.

And in order to make all these new concepts more familiar,

I will focus on some gates in every one of these

categories and say few words about them.

And this, once again, will give you everything that you need In order to build

any one of the gates in Project 1.

So without further ado,

let's start to talk about multiplexors and demultiplexors.

So what is a multiplexor?

A multiplexor is a gate that operates as follows.

There are two inputs coming in, and we know them a and b.

And there's a sel input coming in, so-called, from the bottom.

Of course in reality there's no bottom and

left, but I'm talking about this gate diagram here.

So three inputs come in, a, b, and sel.

What does the multiplexor do?

Well, if sel = 0, the multiplexor outputs a.

If sel = 1 the multiplexor outputs b.

That's it, that's the desired behavior of a multiplexor.

And here is the truth table of the mulitplexor.

We have three inputs, so we have eight different possibilities.

And you can convince yourself that the truth table is

consistent with what we described before.

We can also provide an abbreviated truth table of the multiplexor operation, and

once again if sel is 0, the multiplexor outputs a, otherwise it outputs b.

So a 2-way multiplexor enables us to select and

output one out of two incoming inputs.

And this is a fundamental operation that is being used over and over again,

both in digital design projects as well as in communications networks.

So here's an example of how Mux logic comes to play

in the context of building what is sometimes called a programmable gate.

Now what is a programmable gate?

It's a gate that can behave

in one of several different ways according to our will.

So here's a simple programmable gate that can

act either as an And gate or as an Or gate.

If the select bit is zero, the gate acts as And.

If the select gate is one, the gate acts as Or.