1. Trang chủ
  2. » Giáo Dục - Đào Tạo

Digital design width CPLD Application and VHDL - Chapter 3 ppt

58 372 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Boolean Algebra and Combinational Logic
Trường học Standard University
Chuyên ngành Digital Design
Thể loại Bài tập
Thành phố City Name
Định dạng
Số trang 58
Dung lượng 449,04 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

• Explain the relationship between the Boolean expression, logic diagram,and truth table of a logic gate network and be able to derive any one fromeither of the other two.• Draw logic ga

Trang 1

• Explain the relationship between the Boolean expression, logic diagram,and truth table of a logic gate network and be able to derive any one fromeither of the other two.

• Draw logic gate networks in such a way as to cancel out internal inversionsautomatically (bubble-to-bubble convention)

• Write the sum of products (SOP) or product of sums (POS) forms of aBoolean equation

• Use rules of Boolean algebra to simplify the Boolean expressions derivedfrom logic diagrams and truth tables

• Apply the Karnaugh map method to reduce Boolean expressions and logiccircuits to their simplest forms

In Chapter 3, we will examine the rudiments of combinational logic A combinational

logic circuit is one in which two or more gates are connected together to combine eral Boolean inputs These circuits can be represented several ways, as a logic diagram,truth table, or Boolean expression

sev-A Boolean expression for a network of logic gates is often not in its simplest form Insuch a case, we may be using more components than would be required for the job, so it is

of benefit to us if we can simplify the Boolean expression Several tools are available to us,such as Boolean algebra and a graphical technique known as Karnaugh mapping We canalso simplify the Boolean expression by taking care to draw the logic diagrams in such away as to automatically eliminate inverting functions within the circuit ■

Trang 2

3.1 Boolean Expressions, Logic Diagrams and Truth Tables

Logic gate network Two or more logic gates connected together

Logic diagram A diagram, similar to a schematic, showing the connection oflogic gates

Combinational logic Digital circuitry in which an output is derived from thecombination of inputs, independent of the order in which they are applied

Combinatorial logic Another name for combinational logic

In Chapter 2, we examined the functions of single logic gates However, most digital cuits require multiple gates When two or more gates are connected together, they form a

cir-logic gate network These networks can be described by a truth table, a cir-logic diagram

(i.e., a circuit diagram), or a Boolean expression Any one of these can be derived from anyother

A digital circuit built from gates is called a combinational (or combinatorial) logic

circuit The output of a combinational circuit depends on the combination of inputs The

inputs can be applied in any sequence and still produce the same result For example, anAND gate output will always be HIGH if all inputs are HIGH, regardless of the order in

which they became HIGH This is in contrast to sequential logic, in which sequence

mat-ters; a sequential logic output may have a different value with two identical sets of inputs

if those inputs were applied in a different order We will study sequential logic in a laterchapter

Boolean Expressions from Logic Diagrams

Bubble-to-bubble convention The practice of drawing gates in a logic diagram

so that inverting outputs connect to inverting inputs and noninverting outputs nect to noninverting inputs

con-Order of precedence The sequence in which Boolean functions are performed,unless otherwise specified by parentheses

Writing the Boolean expression of a logic gate network is similar to finding the expressionfor a single gate The difference is that in a multiple gate network, the inputs will usuallynot consist of single variables, but compound expressions that represent outputs of previ-ous gates

These compound expressions are combined according to the same rules as single

vari-ables In an OR gate, with inputs x and y, the output will always be x  y regardless of

whether x and y are single variables (e.g., x  A, y  B, output  A  B) or compound

ex-pressions (e.g., x  AB, y  AC, output  AB  AC).

Figure 3.1 shows a simple logic gate network, consisting of a single AND and a

single OR gate The AND gate combines inputs A and B to give the output expression AB The OR combines the AND function and input C to yield the compound expression

Trang 3

3.1 • Boolean Expressions, Logic Diagrams and Truth Tables 59

❘❙❚ EXAMPLE 3.1 Derive the Boolean expression of the logic gate network shown in Figure 3.2a

CD

B

C D

AB

Y   CD

A B

C D

Y

a Logic gate network

b Boolean expression from logic gate network

the function of the circuit We will follow this notation, which we will refer to as the

bubble-to-bubble convention, as much as possible.

❘❙❚ EXAMPLE 3.2 Redraw the circuit in Figure 3.2 to conform to the bubble-to-bubble convention Write the

Boolean expression of the new logic diagram

Solution

B

C D

Figure 3.3 shows the new circuit The NAND has been converted to its DeMorganequivalent so that its active-HIGH output drives an active-HIGH input on the OR gate The

Boolean functions are governed by an order of precedence Unless otherwise

speci-fied, AND functions are performed first, followed by ORs This order results in a form ilar to that of linear algebra, where multiplication is performed before addition, unlessotherwise specified

sim-Solution

Trang 4

Figure 3.4 shows two logic diagrams, one whose Boolean expression requires theses and one that does not.

B

C

AB  AC AC

a No parentheses required (AND, then OR)

A B

A  B  C

b Parentheses required (OR, then AND)

FIGURE 3.4

Order of PrecedenceThe AND functions in Figure 3.4a are evaluated first, eliminating the need for paren-theses in the output expression The expression for Figure 3.4b requires parentheses sincethe ORs are evaluated first

❘❙❚ EXAMPLE 3.3 Write the Boolean expression for the logic diagrams in Figure 3.5

FIGURE 3.5

Example 3.5

Order of Precedence

A B

R

b.

3 2

1

3 2

Trang 5

3.1 • Boolean Expressions, Logic Diagrams and Truth Tables 61

Note that when two bubbles touch, they cancel out, as in the doubly inverted P input

or the connection between the outputs of gates 1 and 2 and the inputs of gate 3 In the sultant Boolean expression, bars of the same length cancel; bars of unequal length do not.

re-❘❙❚

❘❙❚ SECTION 3.1A REVIEW PROBLEM

3.1 Write the Boolean expression for the logic diagrams in Figure 3.6, paying attention tothe rules of order of precedence

A B

OUT

C D

a.

W X

Z Y

b.

Y

FIGURE 3.6

Section Review Problem 3.1

Logic Diagrams from Boolean Expressions

Levels of gating The number of gates through which a signal must pass from put to output of a logic gate network

in-Double-rail inputs Boolean input variables that are available to a circuit in bothtrue and complement form

Synthesis The process of creating a logic circuit from a description such as aBoolean equation or truth table

We can derive a logic diagram from a Boolean expression by applying the order of

prece-dence rules We examine an expression to create the first level of gating from the circuit

in-puts, then combine the output functions of the first level in the second level gates, and soforth Input inverters are often not counted as a gating level, as we usually assume that eachvariable is available in both true (noninverted) and complement (inverted) form When in-put variables are available to a circuit in true and complement form, we refer to them as

double-rail inputs.

The first level usually will be AND gates if no parentheses are present, OR gates ifparentheses are used (Not always, however; parentheses merely tell us which functions to

synthesize first.) Although we will try to eliminate bars over groups of variables by use of

DeMorgan’s theorems and the bubble-to-bubble convention, we should recognize that abar over a group of variables is the same as having those variables in parentheses

Let us examine the Boolean expression Y  AC  BD  AD Order of precedence

tells us that we synthesize the AND functions first This yields three 2-input AND gates,

with outputs AC, BD, and AD, as shown in Figure 3.7a In the next step, we combine these

AND functions in a 3-input OR gate, as shown in Figure 3.7b

K E Y T E R M S

Trang 6

When the expression has OR functions in parentheses, we synthesize the ORs first, as

for the expression Y  (A  B)(A  C  D)(B  C) Figure 3.8 shows this process In the

first step, we synthesize three OR gates for the terms (A  B), (A  C  D), and (B  C).

We then combine these terms in a 3-input AND gate

A B

Y (A B)(A C

a ORs first

b Combine ORs in an AND gate

C D

A B

1 Recall that a bar over two variables acts like parentheses Thus the QRS term is

synthe-sized from a NAND, then an AND, as shown in Figure 3.9a Also shown is the secondAND term, ST

Trang 7

3.1 • Boolean Expressions, Logic Diagrams and Truth Tables 63

Figure 3.9b shows the terms combined in an OR gate

a Combine inputs (NAND, then AND)

V

b Combine with ANDs (order of precedence)

c Find output (OR)

a ORs first (parentheses)

W

W

W

Z Y

V

Y V

(W

W

W

Z Y

V

W Y V

Trang 8

❘❙❚ EXAMPLE 3.5 Use DeMorgan’s theorem to modify the Boolean equation in part 1 of Example 3.4 so that

there is no bar over any group of variables Redraw Figure 3.9b to reflect the change

Solution

P  QRS  ST  Q(R  S)  ST

Figure 3.11a shows the modified logic diagram The levels of gating could be furtherreduced from three to two (not counting input inverters) by “multiplying through” theparentheses to yield the expression:

T

S

QR

Q R

S

T

QS ST

❘❙❚Truth Tables from Logic Diagrams or Boolean Expressions

There are two basic ways to find a truth table from a logic diagram We can examine theoutput of each gate in the circuit and develop its truth table We then use our knowledge ofgate properties to combine these intermediate truth tables into the final output truth table.Alternatively, we can develop a Boolean expression for the logic diagram and by examin-ing the expression fill in the truth table in a single step The former method is more thor-ough and probably easier to understand when you are learning the technique The lattermethod is more efficient, but requires some practice and experience We will look at both.Examine the logic diagram in Figure 3.12 Since there are three binary inputs, therewill be eight ways those inputs can be combined Thus, we start by making an 8-line truthtable, as in Table 3.1

FIGURE 3.12

Logic Diagram for AB  C

AB

A B

C

AB  C

Trang 9

3.1 • Boolean Expressions, Logic Diagrams and Truth Tables 65

The OR gate output will describe the function of the whole circuit In order to assessthe OR function, we must first evaluate the AND output We add a column to the truth table

for the AND gate and look for the lines in the table where both A AND B equal logic 1 (in

this case, the last two rows) For these lines, we write a 1 in the AB column Next, we look

at the values in column C and the AB column If there is a 1 in either column, we write a 1

in the column for the final output

Table 3.1 Truth Table for Figure 3.12

A B

C

Solution The Boolean equation for Figure 3.13 is (A   B)(A  C) We will create a

column for each input variable and for each term in parentheses, as well as a column for the

final output Table 3.2 shows the result For the lines where A OR B is 0, we write a 1 in the (A   B) column Where A OR C is 1, we write a 1 in the (A  C) column For the lines

where there is a 1 in both the (A   B) AND (A  C) columns, we write a 1 in the final

Trang 10

Another approach to finding a truth table involves analysis of the Boolean expression

of a logic diagram The logic diagram in Figure 3.14 can be described by the Boolean

ex-pression Y  ABC  A C   BD .

A B C

C

Y

FIGURE 3.15

Section Review Problem 3.2

We can examine the Boolean expression to determine that the final output of the cuit will be HIGH under one of the following conditions:

Trang 11

out-3.2 • Sum-of-Products and Product-of-Sums Forms 67

3.2 Sum-of-Products and Product-of-Sums Forms

Product term A term in a Boolean expression where one or more true or

comple-ment variables are ANDed (e.g., A  C ).

Minterm A product term in a Boolean expression where all possible variables

ap-pear once in true or complement form (e.g., A  B C ; A B C)

Sum term A term in a Boolean expression where one or more true or

comple-ment variables are ORed (e.g., A   B  D)

Maxterm A sum term in a Boolean expression where all possible variables

ap-pear once, in true or complement form (e.g., (A   B  C); (A  B  C)).

Sum-of-products (SOP) A type of Boolean expression where several product

terms are summed (ORed) together (e.g., A  B C   A B C  A B C).

Product-of-sums (POS) A type of Boolean expression where several sum terms

are multiplied (ANDed) together (e.g., (A   B  C)(A  B  C )(A  B  C))

Bus form A way of drawing a logic diagram so that each true and complementinput variable is available along a continuous conductor called a bus

Suppose we have an unknown digital circuit, represented by the block in Figure 3.16.All we know is which terminals are inputs, which are outputs, and how to connect thepower supply Given only that information, we can find the Boolean expression of theoutput

The first thing to do is find the truth table by applying all possible input combinations

in binary order and reading the output for each one Suppose the unknown circuit in Figure3.16 yields the truth table shown in Table 3.4

The truth table output is HIGH for three conditions:

1 When A AND B AND C are all LOW, OR

2 When A is LOW AND B AND C are HIGH, OR

3 When A is HIGH AND B AND C are LOW.

Each of those conditions represents a minterm in the output Boolean expression (A

minterm is a product term (AND term) that includes all variables (A, B, C ) in true or

com-plement form.) The minterms are:

1 A  B C

2 A  B C

3 A B  C

Trang 12

Since condition 1 OR condition 2 OR condition 3 produces a HIGH output from the

circuit, the Boolean function Y consists of all three minterms summed (ORed) together, as

follows:

Y  A B C   A B C  A B C

This expression is in a standard form called sum-of-products (SOP) form Figure

3.17 shows the equivalent logic circuit

FIGURE 3.17

Logic Circuit for Y  A  B  C   A BC  A B  C 

The inputs A, B, and C and their complements are shown in bus form Each variable

is available, in true or complement form, at any point along a conductor This is a useful,uncluttered notation for circuits that require several of the input variables more than once

We can derive an SOP expression from a truth table as follows:

1 Every line on the truth table that has a HIGH output corresponds to a minterm inthe truth table’s Boolean expression

2 Write all truth table variables for every minterm in true or complement form If avariable is 0, write it in complement form (with a bar over it); if it is 1, write it

in true form (no bar)

3 Combine all minterms in an OR function

❘❙❚ EXAMPLE 3.7 Tables 3.5 and 3.6 show the truth tables for the Exclusive OR and the Exclusive NOR

func-tions Derive the sum-of-products expression for each of these functions and draw the logicdiagram for each one

N O T E

Table 3.5 XOR Truth Table

Trang 13

3.2 • Sum-of-Products and Product-of-Sums Forms 69

Solution

XOR: The truth table yields two product terms: A B and AB Thus, the SOP form of the

XOR function is A  B  AB  AB Figure 3.18 shows the logic diagram for this

SOP Form of XNOR Function

We can also find the Boolean function of a truth table in product-of-sums (POS) form The product-of-sums form of a Boolean expression consists of a number of max-

terms (i.e., sum terms (OR terms) containing all variables in true or complement form)

that are ANDed together To find the POS form of Y, we will find the SOP expression for Y

and apply DeMorgan’s theorems

Recall DeMorgan’s theorems:

XNOR: The product terms for this function are: A  B and AB The SOP form of the XNOR

function is A B  A B  AB The logic diagram in Figure 3.19 represents the XNOR

Trang 14

Let’s reexamine Table 3.4 To find the sum-of-products expression for Y, we wrote a minterm for each line where Y  1 To find the SOP expression for Y, we must write a

minterm for each line where Y  0 Variables A, B, and C must appear in each minterm, in

true or complement form A variable is in complement form (with a bar over the top) if itsvalue is 0 in that minterm, and it is in true form (no bar) if its value is 1

We get the following minterms for Y :

Y

  A B C  A B C   A B C  A B C   A B C

To get Y in POS form, we must invert both sides of the above expression and apply

De-Morgan’s theorems to the righthand side

Y  Y  A B C  A B C   A B C  A B C   A B C

 (A B C)(A B C )(A B C)(A B C )(A B C)

 (A  B  C )(A  B  C)(A  B  C )(A  B  C)(A  B  C)

This Boolean expression can be implemented by the logic circuit in Figure 3.20

We don’t have to go through the whole process outlined above every time we want tofind the POS form of a function We can find it directly from the truth table, following the

FIGURE 3.20

Logic Circuit for Y  (A  B  C ) (A  B   C)(A   B  C ) (A   B   C)(A   B   C )

procedure summarized below Use this procedure to find the POS form of the expressiongiven by Table 3.4 The terms in this expression are the same as those derived by DeMor-gan’s theorem

Trang 15

3.2 • Sum-of-Products and Product-of-Sums Forms 71

Table 3.7 Truth Table for Example 3.8 (with minterms and maxterms)

Deriving a POS expression from a truth table:

1 Every line on the truth table that has a LOW output corresponds to a maxterm inthe truth table’s Boolean expression

2 Write all truth table variables for every maxterm in true or complement form If

a variable is 1, write it in complement form (with a bar over it); if it is 0, write it

in true form (no bar)

3 Combine all maxterms in an AND function

Note that these steps are all opposite to those used to find the SOP form ofthe Boolean expression

❘❙❚ EXAMPLE 3.8 Find the Boolean expression, in both SOP and POS forms, for the logic function

repre-sented by Table 3.7 Draw the logic circuit for each form

Trang 17

3.3 • Theorems of Boolean Algebra 73

❘❙❚ SECTION 3.2 REVIEW PROBLEM

3.3 Find the SOP and POS forms of the Boolean functions represented by the followingtruth tables

3.3 Theorems of Boolean Algebra

The main reason to learn Boolean algebra is to learn how to minimize the number of logicgates in a network Boolean expressions with many terms, such as those represented by thelogic diagrams in Figures 3.21 and 3.22, are seldom in their simplest form It is often pos-sible to apply some techniques of Boolean algebra to derive a simpler form of expressionthat requires fewer gates to implement

For example, the logic circuit in Figure 3.21 requires eight 4-input AND gates and

an 8-input OR gate Using Boolean algebra, we can reduce its Boolean expression to

Y  AD   A B C   A B D  A B C  This form can be implemented with 4 AND gates and

a 4-input OR You will use a simplification technique for this example in an chapter problem In the meantime, let us examine some basic rules of Boolean algebra.Commutative, Associative, and Distributive Properties

end-of-Commutative property A mathematical operation is commutative if it can be plied to its operands in any order without affecting the result For example, addition

ap-is commutative (a  b  b  a), but subtraction is not (a  b  b  a).

Associative property A mathematical function is associative if its operands can begrouped in any order without affecting the result For example, addition is associative

((a  b)  c  a  (b  c)), but subtraction is not ((a  b)  c  a  (b  c)).

Distributive property Full name: distributive property of multiplication over dition The property that allows us to distribute (“multiply through”) an AND

ad-across several OR functions For example, a(b  c)  ab  ac.

AND and OR functions are both commutative and associative The commutative property

states that AND and OR operations are independent of input order For inputs x and y,

Trang 18

The distributive property allows us to “multiply through” an AND function across

several OR functions For example,

C D

❘❙❚ EXAMPLE 3.9 Find the Boolean expression of the POS circuit in Figure 3.24a Apply the distributive

property to transform the circuit to an SOP form

FIGURE 3.23

Distributive Properties

Trang 19

3.3 • Theorems of Boolean Algebra 75

Solution The Boolean expression for Figure 3.24a is Y  (A  B)(C   D) Using the

distributive property, we get the expression Y  A C   BC   AD  BD The logic diagram

for this expression is shown in Figure 3.24b

In Example 3.9, we see that the distributive property can be used to convert a POScircuit to SOP or vice versa In this case, the circuit was not simplified, just trans-formed

❘❙❚ EXAMPLE 3.10 Write the Boolean expression for the circuit in Figure 3.25a Use the distributive property

to convert this to an SOP circuit

E F

Y

Y

A B

Solution The Boolean expression for Figure 3.25a is AB(C  D)(E  F) The

distribu-tive property can be applied in two stages:

Y  (ABC  ABD)(E  F)

 ABCE  ABCF  ABDE  ABDF

The logic diagram for this equation is shown in Figure 3.25b This results in a networkthat is “wider” (more gates on one level), but also “flatter” (fewer levels) The advantage ofthe second circuit is that signals would pass through the network faster, since it has fewer

Single-Variable TheoremsThere are thirteen theorems that can be used to manipulate a single variable in a Booleanexpression An easy way to remember these theorems is to divide them into three groups:

1 Six theorems: x AND/OR/XOR 0/1

2 Six theorems: x AND/OR/XOR x/ x

3 One theorem: Double Inversion

Trang 20

x AND/OR/XOR 0/1

The theorems in the first group can be generated by asking what happens when x, a

Boolean variable or expression, is at one input of an AND, an OR, or an XOR gate and a 0

or a 1 is at the other

Examine the truth table of the gate in question Hold one input of the gate constant andfind the effect of the other on the output This is the same procedure we used in Chapter 2

to examine the enable/inhibit properties of logic gates

Each of these six theorems can be represented by a logic gate, as shown in Figure 3.26

Trang 21

3.3 • Theorems of Boolean Algebra 77

Six theorems are generated by combining a Boolean variable or expression, x, with itself or

its complement in an AND, an OR, or an XOR function

Again, we can use the AND, OR, and XOR truth tables For the first three theorems,

we look only at the lines where both inputs are the same For the other three, we use thelines where the inputs are different

Trang 23

3.3 • Theorems of Boolean Algebra 79

Trang 24

DeMorgan’s Theorems

We have already seen DeMorgan’s theorems We will list them again, but will not commentfurther on them at this time

Theorem 20: x y  x  y

Theorem 21: xy  xyy

Other Multivariable Theorems

x  xy  x

❘❙❚ EXAMPLE 3.11 Simplify the following Boolean expressions, using Theorem 22 and other rules of Boolean

algebra Draw the logic circuits of the unsimplified and simplified expressions

Theorem 22 states x  xy  x Therefore K  KL  K.

b Let x  (A B), let y  CD:

Trang 25

3.3 • Theorems of Boolean Algebra 81

FIGURE 3.30

Example 3.11

Logic Circuits for Unsimplified and Simplified Expressions

❘❙❚

Trang 26

Theorem 23: (x  y)(x  z)  x  yz

Proof: (x  y)(x  z)  xx  xz  xy  yz (Distributive property)

 (x  xy)  xz  yz (xx  x; Associative property)

❘❙❚ EXAMPLE 3.12 Simplify the following Boolean expressions, using Theorem 23 and other rules of Boolean

algebra Draw the logic circuits of the unsimplified and simplified expressions

Trang 27

3.3 • Theorems of Boolean Algebra 83

Theorem 23: (x  y)(x  z)  x  yz

a Let x  M, let y  N , let z  P:

L  (x  y)(x  z)  x  yz  M  N  P

b Let x  A  B, let y  AB, let z  C:

Y  (x  y)(x  z)  x  yz  A B  ABC  A B  ABC

Here is another way to remember Theorem 24:

If a variable (x) is ORed with a term consisting of a different variable (y) AND the first variable’s complement (x ), the complement disappears.

x  xy  x  y

❘❙❚ EXAMPLE 3.13 Simplify the following Boolean expressions, using Theorem 24 and other rules of Boolean

algebra Draw the logic circuits of the unsimplified and simplified forms of the sions

Trang 29

3.3 • Theorems of Boolean Algebra 85

as their counterparts in ordinary algebra The single-variable theorems can be reasonedout by your knowledge of logic gate operation That leaves only five multivariabletheorems

Table 3.8 Theorems of Boolean Algebra

❘❙❚ SECTION 3.3 REVIEW PROBLEMS

3.4 Use theorems of Boolean algebra to simplify the following Boolean expressions

a Y  AC   (A  C )D

b Y  A  C   ACD

c Y  (AB  BC)(AB  C)

Ngày đăng: 14/08/2014, 10:22

TỪ KHÓA LIÊN QUAN