49
Boolean Algebra

Chapter 8 - Stud

Embed Size (px)

Citation preview

Page 1: Chapter 8 - Stud

Boolean Algebra

Page 2: Chapter 8 - Stud

Understand about Boolean Algebra and its functions

Understand and apply the Logic gates Use the Karnaugh Maps for

simplification of sum-of-product expansions

Page 3: Chapter 8 - Stud

Introduction Boolean Expressions and Boolean

Functions Minterm and Maxterm Logic Gates Karnaugh Map

Page 4: Chapter 8 - Stud

Invented by and named after George Boole. Commonly, and especially in computer science and digital

electronics, this term is used to mean two-value logic. Provide the operations and rules for working with the set

{0,1}. Map logical propositions to symbols. Permit manipulation of logic statements using Mathematics. A Boolean algebra B consists of a set S containing distinct

elements 0 and 1, binary operators + and . on S, and a unary operator on S, we write B = (S, +, . , , 0, 1).

Note: • 0 and 1 in the foregoing definition are merely symbolic names.

In general, they have nothing to do with the numbers 0 and 1.• + and are merely binary operators. In general, they have nothing to do with

the ordinary addition and multiplication.

Introduction

Page 5: Chapter 8 - Stud

Boolean algebra deals with

- set of 2 elements {0, 1}- binary operators: OR ( / +), AND( / .) - unary operator NOT { / ‘ }

Rules:

/ +0 0 0

0 1 1

1 0 1

1 1 1

OR / .

0 0 0

0 1 0

1 0 0

1 1 1

AND

/ ‘0 0

1 1

NOT

Boolean Algebra

Page 6: Chapter 8 - Stud

Boolean functions can be represented using expressions made up from variables and Boolean operations.

Example:

rprqprqpF ),,(

zxyzxzyxF ),,(

Page 7: Chapter 8 - Stud

Example F(x, y, z) = xy’ + z is a Boolean function where xy’ + z is a Boolean expression.

The truth table for F(x, y, z) = xy’ + z is

x y z y’ xy’ xy’+z0 0 0 1 0 00 0 1 1 0 10 1 0 0 0 00 1 1 0 0 11 0 0 1 1 11 0 1 1 1 11 1 0 0 0 01 1 1 0 0 1

Page 8: Chapter 8 - Stud

Any boolean expression may be expressed in terms of either minterms or maxterms.

To do this we must first define the concept of a literal.

A literal is a single variable within a term which may or may not be complemented. For an expression with N variables, minterms and maxterms are defined as follows : A minterm is the product of N distinct literals where each

literal occurs exactly once. A maxterm is the sum of N distinct literals where each

literal occurs exactly once.

Page 9: Chapter 8 - Stud

For a two-variable expression, the minterms and maxterms are as follows

Page 10: Chapter 8 - Stud

For a three-variable expression, the minterms and maxterms are as follows

Page 11: Chapter 8 - Stud

Also known as sum-of-products expansion. The Sum of Products form represents an

expression as a sum of minterms. Sum of minterms corresponding to input

combinations for which the function produces a 1 as output.

Page 12: Chapter 8 - Stud

To derive the Sum of Products form from a truth table, OR together all of the minterms which give a value of 1.

Consider the truth table;

F(X,Y) = X.Y’ + X.Y

Page 13: Chapter 8 - Stud

Also known as product-of-sums expansion. The Product of Sums form represents an

expression as a product of maxterms. Product of maxterms corresponding to input

combinations for which the function produces a 0 as output.

Any Boolean Expression has a DNF and a CNF. Given a Boolean function, we can obtain the DNF

and CNF either by Truth table or Boolean identity laws.

Page 14: Chapter 8 - Stud

To derive the Product of Sums form from a truth To derive the Product of Sums form from a truth table, AND together all of the maxterms which table, AND together all of the maxterms which give a value of 0. give a value of 0.

Consider the truth table; Consider the truth table;

F(X,Y) = X + Y’

Page 15: Chapter 8 - Stud

Recall that a boolean equation can be represented by a Truth Table

A B C F 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 1

A truth table for a boolean function of N variables has 2N entries.

The ‘1’s represent F(A,B,C).

The ‘0’s represent F’(A,B,C)

Page 16: Chapter 8 - Stud

Can write SOP form of equation directly from truth table.

A B C F 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 1

A’BCAB’C’AB’CABC’ABC

F(A,B,C) = A’BC + AB’C’ + AB’C + ABC’ + ABC

Note that each term in has ALL variables present. If a product term has ALL variables present, it is a MINTERM.

Page 17: Chapter 8 - Stud

To get POS form of F, write SOP form of F’, then use DeMorgan’s Law.

A B C F 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 1

A’B’C’A’B’CA’BC’

F’(A,B,C) = A’B’C’ + A’B’C + A’BC’ Take complement of both sides:

(F’(A,B,C))’ = (A’B’C’ + A’B’C + A’BC’)’ Apply DeMorgan’s Law to right side. Left side is (F’)’ = F.

F(A,B,C) = (A’B’C’)’ (A’B’C)’ (A’BC’)’apply DeMorgan’s Law to each term

F(A,B,C) = (A+B+C) (A+B+C’)(A+B’+C)

POS Form!!

Page 18: Chapter 8 - Stud

We saw that:

F(A,B,C) = (A+B+C) (A+B+C’)(A+B’+C)

F(A,B,C) = A’BC + AB’C’ + AB’C + ABC’ + ABC’ + ABC

SOP form. If a product term has all variables present, it is a MINTERM.

POS form. If a sum term has all variables present, it is a MAXTERM.

All Boolean functions can be written in terms of either Minterms or Maxterms.

Page 19: Chapter 8 - Stud

Give the expression represented by the following truth table in both Sum of Products and Product of Sums forms.

Page 20: Chapter 8 - Stud

The basic element in a digital electronic system Performs a logical operation on one or more logic

inputs and produces a single logic output Because the output is also a logic-level value, an

output of one logic gate can connect to the input of one or more other logic gates.

The logic normally performed is Boolean logic and is most commonly found in digital circuits.

Logic gates are primarily implemented electronically using diodes or transistors,

Logic Gates

Page 21: Chapter 8 - Stud

OR AND NOT NOR NAND XOR

Page 22: Chapter 8 - Stud

Not Gate

Inputx

Outputx

Two inputs AND Gate

Outputxy

xx00 1111 00

x

xx yy00 00 0000 11 0011 00 0011 11 11

xy

Page 23: Chapter 8 - Stud

Outputx + y

xx yy x + yx + y00 00 0000 11 1111 00 1111 11 11

Two Inputs OR Gate

Page 24: Chapter 8 - Stud

NOR gate

NAND gate

Page 25: Chapter 8 - Stud

)( BAINPUT XORA B X=

0 0 0

0 1 1

1 0 1

1 1 0

XOR Gate

B)(A

Page 26: Chapter 8 - Stud
Page 27: Chapter 8 - Stud

Construct circuits that produce the following outputs:

Page 28: Chapter 8 - Stud

Find the output of the given circuit shown below and write the logic table:

Page 29: Chapter 8 - Stud

x y z0 0 00 0 10 1 00 1 11 0 01 0 11 1 01 1 1

29

(xy)’+(x’z)

Page 30: Chapter 8 - Stud

Karnaugh Maps (K-Maps) are a graphical method of visualizing the 0’s and 1’s of a boolean function K-Maps are very useful for performing Boolean

minimization. Will work on 2, 3, and 4 variable K-Maps in

this class. Karnaugh maps can be easier to use than

boolean equation minimization once you get used to it.

Karnaugh Map

Page 31: Chapter 8 - Stud

A K-map has a square for each ‘1’ or ‘0’ of a boolean function.

Two variable K-map has 22 =4 squaresThree variable K-map has 23 = 8 squaresFour variable K-map has 24 = 16 squares

2 variable 3 variable 4 variable

Page 32: Chapter 8 - Stud

In order to use a Karnaugh map, it is best if the Boolean expression is in Disjunctive Normal Form (DNF).

1. This means that every variable should be represented in every term (for a variable X, either X or ~X should be in every term) Ex: ABC v ~ABC v ~A~B~C is in DNF, but AC v ~ABC v

~A~B~C is not [no B in the first term]

2. The variables within a term are ANDed together, and the terms are ORed together. Ex: (AvBvC)(~AvBvC)(~Av~Bv~C) [variables ORed and terms ANDed instead of vice-versa]

3. There should be no parentheses Ex: ABC v ~A(BCv~B~C) [use of parenthesis] are not in DNF.

Page 33: Chapter 8 - Stud

Two-variable Two-variable mapmap

Ex:Ex: A’B’ v A’B v AB A’B’ v A’B v AB

Page 34: Chapter 8 - Stud

Two-variable Two-variable mapmap

Ex:Ex: A’B’ v A’B v AB A’B’ v A’B v ABA A’

B

B’ 1

11

0

Page 35: Chapter 8 - Stud

Two-variable map

Ex: ~A~B v ~AB v AB A A’

B

B’ 1

11

0

On a two-variable map, look for a pair of 1's that are either in the same row or column. If we find such a pair, we record the common variable.

= B+ A’

Page 36: Chapter 8 - Stud

Three-variable map Ex:

XY XY’ X’Y’ X’Y

Z

Z’

X’Y’Z’ v X’YZ v XYZ’ v XY’Z v XYZ v X’YZ’

Page 37: Chapter 8 - Stud

Three-variable map Ex:

XY XY’ X’Y’ X’Y

Z

Z’ 1

X’Y’Z’ v X’YZ v XYZ’ v XY’Z v XYZ v X’YZ’

1

1

11

1

Page 38: Chapter 8 - Stud

On a three-variable map we begin by looking for groups of four 1's.

The four squares must form a rectangle (i.e. four in a row or a 2x2 square) - 'L' shapes and zigzags aren't a valid group of 4.

Page 39: Chapter 8 - Stud

A group of four will have one common variable. A pair must have two common variables.

In the examples below, the common variable for the left map is ~C and the common variable for the right group is B.

Page 40: Chapter 8 - Stud

In the examples below, the left pair has the common variables BC, while the right pair has the common variables A~B.

Note that the common variables within a group of 1's are ANDed. A solo 1 must have all 3 variables.

Page 41: Chapter 8 - Stud

The map "wraps around" from the left edge to the right, like the center of a paper towel roll.

The common variables for the pair on the left are ~B~C, while the group of four on the right has the common variable ~B.

Page 42: Chapter 8 - Stud

Three-variable map Ex:

XY XY’ X’Y’ X’Y

Z

Z’ 1

X’Y’Z’ v X’YZ v XYZ’ v XY’Z v XYZ v X’YZ’

1

1

11

1

= Y + XZ + X’Z’

Page 43: Chapter 8 - Stud

Four-variable mapFour-variable map Ex: Ex: abcd’ v ab’cd v ab’cd’ v abcd v abcd’ v ab’cd v ab’cd’ v abcd v

a’b’d’c v a’b’d’c’ v a’b’dc v a’b’cd’ a’b’d’c v a’b’d’c’ v a’b’dc v a’b’cd’ v a’bcd v a’bc’d’ v a’bd’cv a’bcd v a’bc’d’ v a’bd’c

Page 44: Chapter 8 - Stud

Four-variable mapFour-variable map Ex:Ex: abcd’ v ab’cd v ab’cd’ v abcd v a’b’d’c v abcd’ v ab’cd v ab’cd’ v abcd v a’b’d’c v

a’b’d’c’ v a’b’dc v a’bcd v a’bc’d’ v a’bd’ca’b’d’c’ v a’b’dc v a’bcd v a’bc’d’ v a’bd’c

AB AB’ A’B’ A’B

CD

C’D

C’D’

CD’ 1

1

1

1

1

1

1 1

1

1

Page 45: Chapter 8 - Stud

On a four-variable map, begin by looking for groups of eight 1's. The eight squares must form a rectangle - odd shapes aren't a valid group of eight.

Next look for groups of four, then pairs, then solos.

A group of eight will have one common variable, a group of four will have two common variables, a pair will have three common variables, and a solo will have all four variables.

Page 46: Chapter 8 - Stud

The map "wraps around" from the left edge to the right, AND from top to bottom, kind of like a map of the world. This means groups can overlap the left and right, or top and bottom edges.

The four corners form a "double wraparound" group of four, with the common variables ~B~D:

Page 47: Chapter 8 - Stud

Four-variable mapFour-variable map Ex: abcd’ v ab’cd v ab’cd’ v abcd v a’b’d’c v

a’b’d’c’ v a’b’dc v a’bcd v a’bc’d’ v a’bd’c

AB AB’ A’B’ A’B

CD

C’D

C’D’

CD’ 1

1

1

1

1

1

1 1

1

1

= A’D’ + C

Page 48: Chapter 8 - Stud

QUESTIONSQUESTIONS

Write the minimize expression for

cda v c’d’a v da’c’ v cd’a’ v ad’c v adc’

Page 49: Chapter 8 - Stud

Construct a circuit to produce the following

output:

( ) ( ' ) 'ab c b d