"A logic gate is an electronic circuit which makes logic decisions". It has one output and one or more inputs. The output signal appears only for certain combinations of input signals. Logic gates are the basic building blocks from which most of the digital systems are built up. They implement the hardware logic function based on the logical algebra developed by George Boole which is called Boolean algebra in his honour. A unique characteristic of the Boolean algebra is that variables used in it can assume only one of the two values i.e. either 0 or 1. Hence, every variable is either a 0 or a 1.
These gates
are available today in the form of various IC families. The most popular
families are:
- Transistor-transistor logic (TTL),
- Emitter-coupled logic (ECL),
- Metal-oxide-semiconductor (MOS) and
- Complementary metal-oxide-semiconductor (CMOS).
In this
chapter, we are going to study the OR, AND, NOT, NOR, NAND, exclusive OR (XOR)
and exclusive NOR (XNOR) gates along with their truth tables.
Positive
and Negative Logic:
In
computing systems, the number symbols 0 and 1 represent two possible states of
a circuit or device. It makes no difference if these two states are referred to
as ON and OFF, CLOSED and OPEN, HIGH and LOW PLUS and MINUS or TRUE and FALSE
depending on the circumstances. Main point is that they must be symbolized by
two opposite conditions.
In positive
logic, a 1 represents
1. an ON
circuit 2. a CLOSED switch 3. a HIGH
voltage
4. a PLUS
sign 5. a TRUE statement
Consequently,
a 0 represents
1. an OFF
circuit 2. an
OPEN switch 3. a LOW voltage
4. a MINUS sign 5. a FALSE statement.
In negative
logic, just opposite conditions prevail.
Suppose, a
digital system has two voltage levels of 0V and 5V. If we say that symbol 1
stands for 5V and symbol 0 for 0V, then we have positive logic system. If, on
other hand, we decide that a 1 should represent 0 V and 0 should represent 5V,
then we will get negative logic system.
Main point
is that in positive logic, the more positive of the two voltage levels
represents the 1 while in negative logic, the more negative voltage represents
the 1. Moreover, it is not essential that a 0 has to be represented by 0V
although in some cases the two may coincide. Suppose, in a circuit, the two
voltage levels are 2V and 10V. Then for positive logic, the 1 represents 10V
and the 0 represents 2V (i.e. lesser of the two voltages). If the voltage
levels are − 2V and − 8V, then, in positive logic, the 1 represents − 2V and
the 0 represents − 8V (i.e. lesser of the two voltages).
Unless
stated otherwise, we will be using only positive logic in this chapter.
The OR
Gate:
The
electronic symbol for a two-input OR gate and its equivalent switching circuit shown
in Fig. The two inputs have been marked as A and B and the output as X.
Logic
Operation:
The OR gate
has an output of 1 when either A or B or both are 1.
In other
words, it is an any-or-all gate because an output occurs when any or all the
inputs are present.
Obviously,
the output would be 0 if and only if both its inputs are 0. In terms of the
switching conditions, it means that lamp would be OFF (logic 0) only when both
switches A and B are OFF.
"The
OR gate represents the Boolean equation A + B = X"
When both
inputs are 0 (switches are OPEN), output X is 0 (lamp is OFF). When A is in
logic state 0 (switch A is OPEN) but B is in logic state 1 (switch B is
CLOSED), the output X is logic state 1 (lamp is ON). Lamp would be also ON when
A is CLOSED and B is OPEN. Of course, lamp would be ON when both switched are
CLOSED. It is so because an OR gate is equivalent to a parallel circuit in its
logic function.
Another
point worth remembering is that the above OR gate is called inclusive OR gate
because it includes the case when both inputs are true.
The
Three input OR Gate:
The
electronic symbol for a 3-input (fan-in of 3) inclusive OR gate is shown in
Fig. 70.9. As is usual in logic algebra, the inputs A, B, C as well as the
output X can have only one of the two values i.e. 0 or 1.
Truth Table
It is shown
in Table. Following points are worth noting:
1. The
number of rows in the table is 2^3 = 8 i.e. there are eight ways of combining
the three inputs. In general, the number of horizontal rows is 2n where n is
the number of inputs.
2. In first
column A, logic values alternate between 0 and 1 every four rows twice.
3. The
second input column B alternates between 0 and 1 every two rows four times.
4. The
third input column C alternates between 0 and 1 every other row eight times.
The truth table symbolizes the Boolean equation A + B + C = X which means that output X is 1 when either A or B or C is 1 or all are 1. Alternatively, X is true when either A or B or C is true or all are true.
The AND
Gate:
The
electronic (or logic) symbol for a 2-input AND gate and its equivalent
switching circuit shown in Fig. It is worth reminding the readers once again
that the three variables A, B, C can have a value of either 0 or 1.
Logic
Operation
1. The AND
gate gives an output only when all its inputs are present.
2. The AND
gate has a 1 output when both A and B are 1. Hence, this gate is an
all-or-nothing gate whose output occurs only when all its inputs are present.
3. In
True/False terminology, the output of an AND gate will be true only if all its
inputs are true. Its output would be false if any of its inputs is false.
The AND
gate works on the Boolean algebra
A ×B = X or A . B = X or AB = X
As seen
from Fig, the lamp would be ON when both switches A and B are closed. Even when
one switch is open, the lamp would be OFF. Obviously, an AND gate is equivalent
to a series switching circuit. Fig shows truth table for a 2-input AND gate and
gives the same for a 3-input AND gate.
As seen, X
is at logic 1 only when all inputs are at logic 1, not otherwise.
The Not
Gate:
It is so called because its output is NOT the same as its input. It is also called an inverter because it inverts the input signal. It has one input and one output as shown in Fig.
The
schematic symbol for inversion is a small circle as shown in Fig. The logical
symbol for inversion or negation or complementation is a bar over the function
to indicate the opposite state.
Sometimes,
a prime is also used as A′. For example, A means not-A. Similarly, (A + B)
means the complement of (A + B).
The NOT
Operation
It is a
complementation operation and its symbol is an over bar. It can be defined as
under:
As stated
earlier, 0 means taking the negation or complement of 0 which is 1.
0 = 1
1 = 0
It should also be noted that complement of a value can be taken repeatedly. For example,
1 = 0 = 1 or 0 = 1 = 0
As seen
double complementation gives the original value.
Bubbled
Gates:
A bubbled
gate is one whose inputs are NOTed or inverted i.e. it is a negated gate. Fig
shows AND gate who both inputs are inverted. As seen, the inverter triangles
have been eliminated and the two small circles or bubbles have been moved to
the inputs of the gate. Such a gate is called a bubbled AND gate, the bubbles
acting as a reminder of the inversion or complementation that takes place
before ANDing the inputs.
It would be
shown later that a bubbled AND gate is equivalent to a NOR gate.
Similarly,
a bubbled OR gate is equivalent to a AND gate.
The NOR
Gate
In fact, it
is a NOT-OR gate. It can be made out of an OR gate by connecting an inverter in
its output.
The output
equation is given by
A NOR function is just the reverse of the OR function.
Logic
Operation
A NOR gate
will have an output of 1 only when all its inputs are 0. Obviously, if any
input is 1, the output will be 0. Alternatively, in a NOR gate, output is true
only when all inputs are false. The truth table for a 2-input NOR gate is shown
in Fig. It will be observed that the output X is just the reverse of that.
The
equivalent relay circuit for a NOR gate is shown in fig. It is seen that the
lamp glows under 00 input condition only but not under 01, 10, 11 input
conditions.
The
transistor equivalent of the NOR gate is shown in Fig. As seen, output X is 1
only when both transistors are cut-off i.e. when A = 0 and B = 0. For any other
input condition like 01, 10 and 11, one or both transistors saturate forcing
point X to go to ground.
The NAND
Gate
It is, in
fact, a NOT-AND gate. It can be obtained by connecting a NOT gate in the output
of an AND gate as shown in Fig.
Its output
is given by the Boolean equation.
This gate
gives an output of 1 if it’s both inputs are not 1. In other words, it gives an
output 1 if either A or B or both are 0.
The truth
table for a 2-input NAND gate is given in Fig. It is just the opposite of the
truth for AND gate. It is so because NAND gate performs reverse function of an
AND gate.
The XNOR
Gate
It is known
as a not-XOR gate i.e. XOR gate. Its logic symbol and truth table are shown in
fig. Its logic function and truth table are just the reverse of those for XOR
gate. This gate has an output 1 if it’s both inputs are either 0 or 1. In other
words, for getting an output, it’s both inputs should be at the same logic
level of either 0 or 1. Obviously, it produces no output if its two inputs are
at the opposite logic level.
Logic
Gates at a Glance
In Fig is
shown the summary of all the 2-output logic gates considered so far along with
their truth tables.
Following
points should prove helpful when writing these truth tables:
1. In first
column A, logic values alternate between 0 and 1 every two rows
2. In
second column B, logic values alternate every other row
3. Column X
is filled up as per the logic function it performs
Comments
Post a Comment