Digital Systems - Chapter03.pdf

(932 KB) Pobierz
CHAPTER 3
DESCRIBING LOGIC
CIRCUITS
OUTLINE
3-1
Boolean Constants and
Variables
3-12
Universality of NAND Gates
and NOR Gates
3-2
Truth Tables
3-13
Alternate Logic-Gate
Representations
3-3
OR Operation with OR
Gates
3-14
Which Gate Representation
to Use
3-4
AND Operation with AND
Gates
3-15
IEEE/ANSI Standard Logic
Symbols
3-5
NOT Operation
3-16
Summary of Methods to
Describe Logic Circuits
3-6
Describing Logic Circuits
Algebraically
3-17
Description Languages
Versus Programming
Languages
3-7
Evaluating Logic-Circuit
Outputs
3-8
Implementing Circuits from
Boolean Expressions
3-18
Implementing Logic
Circuits with PLDs
3-9
NOR Gates and NAND
Gates
3-19
HDL Format and Syntax
3-20
Intermediate Signals
3-10
Boolean Theorems
3-11
DeMorgan’s Theorems
1257046305.047.png 1257046305.048.png 1257046305.049.png 1257046305.050.png 1257046305.001.png 1257046305.002.png 1257046305.003.png 1257046305.004.png 1257046305.005.png 1257046305.006.png 1257046305.007.png 1257046305.008.png
OBJECTIVES
Upon completion of this chapter, you will be able to:
Perform the three basic logic operations.
Describe the operation of and construct the truth tables for the AND,
NAND, OR, and NOR gates, and the NOT (INVERTER) circuit.
Draw timing diagrams for the various logic-circuit gates.
Write the Boolean expression for the logic gates and combinations of
logic gates.
Implement logic circuits using basic AND, OR, and NOT gates.
Appreciate the potential of Boolean algebra to simplify complex logic
circuits.
Use DeMorgan’s theorems to simplify logic expressions.
Use either of the universal gates (NAND or NOR) to implement a
circuit represented by a Boolean expression.
Explain the advantages of constructing a logic-circuit diagram using the
alternate gate symbols versus the standard logic-gate symbols.
Describe the concept of active-LOW and active-HIGH logic signals.
Draw and interpret the IEEE/ANSI standard logic-gate symbols.
Use several methods to describe the operation of logic circuits.
Interpret simple circuits defined by a hardware description language
(HDL).
Explain the difference between an HDL and a computer programming
language.
Create an HDL file for a simple logic gate.
Create an HDL file for combinational circuits with intermediate
variables.
INTRODUCTION
Chapters 1 and 2 introduced the concepts of logic levels and logic circuits.
In logic, only two possible conditions exist for any input or output: true and
false. The binary number system uses only two digits, 1 and 0, so it is perfect
for representing logical relationships. Digital logic circuits use predefined
voltage ranges to represent these binary states. Using these concepts, we
can create circuits made of little more than processed beach sand and wire
that make consistent, intelligent, logical decisions. It is vitally important
that we have a method to describe the logical decisions made by these cir-
cuits. In other words, we must describe how they operate. In this chapter,
we will discover many ways to describe their operation. Each description
55
 
1257046305.009.png 1257046305.010.png 1257046305.011.png 1257046305.012.png 1257046305.013.png
56
C HAPTER 3/ D ESCRIBING L OGIC C IRCUITS
method is important because all these methods commonly appear in techni-
cal literature and system documentation and are used in conjunction with
modern design and development tools.
Life is full of examples of circumstances that are in one state or an-
other. For example, a creature is either alive or dead, a light is either on or
off, a door is locked or unlocked, and it is either raining or it is not. In 1854,
a mathematician named George Boole wrote An Investigation of the Laws of
Thought, in which he described the way we make logical decisions based on
true or false circumstances. The methods he described are referred to today
as Boolean logic, and the system of using symbols and operators to describe
these decisions is called Boolean algebra. In the same way we use symbols
such as x and y to represent unknown numerical values in regular algebra,
Boolean algebra uses symbols to represent a logical expression that has one
of two possible values: true or false. The logical expression might be door is
closed, button is pressed, or fuel is low . Writing these expressions is very te-
dious, and so we tend to substitute symbols such as A, B, and C .
The main purpose of these logical expressions is to describe the rela-
tionship between a logic circuit’s output (the decision) and its inputs (the
circumstances). In this chapter, we will study the most basic logic circuits—
logic gates —which are the fundamental building blocks from which all other
logic circuits and digital systems are constructed. We will see how the oper-
ation of the different logic gates and the more complex circuits formed
from combinations of logic gates can be described and analyzed using
Boolean algebra. We will also get a glimpse of how Boolean algebra can be
used to simplify a circuit’s Boolean expression so that the circuit can be re-
built using fewer logic gates and/or fewer connections. Much more will be
done with circuit simplification in Chapter 4.
Boolean algebra is not only used as a tool for analysis and simplifica-
tion of logic systems. It can also be used as a tool to create a logic circuit
that will produce the desired input/output relationship. This process is
often called synthesis of logic circuits as opposed to analysis. Other tech-
niques have been used in the analysis, synthesis, and documentation of
logic systems and circuits including truth tables, schematic symbols, timing
diagrams, and—last but by no means least—language. To categorize these
methods, we could say that Boolean algebra is a mathematic tool, truth ta-
bles are data organizational tools, schematic symbols are drawing tools,
timing diagrams are graphing tools, and language is the universal descrip-
tion tool.
Today, any of these tools can be used to provide input to computers. The
computers can be used to simplify and translate between these various
forms of description and ultimately provide an output in the form neces-
sary to implement a digital system. To take advantage of the powerful bene-
fits of computer software, we must first fully understand the acceptable
ways for describing these systems in terms the computer can understand.
This chapter will lay the groundwork for further study of these vital tools
for synthesis and analysis of digital systems.
Clearly the tools described here are invaluable tools in describing, ana-
lyzing, designing, and implementing digital circuits. The student who ex-
pects to work in the digital field must work hard at understanding and
becoming comfortable with Boolean algebra (believe us, it’s much, much
easier than conventional algebra) and all the other tools. Do all of the ex-
amples, exercises, and problems, even the ones your instructor doesn’t
assign. When those run out, make up your own. The time you spend will be
well worth it because you will see your skills improve and your confidence
grow.
1257046305.014.png 1257046305.015.png 1257046305.016.png
57
S ECTION 3-2/ T RUTH T ABLES
3-1
BOOLEAN CONSTANTS AND VARIABLES
Boolean algebra differs in a major way from ordinary algebra because
Boolean constants and variables are allowed to have only two possible values,
0 or 1. A Boolean variable is a quantity that may, at different times, be equal
to either 0 or 1. Boolean variables are often used to represent the voltage
level present on a wire or at the input/output terminals of a circuit. For ex-
ample, in a certain digital system, the Boolean value of 0 might be assigned
to any voltage in the range from 0 to 0.8 V, while the Boolean value of 1 might
be assigned to any voltage in the range 2 to 5 V.*
Thus, Boolean 0 and 1 do not represent actual numbers but instead repre-
sent the state of a voltage variable, or what is called its logic level . A voltage
in a digital circuit is said to be at the logic 0 level or the logic 1 level, depend-
ing on its actual numerical value. In digital logic, several other terms are used
synonymously with 0 and 1. Some of the more common ones are shown in
Table 3-1. We will use the 0/1 and LOW/HIGH designations most of the time.
TABLE 3-1
Logic 0
Logic 1
False
True
Off
On
Low
High
No
Yes
Open switch
Closed switch
As we said in the introduction, Boolean algebra is a means for expressing
the relationship between a logic circuit’s inputs and outputs. The inputs are
considered logic variables whose logic levels at any time determine the out-
put levels. In all our work to follow, we shall use letter symbols to represent
logic variables. For example, the letter A might represent a certain digital
circuit input or output, and at any time we must have either
A
=
0
or
A
=
1:
if not one, then the other.
Because only two values are possible, Boolean algebra is relatively easy
to work with compared with ordinary algebra. In Boolean algebra, there are
no fractions, decimals, negative numbers, square roots, cube roots, loga-
rithms, imaginary numbers, and so on. In fact, in Boolean algebra there are
only three basic operations: OR, AND, and NOT.
These basic operations are called logic operations. Digital circuits called
logic gates can be constructed from diodes, transistors, and resistors con-
nected so that the circuit output is the result of a basic logic operation (OR,
AND, NOT) performed on the inputs. We will be using Boolean algebra first
to describe and analyze these basic logic gates, then later to analyze and de-
sign combinations of logic gates connected as logic circuits.
3-2
TRUTH TABLES
A truth table is a means for describing how a logic circuit’s output depends
on the logic levels present at the circuit’s inputs. Figure 3-1(a) illustrates a
truth table for one type of two-input logic circuit. The table lists all possible
*Voltages between 0.8 and 2 V are undefined (neither 0 nor 1) and should not occur under normal cir-
cumstances.
1257046305.017.png 1257046305.018.png
 
1257046305.019.png 1257046305.020.png 1257046305.021.png 1257046305.022.png 1257046305.023.png 1257046305.024.png
 
58
C HAPTER 3/ D ESCRIBING L OGIC C IRCUITS
FIGURE 3-1 Example
truth tables for (a) two-
input, (b) three-input, and
(c) four-input circuits.
Output
A
0
0
0
0
1
1
1
1
B
0
0
1
1
0
0
1
1
C
0
1
0
1
0
1
0
1
x
0
1
1
0
0
0
0
1
A
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
B
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
C
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
D
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
x
0
0
0
1
1
0
0
1
0
0
0
1
0
0
0
1
Inputs
A
0
0
1
1
B
0
1
0
1
x
1
0
1
0
(b)
A
B
x
?
(a)
(c)
combinations of logic levels present at inputs A and B, along with the corre-
sponding output level x . The first entry in the table shows that when A and B
are both at the 0 level, the output x is at the 1 level or, equivalently, in the 1
state. The second entry shows that when input B is changed to the 1 state, so
that and the output x becomes a 0. In a similar way, the table
shows what happens to the output state for any set of input conditions.
Figures 3-1(b) and (c) show samples of truth tables for three- and four-
input logic circuits. Again, each table lists all possible combinations of input
logic levels on the left, with the resultant logic level for output x on the right.
Of course, the actual values for x will depend on the type of logic circuit.
Note that there are 4 table entries for the two-input truth table, 8 entries
for a three-input truth table, and 16 entries for the four-input truth table.
The number of input combinations will equal 2 N for an N -input truth table.
Also note that the list of all possible input combinations follows the binary
counting sequence, and so it is an easy matter to write down all of the com-
binations without missing any.
A
=
0
B
=
1,
REVIEW QUESTIONS
1. What is the output state of the four-input circuit represented in Figure
3-1(c) when all inputs except B are 1?
2. Repeat question 1 for the following input conditions:
A
=
1, B
=
0, C
=
1,
D
=
0.
3. How many table entries are needed for a five-input circuit?
3-3
OR OPERATION WITH OR GATES
The OR operation is the first of the three basic Boolean operations to be
learned. An example can be found in the kitchen oven. The light inside the
oven should turn on if either the oven light switch is on OR if the door is
opened . The letter A could be used to represent the oven light switch is on and
B could represent door is opened. The letter x could represent the light is on.
The truth table in Figure 3-2(a) shows what happens when two logic inputs,
A and B, are combined using the OR operation to produce the output x .The
table shows that x is a logic 1 for every combination of input levels where one
or more inputs are 1. The only case where x is a 0 is when both inputs are 0.
1257046305.025.png 1257046305.026.png 1257046305.027.png 1257046305.028.png 1257046305.029.png 1257046305.030.png 1257046305.031.png 1257046305.032.png 1257046305.033.png 1257046305.034.png 1257046305.035.png 1257046305.036.png 1257046305.037.png 1257046305.038.png 1257046305.039.png 1257046305.040.png 1257046305.041.png 1257046305.042.png 1257046305.043.png 1257046305.044.png 1257046305.045.png 1257046305.046.png
Zgłoś jeśli naruszono regulamin