0% found this document useful (0 votes)
80 views

Logic Gates For AME Students

The document discusses logic gates and how they are used in digital circuits. It defines common logic gates like AND, OR, NOT, NAND and NOR. All logic gates can be constructed using just NAND or NOR gates, which are called universal gates. Truth tables are provided that define the output of each gate for all possible input combinations. Logic gates can be combined to create more complex functions. Gates can also be substituted to reduce the number of integrated circuits needed in a design.

Uploaded by

Suraz Aley
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views

Logic Gates For AME Students

The document discusses logic gates and how they are used in digital circuits. It defines common logic gates like AND, OR, NOT, NAND and NOR. All logic gates can be constructed using just NAND or NOR gates, which are called universal gates. Truth tables are provided that define the output of each gate for all possible input combinations. Logic gates can be combined to create more complex functions. Gates can also be substituted to reduce the number of integrated circuits needed in a design.

Uploaded by

Suraz Aley
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 10

Logic gates and hardware

NAND and NOR logic gates are the two pillars of logic, in that all other types of Boolean logic gates (i.e., AND, OR, NOT, XOR,
XNOR) can be created from a suitable network of just NAND or just NOR gate(s). They can be built from relays or transistors, or any
other technology that can create an inverter and a two-input AND or OR gate. Hence the NAND and NOR gates are called the
universal gates.
For an input of 2 variables, there are 16 possible boolean algebraic functions. These 16 functions are enumerated below, together with
their outputs for each combination of inputs variables.

0 0 1 1

0 1 0 1

0 0 0 0

A AND B

0 0 0 1

A> B*

0 0 1 0

0 0 1 1

A< B*

0 1 0 0

0 1 0 1

A XOR B

0 1 1 0

A OR B

0 1 1 1

A NOR B

1 0 0 0

INPUT

OUTPUT

A XNOR B 1 0 0 1

NOT B

1 0 1 0

AB*

1 0 1 1

NOT A

1 1 0 0

AB*

1 1 0 1

A NAND B 1 1 1 0

1 1 1 1

The four functions labeled with a "*" are the logical implication functions: "A B" can be read as "A implies B"; it follows that "A >
B" is "A does not imply B". These four functions are less common and are usually not implemented directly as logic gates.

There are two sets of symbols in common use, both now defined by ANSI/IEEE Std 91-1984 and its supplement ANSI/IEEE Std 91a1991. The "distinctive shape" set, based on traditional schematics, is used for simple drawings and is quicker to draw by hand. It is
sometimes unofficially described as "military", reflecting its origin if not its modern usage. The "rectangular shape" set, based on IEC
60617-12, has rectangular outlines for all types of gate, and allows representation of a much wider range of devices than is possible
with the traditional symbols. The IEC's system has been adopted by other standards, such as EN 60617-12:1999 in Europe and BS EN
60617-12:1999 in the United Kingdom.
In the 1980s, schematics were the predominant method to design both circuit boards and custom ICs known as gate arrays. Today
custom ICs and the field-programmable gate array are typically designed with Hardware Description Languages (HDL) such as
Verilog or VHDL. The need for complex logic symbols has diminished and distinctive shape symbols are still the predominate style.
[citation needed]

Type

Distinctive shape

Rectangular shape

Boolean algebra
between A & B

Truth table

INPUT OUTPUT

AND

A AND B

INPUT OUTPUT

OR

A OR B

A+B

INPUT OUTPUT

NOT

NOT A

In electronics a NOT gate is more commonly called an inverter. The circle on the symbol is called a bubble, and is generally used in
circuit diagrams to indicate an inverted (active-low) input or output. [1][2]
INPUT OUTPUT

NAND

B A NAND B

INPUT OUTPUT

NOR

A NOR B

.
Two more gates are the exclusive-OR or XOR function and its inverse, exclusive-NOR or XNOR. The two input Exclusive-OR is true
only when the two input values are different, false if they are equal, regardless of the value. If there are more than two inputs, the gate
generates a true at its output if the number of trues at its input is odd ([2]). In practice, these gates are built from combinations of
simpler logic gates.
INPUT OUTPUT

XOR

A XOR B

INPUT OUTPUT

XNOR

B A XNOR B

[edit] DeMorgan equivalent symbols


By use of De Morgan's theorem, an AND gate can be turned into an OR gate by inverting the sense of the logic at its inputs and
outputs. This leads to a separate ends can be replaced by a simple bubble-less connection and a suitable change of gate. If the NAND
is drawn as OR with input bubbles, and a NOR as AND with input bubbles, this gate substitution occurs automatically in the diagram
(effectively, bubbles "cancel"). This is commonly seen in real logic diagrams - thus the reader must not get into the habit of associating
the shapes exclusively as OR or AND shapes, but also take into account the bubbles at both inputs and outputs in order to determine
the "true" logic function indicated.

Summary truth tables


The summary truth tables below show the output states for all types of 2-input and 3-input gates.
Summary for all 2-input gates
Inputs
Summary for all 3-input gates

OR N
OREXOREXNORO B
utput of
each
gate A
0A
ND
0
NA
ND

Inputs

Output of each gate

C AND NAND OR NOR

Note that EX-OR and EX-NOR


gates can only have 2 inputs.

Combinations of logic gates


Logic gates can be combined to produce more complex functions. They can also be
combined to substitute one type of gate for another.
For example to produce an output Q which is true only when input A is true and input B is
false, as shown in the truth table on the right, we can combine a NOT gate and an AND gate
like this:

Input A Input B Output Q


0

Q = A AND NOT B
Inputs
Working out the function of a combination of gates
Truth tables can be used to work out the function of a combination of gates.
For example the truth table on the right show the intermediate outputs D and E as well as the
final output Q for the system shown below.

Outputs

D = NOT (A OR B)
E = B AND C
Q = D OR E = (NOT (A OR B)) OR (B AND C)

Substituting one type of gate for another


Logic gates are available on ICs which usually contain several gates of the same type, for example four 2-input NAND
gates or three 3-input NAND gates. This can be wasteful if only a few gates are required unless they are all the same
type. To avoid using too many ICs you can reduce the number of gate inputs or substitute one type of gate for another.
Reducing the number of inputs
The number of inputs to a gate can be reduced by connecting two (or more) inputs together. The diagram shows a 3-input
AND gate operating as a 2-input AND gate.

Making a NOT gate from a NAND or NOR gate


Reducing a NAND or NOR gate to just one input creates a NOT gate. The diagram shows this for a 2-input NAND gate.

Any gate can be built from NAND or NOR gates


As well as making a NOT gate, NAND or NOR gates can be combined to create any type of gate! This enables a circuit to
be built from just one type of gate, either NAND or NOR. For example an AND gate is a NAND gate then a NOT gate (to
undo the inverting function). Note that AND and OR gates cannot be used to create other gates because they lack the
inverting (NOT) function.

To change the type of gate, such as changing OR to AND, you must do three things:

Invert (NOT) each input.


Change the gate type (OR to AND, or AND to OR)
Invert (NOT) the output.

For example an OR gate can be built from NOTed inputs fed into a NAND (AND + NOT) gate.

NAND gate equivalents


The table below shows the NAND gate equivalents of NOT, AND, OR and NOR gates:
Gate

Equivalent in NAND gates

NOT

AND

OR

NOR

Substituting gates in an example logic system


The original system has 3 different gates: NOR, AND and OR. This requires three ICs (one for each type of gate).
To re-design this system using NAND gates only begin by replacing each gate with its NAND gate equivalent, as shown in
the diagram below.

Then simplify the system by deleting adjacent pairs of NOT gates (marked X above). This can be done because the
second NOT gate cancels the action of the first.
The final system is shown on the right. It has five NAND gates and requires two ICs (with four gates on each IC). This is
better than the original system which required three ICs (one for each type of gate).
Substituting NAND (or NOR) gates does not always increase the number of gates, but when it does (as in this example)
the increase is usually only one or two gates. The real benefit is reducing the number of ICs required by using just one
type of gate.

Introduction
Boolean functions may be practically implemented by using electronic gates. The following points are important to understand.

Electronic gates require a power supply.


Gate INPUTS are driven by voltages having two nominal values, e.g. 0V and 5V representing logic 0 and logic 1
respectively.
The OUTPUT of a gate provides two nominal values of voltage only, e.g. 0V and 5V representing logic 0 and logic 1
respectively. In general, there is only one output to a logic gate except in some special cases.
There is always a time delay between an input being applied and the output responding.

Logic gates
Digital systems are said to be constructed by using logic gates. These gates are the AND, OR, NOT, NAND, NOR, EXOR and
EXNOR gates. The basic operations are described below with the aid of truth tables.
AND gate

The AND gate is an electronic circuit that gives a high output (1) only if all its inputs are high. A dot (.) is used to show
the AND operation i.e. A.B. Bear in mind that this dot is sometimes omitted i.e. AB
OR gate

The OR gate is an electronic circuit that gives a high output (1) if one or more of its inputs are high. A plus (+) is used to
show the OR operation.

NOT gate

The NOT gate is an electronic circuit that produces an inverted version of the input at its output. It is also known as an
inverter. If the input variable is A, the inverted output is known as NOT A. This is also shown as A', or A with a bar over
the top, as shown at the outputs. The diagrams below show two ways that the NAND logic gate can be configured to
produce a NOT gate. It can also be done using NOR logic gates in the same way.

NAND gate

This is a NOT-AND gate which is equal to an AND gate followed by a NOT gate. The outputs of all NAND gates are high
if any of the inputs are low. The symbol is an AND gate with a small circle on the output. The small circle represents
inversion.
NOR gate

This is a NOT-OR gate which is equal to an OR gate followed by a NOT gate. The outputs of all NOR gates are low if any
of the inputs are high.
The symbol is an OR gate with a small circle on the output. The small circle represents inversion.
EXOR gate

The 'Exclusive-OR' gate is a circuit which will give a high output if either, but not both, of its two inputs are high. An
encircled plus sign ( ) is used to show the EOR operation.
EXNOR gate

The 'Exclusive-NOR' gate circuit does the opposite to the EOR gate. It will give a low output if either, but not both, of its two inputs
are high. The symbol is an EXOR gate with a small circle on the output. The small circle represents inversion.

The NAND and NOR gates are called universal functions since with either one the AND and OR functions and NOT can be generated.
Note:
A function in sum of products form can be implemented using NAND gates by replacing all AND and OR gates by NAND gates.
A function in product of sums form can be implemented using NOR gates by replacing all AND and OR gates by NOR gates.
Table 1: Logic gate symbols

Table 2 is a summary truth table of the input/output combinations for the NOT gate together with all possible input/output
combinations for the other gate functions. Also note that a truth table with 'n' inputs has 2n rows. You can compare the outputs of
different gates.
Table 2: Logic gates representation using the Truth table

Example
A NAND gate can be used as a NOT gate using either of the following wiring configurations.

(You can check this out using a truth table.)

You might also like