Positive&Negative Logic
Positive&Negative Logic
Sc Adham Hadi
Logic Lecture
Logic Gates
The Logic gates are electronic circuits that can be used to implement the most
elementary logic expressions, also known as Boolean expressions. The logic gate is
the most basic building block of combinational logic. There are three basic logic
gates, namely the OR gate, the AND gate and the NOT gate. Other logic gates that
are derived from these basic gates are the NAND gate, the NOR gate, the
EXCLUSIVEOR gate and the EXCLUSIVE-NOR gate.
Logic Lecture
OR Gate
An OR gate performs an ORing operation on two or more than two logic variables.
The OR operation on two independent logic variables A and B is written as Y = A+B
and reads as Y equals A OR B and not as A plus B. An OR gate is a logic circuit with
two or more inputs and one output. The output of an OR gate is LOW only when all
of its inputs are LOW. For all other possible input combinations, the output is HIGH.
This statement when interpreted for a positive logic system means the following.
The output of an OR gate is a logic 0 only when all of its inputs are at logic 0. For
all other possible input combinations, the output is a logic 1. Figure below shows
the circuit symbol and the truth table of a two-input OR gate. The operation of a twoinput OR gate is explained by the logic expression:
Y = A+B
As an illustration, if we have four logic variables and we want to know the logical
output of (A+ B+C +D), then it would be the output of a four-input OR gate with A,
B, C and D as its inputs. Y=A+B Figures (a) and (b) show the circuit symbol of
2
Logic Lecture
three-input and four-input OR gates. Figure (c) shows the truth table of a three-input
OR gate. Logic expressions explaining the functioning of threei nput and four-input
OR gates are Y = A+B+C and Y = A+B+C +D.
Logic Lecture
Example : Draw the output waveform for the OR gate and the given pulsed input
waveforms of Fig.
AND Gate
An AND gate is a logic circuit having two or more inputs and one output. The output
of an AND gate is HIGH only when all of its inputs are in the HIGH state. In all other
cases, the output is LOW. When interpreted for a positive logic system, this means
that the output of the AND gate is a logic 1 only when all of its inputs are in logic
1 state. In all other cases, the output is logic 0. The logic symbol and truth table of
a two-input AND gate are shown below The AND operation on two independent
logic variables A and B is written as Y = A.B and reads as Y equals A AND B and not
as A multiplied by B. Here, A and B are input logic variables and Y is the output. An
AND gate performs an ANDing operation:
Logic Lecture
Logic Lecture
Logic Lecture
NOT Gate
A NOT gate is a one-input, one-output logic circuit whose output is always the
complement of the input. That is, a LOW input produces a HIGH output, and vice
versa. When interpreted for a positive logic system, a logic 0 at the input produces a
logic 1 at the output, and vice versa. It is also known as a complementing circuit or
an inverting circuit.
The NOT operation on a logic variable X is denoted as
or
or
EXCLUSIVE-OR Gate
The EXCLUSIVE-OR gate, commonly written as EX-OR gate, is a two-input, oneoutput gate. Figures (a) and (b) respectively show the logic symbol and truth table of
a two-input EX-OR gate. As can be seen from the truth table, the output of an EX-OR
gate is a logic 1 when the inputs are unlike and a logic 0 when the inputs are like.
7
Logic Lecture
Although EX-OR gates are available in integrated circuit form only as two-input
gates, unlike other gates which are available in multiple inputs also, multiple-input
EX-OR logic functions can be implemented using more than one two-input gates.
The truth table of a multiple-input EX-OR function can be expressed as follows. The
output of a multiple-input EX-OR logic function is a logic 1 when the number of 1s
in the input sequence is odd and a logic 0 when the number of 1s in the input
sequence is even, including zero. That is, an all 0s input sequence also produces a
logic 0 at the output. Figure(c) shows the truth table of a four-input EX-OR
function. The output of a two-input EX-OR gate is expressed by
B =
Y=A
B+A
Logic Lecture
Q: How do you implement three-input and four-input X-OR logic functions with
the help of two-input EX-OR gates?
Q: How can you implement a NOT circuit using a two-input EX-OR gate?
NAND Gate
NAND stands for NOT AND. An AND gate followed by a NOT circuit makes it a
NAND gate [Fig. (a)]. Figure (b) shows the circuit symbol of a two-input NAND
gate. The truth table of a NAND gate is obtained from the truth table of an AND gate
by complementing the output entries [Fig. (c)]. The output of a NAND gate is a logic
9
Logic Lecture
0 when all its inputs are a logic 1. For all other input combinations, the output is a
logic 1. NAND gate operation is logically expressed as
Y=
In general, the Boolean expression for a NAND gate with more than two inputs can
be written as
Y=
NOR Gate
NOR stands for NOT OR. An OR gate followed by a NOT circuit makes it a NOR
gate [Fig. (a)]. The truth table of a NOR gate is obtained from the truth table of an
OR gate by complementing the output entries. The output of a NOR gate is a logic 1
when all its inputs are logic 0. For all other input combinations, the output is a logic
0. The output of a two-input NOR gate is logically expressed as
Y=
In general, the Boolean expression for a NOR gate with more than two inputs can be
written as
Y=
10
Logic Lecture
EXCLUSIVE-NOR Gate
EXCLUSIVE-NOR (commonly written as EX-NOR) means NOT of EX-OR, i.e. the
logic gate that we get by complementing the output of an EX-OR gate. The truth
table of an EX-NOR gate is obtained from the truth table of an EX-OR gate by
complementing the output entries. Logically, The output of a two-input EX-NOR gate
is a logic 1 when the inputs are like and a logic 0 when they are unlike. In general,
the output of a multiple-input EX-NOR logic function is a logic 0 when the number
of 1s in the input sequence is odd and a logic 1 when the number of 1s in the input
sequence is even including zero. That is, an all 0s input sequence also produces a
logic 1 at the output.
Y=
= AB+
11
Logic Lecture
H.W :
Show the logic arrangements for implementing:
(a) a four-input NAND gate using two-input AND gates and NOT gates;
(b) a three-input NAND gate using two-input NAND gates;
(c) a NOT circuit using a two-input NAND gate;
(d) a NOT circuit using a two-input NOR gate;
(e) a NOT circuit using a two-input EX-NOR gate.
H.W:
How do you implement a three-input EX-NOR function using only two-input EXNOR gates?
12