2.1.13

Construct a logic diagram using AND, OR, NOT, NAND, NOR and XOR gates.

Teaching Note:

Problems will be limited to an output dependent on no more than three inputs.

The gate should be written as a circle with the name of the gate inside it. For example:

(JSR note: after "For example:" there's a picture of an OR inside a circle)

LINK Thinking logically, connecting computational thinking and program design, introduction to programming.

Sample Question:

sdfsdfsf

**From Sample Paper 1 - 2014**:

JSR Notes:

**First of all a reminder of how Boolean operators function:**

A processor contains logic gates, which are essentially circuits that can be open or closed, and so they reflect perfectly boolean logic.

"Closed" circuit = a complete circuit, electricity flows through - represented by boolean 1.

"Open" circuit = incomplete, electricity does not flow through - represented by boolean 0.

When there are 2 inputs to a logic gate:

**The overall circuit is on (meaning it has electricity flowing through it)...**

...for an AND logic gate...

... when both input switches are closed.

**The overall circuit is on...**

... for an OR logic gate...

... when one input switch or the other is closed.

**The overall circuit is on...**

... for a NAND logic gate...

... when both input switches are open (i.e. not closed).

**The overall circuit is on...**

... for a NOR logic gate...

... when neither input switch is closed (which may seem kind of weird).

**The overall circuit is on...**

... for a NOT logic gate...

... when the circuit it is connected to is off. So to clarify, a NOT gate stops the flow of electricity if it was flowing before, and makes electricity flow if it wasn’t.

**The overall circuit is on...**

... for a XOR logic gate...

... when one switch is closed, but not both.

Do remember that for I.B. you only need the gates written in circles, not the fancy symbols shown way below, though they are the correct ones - IN FACT IT SAYS "circle with the name of the gate" in the teaching note.

BUT MAKE SURE TO WRITE THE WORDS "NOT", "AND" ETC. FOR EACH GATE ONE WAY OR THE OTHER.

Here are some examples:

So the strategy for doing these logic diagrams is to follow order of operations (a repeat diagram of boolean order of operations is below). So take * the example above*.

- The A Or B (above) along with the C And D are both evaluated first, since they are inner most. So draw them each first.
- Then, the next layer moving outward would be the fact that C And D is actually Not C And D, so add the Not gate.
- Then you would evaluate the result of A Or B combine with Not C And D by an And gate.
- Finally it's that result Or Not A**.
- ** Note here that A already has a wire leading from it, so since it is twice in the circuit expression, it physically is used twice. So with a second line coming from A, Not it, and then have it and the overall other result go through an Or gate.

** The Correct Symbols ** - you are welcome to use either the correct symbols (see below) or the circles and words (see above). I would like you to use the proper symbols, but IB only requires the words (inside circles).

If you only use simple circle gates, obviously you will put "and", "or", or "not" in the circles. But you should do that too, even if you are using the correct symbols I taught you, on the off chance that an examination marker is unfamiliar with those symbols. i.e. MAKE SURE TO PUT "AND", "OR" ETC.IN YOUR SYMBOLS.

(I'm just going to paste here the notes from the Former Curriculum, assessment statement 4.2.5, which is exactly the same as this one.)

Here's some more practice, with answers:

Plus, you could also look at the following Former Curriculum assessment statements.

Former 4.2.5 - this one is for going the other way: from the circuit diagram to the expression.

Former 4.2.6-Extra

(And also, even these.)

(Former 4.2.2)

(Former 4.2.3)

(Former 4.2.4)

**"La Piece do la Resistance" - Half Adder & Full Adder**

And one last wonderful key bit of knowledge, if you want to give it a try, is how all of this is just one step away from, really, completely getting to know how computers work. It's a big step, and NOT PART OF IBCS, but it's explained well in both of the following videos.

What is it? It's how a computer does it's most fundamental operation, addition, with a fairly straight-forward combination of the logic gates we have been dealing with in the form of the half adder, and the full adder.

Enjoy!

And, thanks, Gabriel for this one: