boolean expressions

30
Boolean Expressions Boolean Expressions Lecture 3 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007

Upload: amaya-kirk

Post on 30-Dec-2015

61 views

Category:

Documents


0 download

DESCRIPTION

Boolean Expressions. Lecture 3 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007. Logistics. Do the reading Handout Lecture Notes On web: Lab 1 solutions, Lab 2. Overview. Boolean Algebra K-maps X’s and Z’s. Boolean Expressions. - PowerPoint PPT Presentation

TRANSCRIPT

Boolean ExpressionsBoolean Expressions

Lecture 3Digital Design and Computer Architecture

Harris & HarrisMorgan Kaufmann / Elsevier, 2007

LogisticsLogistics

• Do the reading

• Handout– Lecture Notes– On web: Lab 1 solutions, Lab 2

OverviewOverview

• Boolean Algebra

• K-maps

• X’s and Z’s

Boolean ExpressionsBoolean Expressions

A B Y0 00 11 01 1

minterm

A BA BA B

A B

2.2.2 Sum-of-Products Form2.2.2 Sum-of-Products Form

Boolean ExpressionsBoolean Expressions

A + BA B Y

0 00 11 01 1

maxterm

A + BA + BA + B

2.2.3 Product-of-Sums Form2.2.3 Product-of-Sums Form

Boolean EquationsBoolean Equations

• You are going to the Hoch for lunch– You won’t eat lunch (E) if it’s not open (O) or– If they only serve corndogs (C)

• Write a truth table for determining if you will eat lunch (E).

SOP & POS FormSOP & POS Form

• SOP – sum-of-products

• POS – product-of-sums

O C E0 00 11 01 1

mintermO CO CO CO C

O + CO C Y

0 00 11 01 1

maxterm

O + CO + CO + C

SOP & POS FormSOP & POS Form

• SOP – sum-of-products

• POS – product-of-sums

A B Y0 00 11 01 1

minterm

A BA BA B

A B

A + BA B Y

0 00 11 01 1

maxterm

A + BA + BA + B

2.4 From Logic to Gates2.4 From Logic to Gates

• Fig. 2.23 shows Schematic of • It is an example of Gate Array

CBACBACBA

2.4 From Logic to Gates2.4 From Logic to Gates

• Two-level logic: 8 forms into 2 groups

Multiple Output CircuitsMultiple Output Circuits

A0

A1

PRIORITYENCODER

A2

A3

PriorityEncoder

Y0

Y1

Y2

Y3

A1 A0

0 00 11 01 1

0000

Y3 Y2 Y1 Y0

0000

0011

0100

A3 A2

0 00 00 00 0

0 0 0 1 0 00 10 11 01 10 0

0 10 10 11 0

0 11 01 01 10 00 1

1 01 01 11 1

1 01 11 11 1

0001

1110

0000

0000

1 0 0 01111

0000

0000

0000

1 0 0 01 0 0 0

Priority Encoder HardwarePriority Encoder Hardware

A1 A00 00 11 01 1

0000

Y3 Y2 Y1 Y0

0000

0011

0100

A3 A20 00 00 00 0

0 0 0 1 0 00 10 11 01 10 0

0 10 10 11 0

0 11 01 01 10 00 1

1 01 01 11 1

1 01 11 11 1

0001

1110

0000

0000

1 0 0 01111

0000

0000

0000

1 0 0 01 0 0 0

A3A2A1A0Y3

Y2

Y1

Y0

2.6 Don’t Cares2.6 Don’t Cares

A1 A00 00 11 01 1

0000

Y3 Y2 Y1 Y0

0000

0011

0100

A3 A20 00 00 00 0

0 0 0 1 0 00 10 11 01 10 0

0 10 10 11 0

0 11 01 01 10 00 1

1 01 01 11 1

1 01 11 11 1

0001

1110

0000

0000

1 0 0 01111

0000

0000

0000

1 0 0 01 0 0 0

A1 A0

0 00 11 XX X

0000

Y3 Y2 Y1 Y0

0001

0010

0100

A3 A2

0 00 00 00 1

X X 1 0 0 01 X

2.3.3 Boolean Axioms & Theorems2.3.3 Boolean Axioms & Theorems

Boolean Axioms & TheoremsBoolean Axioms & Theorems

無法靠直覺

• What is the Boolean expression for this circuit?

Bubble PushingBubble Pushing

AB

YCD

2.7 Karnaugh Maps (K-Maps)2.7 Karnaugh Maps (K-Maps)

• Sum-of-products (SOP) form can be tedious to simplify using Boolean algebra

• K-maps allow us to do the same thing graphically

A B Y0 0 00 1 01 0 11 1 1

Truth TableA

B0 1

0

1

0 1

0 1

YK-Map

m0

m3

3-input K-map3-input K-map

C 00 01

0

1

Y

11 10AB

ABC

ABC

ABC

ABC

ABC

ABC

ABC

ABC

1 0

B C Y0 0 00 1 01 01 1 1

Truth Table

C 00 01

0

1

Y

11 10ABA

0000

0 0 00 1 11 0 01 1 0

1111

0

1

1

0

0

0

1

K-Map

3-input K-map3-input K-map

C 00 01

0

1

Y

11 10AB

ABC

ABC

ABC

ABC

ABC

ABC

ABC

ABC

1 0

B C Y0 0 00 1 01 01 1 1

Truth Table

C 00 01

0

1

Y

11 10ABA

0000

0 0 00 1 01 0 01 1 1

1111

0

1

1

1

0

0

0

K-Map

A’B

BC’

K-map DefinitionsK-map Definitions

• Complement: variable with a bar over it

• Literal: variable or its complement

• Implicant: product of literals

• Prime implicant: implicant corresponding to the larges circle in the K-map

K-map RulesK-map Rules

• Each circle must span a power of 2 (i.e. 1, 2, 4) squares in each direction

• Each circle must be as large as possible• A circle may wrap around the edges of the K-

map• A one in a K-map may be circled multiple

times• A “don't care” (X) is circled only if it helps

minimize the equation

4-input K-map4-input K-map

01 11

1

0

0

1

0

0

1

101

1

1

1

1

0

0

0

1

11

10

AB00

00

10CD

Y

(m2) (m10)

(m15)

7-segment display7-segment display

• See example 2.10 for it. It is useful in implementing clock

2.6 Don’t Cares2.6 Don’t Cares

01 11

1

0

0

X

X

X

1

101

1

1

1

1

X

X

X

X

11

10

CD

AB00

00

10

Y

Contention: XContention: X

• Not don’t care• Not just 1’s and 0’s• Contention: X

A = 1

Y = X

B = 0

Floating: ZFloating: Z

Tri-state Buffer

E A Y0 0 Z0 1 Z1 0 01 1 1

A

E

Y

2.8 Building Blocks2.8 Building Blocks

• Multiplexer vs. Demultiplexer• Decoders vs. Encoder• Priority Encoder

Next TimeNext Time

• Timing• Hazards• Sequential Circuits