Sie sind auf Seite 1von 41

Digital Electronics

Principles & Applications


Seventh Edition

Roger L. Tokheim
Chapter 4

Using Logic Gates

2008 The McGraw-Hill Companies, Inc. All rights reserved.

INTRODUCTION
Logic Circuit from a Boolean expression

Minterm and maxterm Boolean expressions


Boolean expression from a truth table

Truth table from a Boolean expression


Simplifying Boolean expressions Karnaugh mapping NAND logic
2008 The McGraw-Hill Companies, Inc. All rights reserved.

INTRODUCTION (continued)
Data selectors and their use

Solving logic problems with data selectors


Using computer simulations Variations in Boolean expressions DeMorgans theorem PLDs (programmable logic devices) BASIC Stamp modules
2008 The McGraw-Hill Companies, Inc. All rights reserved.

Tools of the Trade for Solving Logic Problems


Gate symbols Truth tables Boolean expressions

Combinational logic circuits:


AND-OR pattern of gates

AND-OR pattern of gates


AB + CD = Y

from

Sum-of-products Boolean expression such as:

OR-AND pattern of gates

OR-AND pattern of gates


(A+B) (C+D) = Y

from

Product-of-sums Boolean expression such as:

2008 The McGraw-Hill Companies, Inc. All rights reserved.

Logic Circuit From Boolean Expression


Example: Draw the AND-OR logic diagram for the Boolean expression: AB + CD = Y
Step 1: OR AB with CD

Step 2: Add top AND gate

Step 3: Add bottom AND gate


2008 The McGraw-Hill Companies, Inc. All rights reserved.

QUIZ
Draw the OR-AND logic diagram for the Boolean expression: (A+B) (C+D) = Y Step 1:

Step 2:

Step 3:
2008 The McGraw-Hill Companies, Inc. All rights reserved.

Boolean Expressions
Sum-of-products form:
AB + CD =Y Also called the minterm form

Product-of-sums form:
(A + B) (C + D) = Y Also called the maxterm form
2008 The McGraw-Hill Companies, Inc. All rights reserved.

QUIZ
1. The Boolean expression AB + BC = Y is in __________ (product-of-sums, sum-ofproducts) form. 2. The Boolean expression (A+B) (B+C) + Y is in __________ (product-ofsums, sum-of-products) form. 3. The Boolean expression (A+B) (B+C) = Y is in __________ (maxterm, minterm) form. 4. The Boolean expression AB + BC = Y is in __________ (maxterm, minterm) form. sum-of-products

product-of-sums

maxterm

minterm

2008 The McGraw-Hill Companies, Inc. All rights reserved.

Boolean Expression from Truth Table


Write the Boolean expression that describes the logic in this truth table.

Truth Table Input Output ABC Y 000 0 001 0 010 1 011 0 100 0 101 0 110 0 111 1

Step 1: Focus only on the truth table lines with outputs of 1. Step 2: AND the inputs for these two lines and logically OR the ANDed groups.

ABC + ABC=Y

Minterm Boolean expression: A B C + A B C = Y


2008 The McGraw-Hill Companies, Inc. All rights reserved.

QUIZ
Truth Table Input Output ABC Y Write the Boolean expression that describes the logic in this truth table.

000 001 010 011 100 101 110 111

1 0 0 0 0 0 0 1

ABC + ABC=Y

Minterm Boolean expression: A B C + A B C = Y


2008 The McGraw-Hill Companies, Inc. All rights reserved.

QUIZ
Truth Table Input Output ABC Y 000 001 010 011 100 101 110 111 0 0 0 1 0 0 0 1

1. Write the sum-of-products Boolean expression for this truth table. ______________________________ ABC + ABC = Y

2. Write the minterm Boolean expression for this truth table. ______________________________ ABC + ABC = Y

2008 The McGraw-Hill Companies, Inc. All rights reserved.

Truth Table From Boolean Expressions


Fill in a truth table from a minterm Boolean Expression.
Minterm Boolean expression: ABC + ABC + ABC = Y

Step 1: Place three 1s in output column.

Truth Table Input Output ABC Y 000 001 010 011 100 101 110 111 1 0 0 1 0 0 1 0
2008 The McGraw-Hill Companies, Inc. All rights reserved.

Step 2: Place five 0s in blanks in output column of truth table.

Truth Table from Boolean Expressions


Fill in a truth table from a minterm Boolean Expression.
Minterm Boolean expression: AB + ABC =Y

Step 1: Place single 1 output column for term with three variables.
Step 2: Place two 1s in output column for term with two variables. Step 3: Fill in 0s.

Truth Table Input Output ABC Y 000 001 010 011 100 101 110 111 1 1 0 0 0 0 0 1
2008 The McGraw-Hill Companies, Inc. All rights reserved.

QUIZ
1. Fill in the output column of the truth table for the Boolean expression ABC + ABC = Y.

Truth Table Input Output ABC Y


000 001 010 011 100 101 110 111 1 0 0 0 0 0 1 0

2008 The McGraw-Hill Companies, Inc. All rights reserved.

QUIZ
1. Fill in the output column of the truth table for the Boolean expression AB + ABC = Y.

Truth Table Input Output ABC Y


000 001 010 011 100 101 110 111 1 1 0 0 0 1 0 0

2008 The McGraw-Hill Companies, Inc. All rights reserved.

Simplifying Boolean Expressions


Truth Table Input Output ABC Y Unsimplified Boolean Expression
ABC + ABC + ABC + ABC = Y

000 001 010 011 100 101 110 111

1 1 0 0 1 0 1 0

This line not be considered the loop. This line isis not toto be considered inin the loop.

Simplified Expression: AC + AB = Y

RULE: Eliminate term within loop that contains a term and its complement.
2008 The McGraw-Hill Companies, Inc. All rights reserved.

Simplify Boolean Expression


(Karnaugh map method)
Unsimplified Boolean expression (3 variables):

ABC + ABC + ABC + ABC = Y


_ C C

Step 1: Plot 1s Step 2: Loop groups Step 3: Eliminate variables Step 4: Form simplified minterm expression

_ _ AB _ AB AB _ AB

1 1
B C

Simplified Expression: A C + A B = Y
2008 The McGraw-Hill Companies, Inc. All rights reserved.

QUIZ
Simplify Boolean Expression (Karnaugh map method)
Unsimplified Boolean expression (4 variables):
ABCD + ABCD + ABCD + ABCD = Y Step 1: Plot 1s Step 2: Loop groups Step 3: Eliminate variables Step 4: Form simplified minterm expression
_ _ AB _ AB AB _ AB __ CD _ CD _ CD

CD

1 1
B D

Simplified Expression: ACD + ABC = Y

2008 The McGraw-Hill Companies, Inc. All rights reserved.

Developing a NAND Logic Diagram


Minterm expression: AB + AB = Y

Step 1: Draw AND-OR logic diagram from minterm expression.

Step 2: Substitute NAND gates for each inverter, AND, and OR gate.

NOTE: Both logic diagrams will generate the same truth table.
2008 The McGraw-Hill Companies, Inc. All rights reserved.

1-OF-8 Data Selector


Logic Symbol:
Data Selector 0 1 2 3 4 5 6 7

Data Inputs

W Output

B A

Data Select Inputs


2008 The McGraw-Hill Companies, Inc. All rights reserved.

QUIZ
What is the output from the data selector?
1-of-8 Data Selector
1 0 0 1 0 1 1 0 0 1 2 3 4 W 5 6 7 C B A

Data Inputs

?HIGH HIGH LOWH

Data Select Inputs:

0 1 1 0 1 0
2008 The McGraw-Hill Companies, Inc. All rights reserved.

QUIZ
Use the data selector to perform the logic described in the truth table
Truth Table
C B A Y

1-of-8 Data Selector


1 0 0 1 0 1 1 0 0 1 2 3 4 W 5 6 7 C B A

0 0 0 0 1 1 1 1

0 0 1 1 0 0 1 1

0 1 0 1 0 1 0 1

1 0 0 1 0 1 1 0

HIGH LOW

0 1 1 0 0 1
2008 The McGraw-Hill Companies, Inc. All rights reserved.

Circuit Simulation - Using the Logic Converter


Conversion options

Truth table area

Boolean expression area

Converts back and forth from Boolean expression, truth table, and Screen from Electronics Workbench or MultiSIM logic diagram
2008 The McGraw-Hill Companies, Inc. All rights reserved.

Truth Table to Boolean Expression


Step1: Click number of variables. Step2: Fill in truth table. Step3: Click truth table to Boolean expression conversion option.

Unsimplified Boolean Expression appears here

ABC+ABC+ABC+ABC+ABC

2008 The McGraw-Hill Companies, Inc. All rights reserved.

Simplifying the Boolean Expression


Step1: Click number of variables.

Step2: Fill in truth table.


Step3: Click truth table to simplified Boolean expression conversion option.

Simplified Boolean Expression appears here

AB + C

2008 The McGraw-Hill Companies, Inc. All rights reserved.

Boolean Expression to Logic Diagram


Step1: Type the Boolean expression. Step2: Click Boolean expression to logic diagram conversion option. Step3: Close Logic Converter window.

AB+C=Y is converted into this AND-OR logic diagram by the simulation software

AB + C

2008 The McGraw-Hill Companies, Inc. All rights reserved.

QUIZ
1. A circuit simulator such as Electronic Workbench or MultiSIM contain a useful instrument called a __________ (logic converter, logic probe) used to convert back and forth from truth table to Boolean expression. 2. The logic converter instrument from Electronic Workbench or MultiSIM can convert back and forth from logic diagram to Boolean expression. (True or False)

logic converter

True

2008 The McGraw-Hill Companies, Inc. All rights reserved.

Variations in Boolean Expressions


Boolean expression (textbook style):
AB C D = Y A+ + B = Y A B=Y

Boolean expression (keyboard style):


AB CD = Y (A+ + B) = Y A B = Y
2008 The McGraw-Hill Companies, Inc. All rights reserved.

QUIZ
1. The Boolean expression A B + C D = Y is written as _______ in keyboard style. 2. The Boolean expression A+B+C = Y is written as _______ in keyboard style.

A B + CD = Y

(A+B+C) = Y

3. The Boolean expression A B C = Y is written as _______ in keyboard style.

A B C = Y

2008 The McGraw-Hill Companies, Inc. All rights reserved.

DeMorgans Theorems
First theorem:
A+B=A
Both used

to eliminate Second long overbars

theorem:
A B=A+B

2008 The McGraw-Hill Companies, Inc. All rights reserved.

DeMorgans Theorems
First theorem:
A+B=A B

Second theorem:

A B=A+B

2008 The McGraw-Hill Companies, Inc. All rights reserved.

DeMorgans Theorems
START > A B=Y A B=Y
Step 1: Change all ORs to ANDs and all ANDs to ORs.

Step 2: Complement each individual variable (short overbar).

A+B=Y

Step 3: Complement the entire function (long overbar).

A+B=Y

Step 4: Eliminate all groups of double overbars.

FINISHED (alternative NAND expression)

(click to see final Boolean expression)

A+B=Y
2008 The McGraw-Hill Companies, Inc. All rights reserved.

QUIZ
1. The statement A B = A + B is DeMorgans __________ (first, second) theorem and suggests converting from a NAND to an OR situation. 2. The statement A + B = A B is DeMorgans __________ (first, second) theorem and suggests converting from a NOR to an AND situation.

second

first

2008 The McGraw-Hill Companies, Inc. All rights reserved.

PLDs
Programmable Logic Device (PLD) - The generic name for an IC that can be programmed by the user to execute a complex logic function. PLDs have many inputs and outputs. PLDs can be used to implement minterm Boolean expressions using AND-OR logic. More complex PLDs have latches and other memory devices.

PLDs have several advantages. PLDs are inexpensive, can be programmed by the user, and very reliable.
2008 The McGraw-Hill Companies, Inc. All rights reserved.

PLDs (continued)
PLD is generic for a programmable logic device, but are also known by many other names including: PAL - programmable array logic GAL - generic array logic

FPL - fuse-programmable logic


PLA - programmable logic array PEEL - programmable electrically erasable logic

FPGA - field programmable gate array


CPLD - complex programmable logic device

2008 The McGraw-Hill Companies, Inc. All rights reserved.

QUIZ
1. PLD is the generic name for a __________ (peripheral logic driver, programmable logic device) which is an IC that can solve logic problems. 2. PLDs commonly have many inputs but always have only one output. (True or False) 3. PLDs have several advantages including they can be programmed in the local lab or school, are very reliable, and inexpensive. (True or False) 4. Various manufacturers might refer to PLDs by acronyms like TTLs, CMOSs, PALs, ASCIIs, ASVABs, CPLSs, FPGAs, PEELs, or GALs. (True or False) programmable logic device

False

True

False

2008 The McGraw-Hill Companies, Inc. All rights reserved.

Programming Logic Functions using the BASIC Stamp Module


One trend in electronics is the development of programmable ICs. A second trend in electronics is the use of billions of inexpensive imbedded devices called microcontrollers. A popular microcontroller used by schools is the BASIC Stamp module, by Parallax, Inc. BASIC Stamp modules are programmable using a student-friendly version of B.A.S.I.C. Solving a logic problem using a microcontroller (BASIC Stamp 2 module) is detailed on the next slide.

2008 The McGraw-Hill Companies, Inc. All rights reserved.

Using the BASIC Stamp Module


Truth Table Step 3: Disconnect PC from BS2 module INPUTS RED GREEN YELLOW Step 1: Write program on PC in PBASIC. A B lines C of code Y1 are: Y2 Y3 Key 0 0Y1=(A&B&C)|(~A&~B&~C) 0 1 1 1 0 0Y2=(~A&~B)|(A&C) 1 0 1 1 0 1Y3=(~A)|(~B&C) 0 0 0 1 0 1 1 0 0 1 1 0 0 0 0 0 1 0 1 0 1 1 1 1 0 0 0 0 1 1 1 1 1 0

Digital Inputs

B C

Input A ==LOW Input A LOW Input A = HIGH Input B = LOW Input B = LOW Input B = LOW Input C = LOW Input C = HIGH Input C = LOW

Digital Outputs

Logic Expressions in PBASIC: Y1= (A&B&C)|(~A&~B&~C) Step Download program from Step 4: Power OFF and ON (BS2 module). Y2= 2: (~A&~B)|(A&C) PC BS2 module. Manipulate andto observe outputs. Y3=inputs (~A)|(~B&C)

Y1 Y2 Y3

HIGH LOW LOW

HIGH HIGH LOW

HIGH HIGH LOW

2008 The McGraw-Hill Companies, Inc. All rights reserved.

QUIZ
1. The BASIC Stamp module contains an inexpensive

programmable IC called a _____.


2. The BASIC Stamp module is programmed using a version of B.A.S.I.C. on a _____ (modem, PC) and then downloaded into the BS2 module.

microcontroller

PC (Personal Computer)

3. A BASIC Stamp (such as the BS2 module) will always have many inputs but only one output. (True or False) 4. Programming the BASIC Stamp module is done using an easy-to-use language called _____ (PBASIC, MICRO).

False

PBASIC

2008 The McGraw-Hill Companies, Inc. All rights reserved.

REVIEW
Logic Circuit from a Boolean expression

Minterm and maxterm Boolean expressions


Boolean expression from a truth table

Truth table from a Boolean expression


Simplifying Boolean expressions

Karnaugh mapping
NAND logic
2008 The McGraw-Hill Companies, Inc. All rights reserved.

REVIEW (continued)
Data selectors and their use Solving logic problems with data selectors Using computer simulations Variations in Boolean expressions DeMorgans theorem PLDs (programmable logic devices) BASIC Stamp modules
2008 The McGraw-Hill Companies, Inc. All rights reserved.

Das könnte Ihnen auch gefallen