652
Boolean Algebra and Computer Logic
■
PraCtiCe 13
a. Rewrite the network of Figure 8.12 with NAND elements by directly replacing the AND gate,
OR gate, and inverter, as in Figure 8.17.
b. Rewrite the Boolean expression x 1 x 3 + x 2
′ for Figure 8.12 using De Morgan’s laws, and then
construct a network using only two NAND elements.
Constructing truth functions
We know how to write a Boolean expression and construct a network from a
given truth function. Often the truth function itself must first be deduced from the
description of the actual problem.
example 18
At a mail-order cosmetics firm, an automatic control device is used to supervise
the packaging of orders. The firm sells lipstick, perfume, makeup, and nail polish.
As a bonus item, shampoo is included with any order that includes perfume or any
order that includes lipstick, makeup, and nail polish. How can we design the logic
network that controls whether shampoo is packaged with an order?
The inputs to the network will represent the four items that can be ordered.
We label the items
x 1 = lipstick
x 2 = perfume
x 3 = makeup
x 4 = nail polish
The value of x i will be 1 when that item is included in the order and 0 otherwise.
The output from the network should be 1 if shampoo is to be packaged with the
order and 0 otherwise. The truth table for the circuit appears in Table 8.9. The canonical sum-of-products form for this truth function is lengthy, but the expression
x 1
x 1
x 2
1
1
0
0
(x 1 + x 2 )'
0
0
0
1
1
0
1
0
x 2
figure 8.18
Although we can construct a NAND network for a truth function by replacing
AND gates, OR gates, and inverters in the canonical form or a minimized form
with the appropriate NAND networks, we can often obtain a simpler network by
using the properties of NAND elements directly.
Boolean Algebra and Computer Logic
■
PraCtiCe 13
a. Rewrite the network of Figure 8.12 with NAND elements by directly replacing the AND gate,
OR gate, and inverter, as in Figure 8.17.
b. Rewrite the Boolean expression x 1 x 3 + x 2
′ for Figure 8.12 using De Morgan’s laws, and then
construct a network using only two NAND elements.
Constructing truth functions
We know how to write a Boolean expression and construct a network from a
given truth function. Often the truth function itself must first be deduced from the
description of the actual problem.
example 18
At a mail-order cosmetics firm, an automatic control device is used to supervise
the packaging of orders. The firm sells lipstick, perfume, makeup, and nail polish.
As a bonus item, shampoo is included with any order that includes perfume or any
order that includes lipstick, makeup, and nail polish. How can we design the logic
network that controls whether shampoo is packaged with an order?
The inputs to the network will represent the four items that can be ordered.
We label the items
x 1 = lipstick
x 2 = perfume
x 3 = makeup
x 4 = nail polish
The value of x i will be 1 when that item is included in the order and 0 otherwise.
The output from the network should be 1 if shampoo is to be packaged with the
order and 0 otherwise. The truth table for the circuit appears in Table 8.9. The canonical sum-of-products form for this truth function is lengthy, but the expression
x 1
x 1
x 2
1
1
0
0
(x 1 + x 2 )'
0
0
0
1
1
0
1
0
x 2
figure 8.18
Although we can construct a NAND network for a truth function by replacing
AND gates, OR gates, and inverters in the canonical form or a minimized form
with the appropriate NAND networks, we can often obtain a simpler network by
using the properties of NAND elements directly.
