logic circuits in today’s lesson we will look at: the symbols for not, and, or and eor using truth...
TRANSCRIPT
Logic Circuits
In today’s lesson we will look at:
• the symbols for NOT, AND, OR and EOR
• using truth tables to represent logic circuits
• two new operators – NAND and NOR
• using equivalence to simplify circuits
• the “half-adder” circuit
Logic Circuits
• You might sometimes see diagrams that look like electrical circuits, but which contain symbols for Boolean operators – these are called logic circuits.
• Each logical operation has its own symbol:
NOT
Example Circuit• Symbols are combined and
inputs labelled:
• Output can be shown using truth tables:
D
NOT
AND
OR
A B C D
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
NAND and NOR
• With logic circuits, there are two new operators that you might come across – NAND and NOR:
• Their names are short for NOT AND and NOT OR, which reminds us what they do.
• NAND behaves like AND with a NOT after it, and NOR behaves like an OR with a NOT after it - i.e. the results are the opposite of a normal AND and OR.
Truth Table - NOR
The NOR operator gives a false result if any of the input values is true, e.g.
a b a OR b
0 0 0
0 1 1
1 0 1
1 1 1
a NOR b
1
0
0
0
Truth Table - NAND
The NAND operator gives a false result if both of the input values are true, e.g.
a b a AND b
0 0 0
0 1 0
1 0 0
1 1 1
a NAND b
1
1
1
0
Why Use NAND and NOR?
• Remember DeMorgan’s Duals from last week?
– NOT(a OR b) = NOT a AND NOT b
– NOT(a AND b) = NOT a OR NOT b
• The left-hand part of those equivalences are NOR and NAND, so they can be used to make logic circuits simpler.
• Also, NAND is easy to manufacture because a single transistor behaves like a NAND gate, so circuits using NAND can be both logically and physically simpler and more efficient.
Simplification
• Look at this circuit – it uses three components:
• It represents the operation
Y = NOT A OR NOT B
• However, from the previous slide, we know that:
NOT(a AND b) = NOT a OR NOT b
• We also know that NOT(a AND b) is the same as a NAND b, so the wholecircuit can be simplified toa single NAND gate:
YB
A
Another Example
A B C Output
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
AND
NAND
OR• What is the output of this logic circuit?
Half-Adder
A B D E S C
0 0
0 1
1 0
1 1
• What is the outputof this circuit?
• This circuit performs binary addition (C = carry)
• It also has a simpler equivalent: