0% found this document useful (0 votes)
77 views7 pages

Application: Digital Logic Circuits: Only Connect!

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

Application: Digital Logic Circuits: Only Connect!

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

64 Chapter 2 The Logic of Compound Statements

2.4 Application: Digital Logic Circuits


Only connect! — E. M. Forster, Howards End

In the late 1930s, a young M.I.T. graduate student named Claude Shannon noticed an
analogy between the operations of switching devices, such as telephone switching
circuits, and the operations of logical connectives. He used this analogy with striking
success to solve problems of circuit design and wrote up his results in his master’s thesis,
which was published in 1938.
The drawing in Figure 2.4.1(a) shows the appearance of the two positions of a simple
switch. When the switch is closed, current can flow from one terminal to the other; when
it is open, current cannot flow. Imagine that such a switch is part of the circuit shown in
Figure 2.4.1(b). The light bulb turns on if, and only if, current flows through it. And this
happens if, and only if, the switch is closed.
MIT Museum

The symbol
denotes a battery and
Claude Shannon the symbol
(1916–2001)
Open Closed denotes a light bulb.
(a) (b)
Figure 2.4.1

Now consider the more complicated circuits of Figures 2.4.2(a) and 2.4.2(b).

P
P Q
Q

Switches “in series” Switches “in parallel”


(a) (b)
Figure 2.4.2

In the circuit of Figure 2.4.2(a) current flows and the light bulb turns on if, and only
if, both switches P and Q are closed. The switches in this circuit are said to be in series.
In the circuit of Figure 2.4.2(b) current flows and the light bulb turns on if, and only if, at
least one of the switches P or Q is closed. The switches in this circuit are said to be in
parallel. All possible behaviors of these circuits are described by Table 2.4.1.
Table 2.4.1
(a) Switches in Series (b) Switches in Parallel

Switches Light Bulb Switches Light Bulb


P Q State P Q State
closed closed on closed closed on
closed open off closed open on
open closed off open closed on
open open off open open off

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
2.4 Application: Digital Logic Circuits 67

Type of Symbolic
Gate Representation Action

Input Output
P R
NOT P NOT R
1 0
0 1

Input Output
P Q R
P 1 1 1
AND AND R
Q 1 0 0
0 1 0
0 0 0

Input Output
P Q R
P 1 1 1
OR OR R
Q 1 0 1
0 1 1
0 0 0

Figure 2.4.3

Rules for a Combinational Circuit


Never combine two input wires. 2.4.1
A single input wire can be split partway and used as input
for two separate gates. 2.4.2
An output wire can be used as input. 2.4.3
No output of a gate can eventually feed back into that gate. 2.4.4

Rule (2.4.4) is violated in more complex circuits, called sequential circuits, whose
output at any given time depends both on the input at that time and also on previous
inputs. These circuits are discussed in Section 12.2.

The Input/Output Table for a Circuit


If you are given a set of input signals for a circuit, you can find its output by tracing
through the circuit gate by gate.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68 Chapter 2 The Logic of Compound Statements

Example 2.4.1 Determining Output for a Given Input


Indicate the output of the circuits shown below for the given input signals.

a. Input signals: P = 0 and Q = 1

P NOT
AND R

b. Input signals: P = 1, Q = 0, R = 1
P
OR NOT
Q
AND S
R

Solution
a. Move from left to right through the diagram, tracing the action of each gate on the
input signals. The NOT-gate changes P = 0 to a 1, so both inputs to the AND-gate
are 1; hence the output R is 1. This is illustrated by annotating the diagram as shown
below.

0 1
P NOT 1
AND R
1
Q

b. The output of the OR-gate is 1 since one of the input signals, P, is 1. The NOT-gate
changes this 1 into a 0, so the two inputs to the AND-gate are 0 and R = 1. Hence the
output S is 0. The trace is shown below.
1
P 1 0
0 OR NOT
Q
0
1 AND S
R

To construct the entire input/output table for a circuit, trace through the circuit to find
the corresponding output signals for each possible combination of input signals.

Example 2.4.2 Constructing the Input/Output Table for a Circuit


Construct the input/output table for the following circuit.

P
OR R

Q NOT

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
2.4 Application: Digital Logic Circuits 69

Solution List the four possible combinations of input signals, and find the output for each
by tracing through the circuit.

Input Output
P Q R
1 1 1
1 0 1
0 1 0
0 0 1

CORBIS

George Boole
(1815–1864)
The Boolean Expression Corresponding to a Circuit
In logic, variables such as p, q and r represent statements, and a statement can have one
Note Strictly speaking, of only two truth values: T (true) or F (false). A statement form is an expression, such as
only meaningful
expressions such as
p ∧ (∼q ∨ r ), composed of statement variables and logical connectives.
(∼p ∧ q) ∨ ( p ∧ r ) and As noted earlier, one of the founders of symbolic logic was the English mathemati-
∼(∼( p ∧ q) ∨ r ) are cian George Boole. In his honor, any variable, such as a statement variable or an input
allowed as Boolean, not signal, that can take one of only two values is called a Boolean variable. An expres-
meaningless ones like sion composed of Boolean variables and the connectives ∼, ∧, and ∨ is called a Boolean
p ∼q((r s ∨ ∧ q ∼. We
use recursion to give a
expression.
careful definition of Given a circuit consisting of combined NOT-, AND-, and OR-gates, a correspond-
Boolean expressions in ing Boolean expression can be obtained by tracing the actions of the gates on the input
Section 5.9. variables.

Example 2.4.3 Finding a Boolean Expression for a Circuit


Find the Boolean expressions that correspond to the circuits shown below. A dot indicates
a soldering of two wires; wires that cross without a dot are assumed not to touch.

P P
OR AND
Q AND Q AND

AND NOT R NOT

(a) (b)

Solution
a. Trace through the circuit from left to right, indicating the output of each gate symbol-
ically, as shown below.

P P∨Q
OR (P ∨ Q) ∧ ~(P ∧ Q)
Q AND

P∧Q ~(P ∧ Q)
AND NOT

The final expression obtained, (P ∨ Q) ∧ ∼(P ∧ Q), is the expression for exclusive
or: P or Q but not both.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
70 Chapter 2 The Logic of Compound Statements

b. The Boolean expression corresponding to the circuit is (P ∧ Q) ∧ ∼R, as shown


below.

P P∧Q
AND (P ∧ Q) ∧~R
Q ~R AND

R NOT

Observe that the output of the circuit shown in Example 2.4.3(b) is 1 for exactly one
combination of inputs (P = 1, Q = 1, and R = 0) and is 0 for all other combinations of
inputs. For this reason, the circuit can be said to “recognize” one particular combination
of inputs. The output column of the input/output table has a 1 in exactly one row and 0’s
in all other rows.

• Definition
A recognizer is a circuit that outputs a 1 for exactly one particular combination of
input signals and outputs 0’s for all other combinations.

Input/Output Table for a Recognizer

P Q R ( P ∧ Q) ∧ ∼R
1 1 1 0
1 1 0 1
1 0 1 0
1 0 0 0
0 1 1 0
0 1 0 0
0 0 1 0
0 0 0 0

The Circuit Corresponding to a Boolean Expression


The preceding examples showed how to find a Boolean expression corresponding to a cir-
cuit. The following example shows how to construct a circuit corresponding to a Boolean
expression.

Example 2.4.4 Constructing Circuits for Boolean Expressions


Construct circuits for the following Boolean expressions.
a. (∼P ∧ Q) ∨ ∼Q b. ((P ∧ Q) ∧ (R ∧ S)) ∧ T
Solution
a. Write the input variables in a column on the left side of the diagram. Then go from
the right side of the diagram to the left, working from the outermost part of the
expression to the innermost part. Since the last operation executed when evaluating
(∼P ∧ Q) ∨ ∼Q is ∨, put an OR-gate at the extreme right of the diagram. One input
to this gate is ∼P ∧ Q, so draw an AND-gate to the left of the OR-gate and show its

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
2.4 Application: Digital Logic Circuits 71

output coming into the OR-gate. Since one input to the AND-gate is ∼P, draw a line
from P to a NOT-gate and from there to the AND-gate. Since the other input to the
AND-gate is Q, draw a line from Q directly to the AND-gate. The other input to the
OR-gate is ∼Q, so draw a line from Q to a NOT-gate and from the NOT-gate to the
OR-gate. The circuit you obtain is shown below.

P NOT
AND
Q OR

NOT

b. To start constructing this circuit, put one AND-gate at the extreme right for the ∧
between ((P ∧ Q) ∧ (R ∧ S)) and T . To the left of that put the AND-gate corre-
sponding to the ∧ between P ∧ Q and R ∧ S. To the left of that put the AND-gates
corresponding to the ∧’s between P and Q and between R and S. The circuit is shown
in Figure 2.4.4.

P
AND
Q AND
AND
R
AND
S

T
Figure 2.4.4 ■

It follows from Theorem 2.1.1 that all the ways of adding parentheses to
P ∧ Q ∧ R ∧ S ∧ T are logically equivalent. Thus, for example,

((P ∧ Q) ∧ (R ∧ S)) ∧ T ≡ (P ∧ (Q ∧ R)) ∧ (S ∧ T ).

It also follows that the circuit in Figure 2.4.5, which corresponds to


(P ∧ (Q ∧ R)) ∧ (S ∧ T ), has the same input/output table as the circuit in Figure 2.4.4,
which corresponds to ((P ∧ Q) ∧ (R ∧ S)) ∧ T .

Q AND
AND AND
R

S
AND
T
Figure 2.4.5

Each of the circuits in Figures 2.4.4 and 2.4.5 is, therefore, an implementation of
the expression P ∧ Q ∧ R ∧ S ∧ T . Such a circuit is called a multiple-input AND-gate
and is represented by the diagram shown in Figure 2.4.6. Multiple-input OR-gates are
constructed similarly.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
72 Chapter 2 The Logic of Compound Statements

P
Q
R AND
S
T
Figure 2.4.6

Finding a Circuit That Corresponds to a Given


Input/Output Table
To this point, we have discussed how to construct the input/output table for a circuit, how
to find the Boolean expression corresponding to a given circuit, and how to construct the
circuit corresponding to a given Boolean expression. Now we address the question of how
to design a circuit (or find a Boolean expression) corresponding to a given input/output
table. The way to do this is to put several recognizers together in parallel.

Example 2.4.5 Designing a Circuit for a Given Input/Output Table


Design a circuit for the following input/output table:

Input Output
P Q R S
1 1 1 1
1 1 0 0
1 0 1 1
1 0 0 1
0 1 1 0
0 1 0 0
0 0 1 0
0 0 0 0

Solution First construct a Boolean expression with this table as its truth table. To do this,
identify each row for which the output is 1—in this case, the first, third, and fourth rows.
For each such row, construct an and expression that produces a 1 (or true) for the exact
combination of input values for that row and a 0 (or false) for all other combinations of
input values. For example, the expression for the first row is P ∧ Q ∧ R because
P ∧ Q ∧ R is 1 if P = 1 and Q = 1 and R = 1, and it is 0 for all other values of P, Q,
and R. The expression for the third row is P ∧ ∼Q ∧ R because P ∧ ∼Q ∧ R is 1 if
P = 1 and Q = 0 and R = 1, and it is 0 for all other values of P, Q, and R. Similarly,
the expression for the fourth row is P ∧ ∼Q ∧ ∼R.
Now any Boolean expression with the given table as its truth table has the value 1 in
case P ∧ Q ∧ R = 1, or in case P ∧ ∼Q ∧ R = 1, or in case P ∧ ∼Q ∧ ∼R = 1, and
in no other cases. It follows that a Boolean expression with the given truth table is
(P ∧ Q ∧ R) ∨ (P ∧ ∼Q ∧ R) ∨ (P ∧ ∼Q ∧ ∼R). 2.4.5

The circuit corresponding to this expression has the diagram shown in Figure 2.4.7.
Observe that expression (2.4.5) is a disjunction of terms that are themselves conjunc-
tions in which one of P or ∼P, one of Q or ∼Q, and one of R or ∼R all appear. Such
expressions are said to be in disjunctive normal form or sum-of-products form.

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.

You might also like