Файл: Digital design with CPLD applications and VHDL (R. Dueck, 2000).pdf
ВУЗ: Не указан
Категория: Не указан
Дисциплина: Не указана
Добавлен: 13.06.2025
Просмотров: 8066
Скачиваний: 6
2.4 • DeMorgan’s Theorems and Gate Equivalence |
39 |
SOLUTION
a.Boolean expression: Y A B
Shape: OR (at least one)
Input: HIGH Output: LOW
Descriptive sentence: Output Y is LOW if A OR B is HIGH.
Truth table: |
Table 2.12 |
Truth Table |
|
of Gate in Figure 2.24a. |
|||
A |
B |
Y |
|
0 |
0 |
1 |
|
0 |
1 |
0* |
|
1 |
0 |
0* |
|
1 |
1 |
0* |
|
b.Boolean expression: Y A B
Shape: AND (all)
Input: LOW Output: HIGH
Descriptive sentence: Output Y is HIGH if A AND B are LOW.
Truth table: |
Table 2.13 |
Truth Table |
|
of Gate in Figure 2.124b. |
|||
A |
B |
Y |
|
0 |
0 |
1* |
|
0 |
1 |
0 |
|
1 |
0 |
0 |
|
1 |
1 |
0 |
|
Both gates in this example yield the same truth table. Therefore they are DeMorgan
equivalents of one another (positiveand negative-NOR gates). |
|
The gates in Figures 2.22 and 2.24 yield the following algebraic equivalencies:
A B A BA B A B
These equivalencies are known as DeMorgan’s theorems. (You can remember how to use DeMorgan’s theorems by a simple rhyme: “Break the line and change the sign.”)
It is tempting to compare the first gate in Figure 2.22 and the second in Figure 2.24 and declare them equivalent. Both gates are AND-shaped, both have inversions. However, the comparison is false. The gates have different truth tables, as we have found in Tables 2.11 and 2.13. Therefore they have different logic functions and are not equivalent. The same is true of the OR-shaped gates in Figures 2.22 and 2.24. The gates may look similar, but since they have different truth tables, they have different logic functions and are therefore not equivalent.
The confusion arises when, after changing the logic input and output levels, you forget to change the shape of the gate. This is a common, but serious, error. These inequalities can be expressed as follows:
A B A BA B A B
40 |
C H A P T E R |
2 • Logic Functions and Gates |
|||||
As previously stated, any ANDor OR-shaped gate can be represented in its DeMor- |
|||||||
gan equivalent form. All we need to do is analyze a gate for its shape, input, and output, |
|||||||
then change everything. |
|||||||
EXAMPLE 2.3 |
Analyze the gate in Figure 2.25 and write a Boolean expression, descriptive sentence, and |
||||||
truth table for the gate. Mark active output levels on the truth table with asterisks. Find the |
|||||||
DeMorgan equivalent form of the gate and write its Boolean expression and description. |
|||||||
FIGURE 2.25 |
A |
||||||
Example 2.3: Logic Gates |
B |
Y |
|||||
C |
|||||||
SOLUTION
Boolean expression: Y A B C
Shape: OR (at least one)
Input: LOW
Output: LOW
Descriptive sentence: Output Y is LOW if A OR B OR C is LOW.
Truth table: |
Table 2.14 |
Truth Table |
|||
of Gate in Figure 2.25 |
|||||
A |
B |
C |
Y |
||
0 |
0 |
0 |
0* |
||
0 |
0 |
1 |
0* |
||
0 |
1 |
0 |
0* |
||
0 |
1 |
1 |
0* |
||
1 |
0 |
0 |
0* |
||
1 |
0 |
1 |
0* |
||
1 |
1 |
0 |
0* |
||
1 |
1 |
1 |
1 |
||
Figure 2.26 shows the DeMorgan equivalent form of the gate in Figure 2.25. To create this symbol, we change the shape from OR to AND and invert the logic levels at both input and output.
FIGURE 2.26 |
A |
||||
Example 2.3: DeMorgan |
B |
Y |
|||
Equivalent of Gate in |
C |
||||
Figure 2.25 |
Boolean expression: Y ABC
Descriptive sentence: Output Y is HIGH if A AND B AND C are HIGH.
SECTION 2.4 REVIEW PROBLEM
2.8 The output of a gate is described by the following Boolean expression:
Y A B C D
Write the Boolean expression for the DeMorgan equivalent form of this gate.
2.5 • Enable and Inhibit Properties of Logic Gates |
41 |
2.5 Enable and Inhibit Properties of Logic Gates
K E Y T E R M S
Digital signal (or pulse waveform) A series of 0s and 1s plotted over time.
True form Not inverted.
Complement form Inverted.
Enable A logic gate is enabled if it allows a digital signal to pass from an input to the output in either true or complement form.
Inhibit (or disable) A logic gate is inhibited if it prevents a digital signal from passing from an input to the output.
In phase Two digital waveforms are in phase if they are always at the same logic level at the same time.
Out of phase Two digital waveforms are out of phase if they are always at opposite logic levels at any given time.
In Chapter 1, we saw that a digital signal is just a string of bits (0s and 1s) generated over time. A major task of digital circuitry is the direction and control of such signals. Logic gates can be used to enable (pass) or inhibit (block) these signals. (The word “gate” gives a clue to this function; the gate can “open” to allow a signal through or “close” to block its passage.)
AND and OR Gates
The simplest case of the enable and inhibit properties is that of an AND gate used to pass or block a logic signal. Figure 2.27 shows the output of an AND gate under different conditions of input A when a digital signal (an alternating string of 0s and 1s) is applied to input B.
FIGURE 2.27
Enable/Inhibit Properties of an
AND Gate
Recall the properties of an AND gate: both inputs must be HIGH to make the output HIGH. Thus, if input A is LOW, the output must always be LOW, regardless of the state of input B. The digital signal applied to B has no effect on the output, and we say that the gate is inhibited or disabled. This is shown in the first half of the timing diagram in Figure 2.27.
If A AND B are HIGH, the output is HIGH. When A is HIGH and B is LOW, the output is LOW. Thus, output Y is the same as input B if input A is HIGH; that is, Y and B are in phase with each other. The input waveform is passed to the output in true form, and we say the gate is enabled. The last half of the timing diagram in Figure 2.27 shows this waveform.
It is convenient to define terms for the A and B inputs. Since we apply a digital signal to B, we will call it the Signal input. Since input A controls whether or not the signal
42 C H A P T E R 2 • Logic Functions and Gates
passes to the output, we will call it the Control input. These definitions are illustrated in Figure 2.28.
FIGURE 2.28
Control and Signal Inputs of an AND Gate
Table 2.15 AND Truth Table
Showing Enable/Inhibit
Properties
A |
B |
Y |
|
0 |
0 |
0 |
(Y 0) |
0 |
1 |
0 |
Inhibit |
1 |
0 |
0 |
(Y B) |
1 |
1 |
1 |
Enable |
Each type of logic gate has a particular set of enable/inhibit properties that can be predicted by examining the truth table of the gate. Let us examine the truth table of the AND gate to see how the method works.
Divide the truth table in half, as shown in Table 2.15. Since we have designated A as the Control input, the top half of the truth table shows the inhibit function (A 0), and the bottom half shows the enable function (A 1). To determine the gate properties, we compare input B (the Signal input) to the output in each half of the table.
Inhibit mode: If A 0 and B is pulsing (B is continuously going back and forth between the first and second lines of the truth table), output Y is always 0. Since the Signal input has no effect on the output, we say that the gate is disabled or inhibited.
Enable mode: If A 1 and B is pulsing (B is going continuously between the third and fourth lines of the truth table), the output is the same as the Signal input. Since the Signal input affects the output, we say that the gate is enabled.
EXAMPLE 2.4 |
Use the method just described to draw the output waveform of an OR gate if the input |
|||||
waveforms of A and B are the same as in Figure 2.27. Indicate the enable and inhibit por- |
||||||
tions of the timing diagram. |
||||||
SOLUTION Divide the OR gate truth table in half. Designate input A the Control input |
||||||
and input B the Signal input. |
||||||
As shown in Table 2.16, when A 0 and B is pulsing, the output is the same as B and |
||||||
the gate is enabled. When A 1, the output is always HIGH. (At least one input HIGH |
||||||
makes the output HIGH.) Since B has no effect on the output, the gate is inhibited. This is |
||||||
shown in Figure 2.29 in graphical form. |
||||||
Table 2.16 OR Truth Table |
||||||
Showing Enable/Inhibit |
||||||
Properties |
||||||
A |
B |
Y |
||||
0 |
0 |
0 |
(Y B) |
|||
0 |
1 |
1 |
Enable |
|||
1 |
0 |
1 |
(Y 1) |
|||
1 |
1 |
1 |
Inhibit |
|||
2.5 • Enable and Inhibit Properties of Logic Gates |
43 |
FIGURE 2.29
Example 2.4 OR Gate Enable/Inhibit Waveform
Example 2.4 shows that a gate can be in the inhibit state even if its output is HIGH. It is natural to think of the HIGH state as “ON,” but this is not always the case. Enable or inhibit states are determined by the effect the Signal input has on the gate’s output. If an input signal does not affect the gate output, the gate is inhibited. If the Signal input does affect the output, the gate is enabled.
NAND and NOR Gates
When inverting gates, such as NAND and NOR, are enabled, they will invert an input signal before passing it to the gate output. In other words, they transmit the signal in complement form. Figures 2.30 and 2.31 show the output waveforms of a NAND and a NOR gate when a square waveform is applied to input B and input A acts as a Control input.
FIGURE 2.30
Enable/Inhibit Properties of a
NAND Gate
FIGURE 2.31
Enable/Inhibit Properties of a
NOR Gate
44 C H A P T E R 2 • Logic Functions and Gates
Table 2.17 |
NAND Truth |
||
Table Showing Enable/Inhibit |
|||
Properties |
|||
A |
B |
Y |
|
0 |
0 |
1 |
(Y 1) |
0 |
1 |
1 |
Inhibit |
1 |
0 |
1 |
(Y B) |
1 |
1 |
0 |
Enable |
The truth table for the NAND gate is shown in Table 2.17, divided in half to show the enable and inhibit properties of the gate.
Table 2.18 shows the NOR gate truth table, divided in half to show its enable and inhibit properties.
Figures 2.30 and 2.31 show that when the NAND and NOR gates are enabled, the Signal and output waveforms are opposite to one another; we say that they are out of phase.
Compare the enable/inhibit waveforms of the AND, OR, NAND, and NOR gates. Gates of the same shape are enabled by the same Control level. AND and NAND gates are enabled by a HIGH on the Control input and inhibited by a LOW. OR and NOR are the opposite. A HIGH Control input inhibits the OR/NOR; a LOW Control input enables the gate.
Table 2.18 NOR Truth Table
Showing Enable/Inhibit
Properties
A |
B |
Y |
|
0 |
0 |
1 |
(Y B) |
0 |
1 |
0 |
Enable |
1 |
0 |
0 |
(Y 0) |
1 |
1 |
0 |
Inhibit |
Exclusive OR and Exclusive NOR Gates
Neither the XOR nor the XNOR gate has an inhibit state. The Control input on both of these gates acts only to determine whether the output waveform will be in or out of phase with the input signal. Figure 2.32 shows the dynamic properties of an XOR gate.
FIGURE 2.32
Dynamic Properties of an Exclusive OR Gate
Table 2.19 XOR Truth Table
Showing Dynamic Properties
A |
B |
Y |
|
0 |
0 |
0 |
(Y B) |
0 |
1 |
1 |
Enable |
1 |
0 |
1 |
(Y B) |
1 |
1 |
0 |
Enable |
The truth table for the XOR gate, showing the gate’s dynamic properties, is given in Table 2.19.
Notice that when A 0, the output is in phase with B and when A 1, the output is out of phase with B. A useful application of this property is to use an XOR gate as a programmable inverter. When A 1, the gate is an inverter; when A 0, it is a noninverting buffer.
The XNOR gate has properties similar to the XOR gate. That is, an XNOR has no inhibit state, and the Control input switches the output in and out of phase with the Signal waveform, although not the same way as an XOR gate does. You will derive these properties in one of the end-of-chapter problems.
Table 2.20 summarizes the enable/inhibit properties of the six gates examined above.
Table 2.20 Summary of Enable/Inhibit Properties
Control |
AND |
OR |
NAND |
NOR |
XOR |
XNOR |
A 0 |
Y 0 |
Y B |
Y 1 |
Y B |
Y B |
Y B |
A 1 |
Y B |
Y 1 |
Y B |
Y 0 |
Y B |
Y B |
SECTION 2.5 REVIEW PROBLEM
2.9Briefly explain why an AND gate is inhibited by a LOW Control input and an OR gate is inhibited by a HIGH Control input.