Electronic Logic Circuits
Electronic Logic Circuits
Faculty of Engineering
EEE213
ELECTRONIC CIRCUITS
’’ Logic Circuits’’
2
Logic Circuits
Logic Gates
3
Logic Functions
4
Switch & Lamp Logic
In the simple circuit shown in the figure, a battery is connected to a lamp via a
switch. There are two possible states for the switch, open and closed, but the lamp
will only operate when the switch is closed. We can summarize this using the table.
Since the switch can only be in one of the two states (i.e. open or closed) at
any given time, the open and closed conditions are mutually exclusive. Furthermore,
since the switch cannot exist in any other state than completely open or completely Simple switch and lamp circuit
closed (i.e. there is no intermediate or half-open state) the circuit uses binary or ‘two-
state’ logic. The logical state of the switch can be represented by the binary digits, 0
and 1. For example, if logical 0 is synonymous with open (or ‘off’) and logical 1 is
equivalent to closed (or ‘on’), then: Simple switching logic
We can now rewrite the truth table in terms of the binary states as shown in the
second figure where:
No light (off) = 0 Truth table for the switch and lamp
Light (on) = 1
5
AND Logic
Now consider the circuit with two switches shown in the figure. Here, the lamp
will only operate when switch A is closed and switch B is closed. Since there are two
switches (A and B) and there are two possible states for each switch (open or closed),
there is a total of four possible conditions for the circuit, as can be seen in the table.
Since each switch can only be in one of the two states (i.e. open or closed) at AND switch and lamp logic
any given time, the open and closed conditions are mutually exclusive. Furthermore,
since the switches cannot exist in any other state than completely open or completely
closed (i.e. there are no intermediate states) the circuit uses binary logic. We can thus
represent the logical states of the two switches by the binary digits, 0 and 1.
Once again, if we adopt the convention that an open switch can be represented Simple AND switching logic
by 0 and a closed switch by 1, we can rewrite the truth table in terms of the binary
states shown in the last figure where:
No light (off) = 0
Light (on) = 1
Solution:
10
Example: Figure shows a simple switching circuit. Describe the
logical state of switches A, B and C in order to operate the lamp.
Illustrate your answer with a truth table.
Solution:
11
Logic Gates
13
Inverters
14
AND Gates
AND gates will only produce a logic 1 output when all inputs
are simultaneously at logic 1. Any other input combination results in
a logic 0 output. The Boolean expression for the output, Y, of an
AND gate with inputs, A and B, is:
Symbols and truth table for an AND gate
15
OR Gates
OR gates will produce a logic 1 output whenever any one, or
more, inputs are at logic 1. Putting this another way, an OR gate will
only produce a logic 0 output whenever all of its inputs are
simultaneously at logic 0. The Boolean expression for the output, Y,
of an OR gate with inputs A and B is:
Symbols and truth table for an OR gate
16
NAND Gates
NAND (i.e. NOT-AND) gates will only produce a logic 0
output when all inputs are simultaneously at logic 1. Any other input
combination will produce a logic 1 output. A NAND gate, therefore,
is nothing more than an AND gate with its output inverted. The circle
Symbols and truth table for a NAND gate
shown at the output denotes this inversion. The Boolean expression
for the output, Y, of a NAND gate with inputs A and B is:
17
NOR Gates
NOR (i.e. NOT-OR) gates will only produce a logic 1 output
when all inputs are simultaneously at logic 0. Any other input
combination will produce a logic 0 output. A NOR gate, therefore, is
simply an OR gate with its output inverted. A circle is again used to
Symbols and truth table for a NOR gate
indicate inversion. The Boolean expression for the output, Y, of a
NOR gate with inputs, A and B, is:
18
Exclusive-OR Gates
Exclusive-OR gates will produce a logic 1 output whenever
either one of the inputs is at logic 1 and the other is at logic 0.
Exclusive-OR gates produce a logic 0 output whenever both inputs
have the same logical state (i.e. when both are at logic 0 or both are
at logic 1). The Boolean expression for the output, Y, of an Symbols and truth table for an exclusive-OR gate
19
Exclusive-NOR Gates
Exclusive-NOR gates will produce a logic 0 output whenever either one of the inputs is at logic 1 and the other is at
logic 0. Exclusive-NOR gates produce a logic 1 output whenever both inputs have the same logical state (i.e., when both
are at logic 0 or both are at logic 1). The Boolean expression for the output, Y, of an exclusive-NOR gate with inputs, A
and B, is:
𝑌 = 𝐴. 𝐵ത + 𝐵. 𝐴ҧ
20
Example: A logic circuit is to be constructed that will produce a logic 1 output whenever two or more of its
three inputs are at logic 1.
Solution:
21
Example: A logic circuit is to be constructed that will produce a logic 1 output whenever two or more of its
three inputs are at logic 1.
Solution:
22
Example: Show how an arrangement of basic logic gates (AND, OR, and NOT) can be used to produce the
exclusive-OR function.
Solution:
23
Example: Show how an arrangement of basic logic gates (AND, OR, and NOT) can be used to produce the
exclusive-OR function.
Solution:
These expressions can be obtained using two two-input AND gates and the result (i.e. P and Q) can then be applied to
an OR gate with two inputs. A and B can be produced using inverters.
24
Important Formulas
Buffers & Inverters:
AND Gates:
OR Gates:
NAND Gates:
NOR Gates:
𝑌 = 𝐴. 𝐵ത + 𝐵. 𝐴ҧ
25
26
Asst.Prof. Zehra Merve Cinan
Faculty of Engineering
Department of Electrical and Electronics Engineering,
8th Block, Floor: 2
Office: 2521
27