yes, no, maybe

23
06/17/22 1 Yes, No, Maybe... Yes, No, Maybe... Boolean Boolean Algebra Algebra

Upload: aulii

Post on 21-Mar-2016

38 views

Category:

Documents


1 download

DESCRIPTION

Yes, No, Maybe. BooleanAlgebra. Boolean Algebra. Boolean algebra provides the operations and the rules for working with the set {0, 1}. These are the rules that underlie electronic circuits , and the methods we will discuss are fundamental to VLSI design . - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Yes, No, Maybe

04/24/23 1

Yes, No, Maybe...Yes, No, Maybe...

BooleanBooleanAlgebraAlgebra

Page 2: Yes, No, Maybe

04/24/23 2

Boolean AlgebraBoolean AlgebraBoolean algebra provides the operations and Boolean algebra provides the operations and the rules for working with the set the rules for working with the set {0, 1}.{0, 1}.These are the rules that underlie These are the rules that underlie electronic electronic circuitscircuits, and the methods we will discuss are , and the methods we will discuss are fundamental to fundamental to VLSI designVLSI design..We are going to focus on three operations:We are going to focus on three operations:• Boolean complementation,Boolean complementation,• Boolean sum, andBoolean sum, and• Boolean productBoolean product

Page 3: Yes, No, Maybe

04/24/23 3

Boolean OperationsBoolean OperationsThe The complementcomplement is denoted by a bar (on the is denoted by a bar (on the slides, we will use a minus sign). It is defined byslides, we will use a minus sign). It is defined by-0 = 1 and -1 = 0.-0 = 1 and -1 = 0.The The Boolean sumBoolean sum, denoted by + or by OR, has , denoted by + or by OR, has the following values:the following values:1 + 1 = 1, 1 + 0 = 1, 0 + 1 = 1, 0 + 0 = 01 + 1 = 1, 1 + 0 = 1, 0 + 1 = 1, 0 + 0 = 0The The Boolean productBoolean product, denoted by , denoted by or by or by AND, has the following values:AND, has the following values:1 1 1 = 1, 1 1 = 1, 1 0 = 0, 0 0 = 0, 0 1 = 0, 0 1 = 0, 0 0 = 0 0 = 0

Page 4: Yes, No, Maybe

04/24/23 4

Boolean Functions and ExpressionsBoolean Functions and ExpressionsDefinition:Definition: Let B = {0, 1}. The variable x is Let B = {0, 1}. The variable x is called a called a Boolean variableBoolean variable if it assumes values if it assumes values only from B.only from B.A function from BA function from Bnn, the set {(x, the set {(x11, x, x22, …, x, …, xnn) |x) |xiiB, B,

1 1 i i n}, to B is called a n}, to B is called a Boolean function Boolean function of degree nof degree n..

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

Page 5: Yes, No, Maybe

04/24/23 5

Boolean Functions and ExpressionsBoolean Functions and ExpressionsThe The Boolean expressionsBoolean expressions in the variables x in the variables x11, x, x22, , …, x…, xnn are defined recursively as follows: are defined recursively as follows:• 0, 1, x0, 1, x11, x, x22, …, x, …, xnn are Boolean expressions. are Boolean expressions.• If EIf E11 and E and E22 are Boolean expressions, then (-E are Boolean expressions, then (-E11), ), (E (E11EE22), and (E), and (E11 + E + E22) are Boolean expressions.) are Boolean expressions.

Each Boolean expression represents a Boolean Each Boolean expression represents a Boolean function. The values of this function are obtained function. The values of this function are obtained by substituting 0 and 1 for the variables in the by substituting 0 and 1 for the variables in the expression.expression.

Page 6: Yes, No, Maybe

04/24/23 6

Boolean Functions and ExpressionsBoolean Functions and ExpressionsFor example, we can create Boolean expression For example, we can create Boolean expression in the variables x, y, and z using the “building in the variables x, y, and z using the “building blocks”blocks”0, 1, x, y, and z, and the construction rules:0, 1, x, y, and z, and the construction rules:Since x and y are Boolean expressions, so is xy.Since x and y are Boolean expressions, so is xy.Since z is a Boolean expression, so is (-z).Since z is a Boolean expression, so is (-z).Since xy and (-z) are expressions, so is xy + (-Since xy and (-z) are expressions, so is xy + (-z).z).… … and so on…and so on…

Page 7: Yes, No, Maybe

04/24/23 7

Boolean Functions and ExpressionsBoolean Functions and ExpressionsExample:Example: Give a Boolean expression for the Give a Boolean expression for the Boolean function F(x, y) as defined by the Boolean function F(x, y) as defined by the following table:following table:

xx yy F(x, y)F(x, y)00 00 0000 11 1111 00 0011 11 00

Possible solution:Possible solution: F(x, y) = (-x) F(x, y) = (-x)yy

Page 8: Yes, No, Maybe

04/24/23 8

Boolean Functions and ExpressionsBoolean Functions and ExpressionsAnother Example:Another Example: Possible solution I:Possible solution I:

F(x, y, z) = -(xz + y)F(x, y, z) = -(xz + y)

00001111

F(x, y, z)F(x, y, z)

11001100zz

000011001100

0000yyxx

00000011

11001100

11111111

00110011

Possible solution II:Possible solution II:F(x, y, z) = (-(xz))(-y)F(x, y, z) = (-(xz))(-y)

Page 9: Yes, No, Maybe

04/24/23 9

Boolean Functions and ExpressionsBoolean Functions and ExpressionsThere is a simple method for deriving a Boolean There is a simple method for deriving a Boolean expression for a function that is defined by a expression for a function that is defined by a table. This method is based on table. This method is based on mintermsminterms..Definition:Definition: A A literal literal is a Boolean variable or is a Boolean variable or its complement. A its complement. A mintermminterm of the Boolean of the Boolean variables xvariables x11, x, x22, …, x, …, xnn is a Boolean product is a Boolean product yy11yy22…y…ynn, where y, where yii = x = xii or y or yii = -x = -xii..Hence, a minterm is a product of n literals, with Hence, a minterm is a product of n literals, with one literal for each variable.one literal for each variable.

Page 10: Yes, No, Maybe

04/24/23 10

Boolean Functions and ExpressionsBoolean Functions and ExpressionsConsider F(x,y,z) again:Consider F(x,y,z) again: F(x, y, z) = 1 if and F(x, y, z) = 1 if and

only if:only if:x = y = z = 0 orx = y = z = 0 orx = y = 0, z = 1 orx = y = 0, z = 1 orx = 1, y = z = 0x = 1, y = z = 0Therefore,Therefore,F(x, y, z) =F(x, y, z) =(-x)(-y)(-z) +(-x)(-y)(-z) +(-x)(-y)z +(-x)(-y)z +x(-y)(-z)x(-y)(-z)

00001111

F(x, y, z)F(x, y, z)

11001100zz

000011001100

0000yyxx

00000011

11001100

11111111

00110011

Page 11: Yes, No, Maybe

04/24/23 11

Boolean Functions and ExpressionsBoolean Functions and Expressions

Definition:Definition: The Boolean functions F and G of n The Boolean functions F and G of n variables are variables are equalequal if and only if F(b if and only if F(b11, b, b22, …, b, …, bnn) ) = G(b= G(b11, b, b22, …, b, …, bnn) whenever b) whenever b11, b, b22, …, b, …, bnn belong belong to B.to B.Two different Boolean expressions that Two different Boolean expressions that represent the same function are called represent the same function are called equivalentequivalent..For example, the Boolean expressions xy, xy + For example, the Boolean expressions xy, xy + 0, and xy0, and xy1 are equivalent.1 are equivalent.

Page 12: Yes, No, Maybe

04/24/23 12

Boolean Functions and ExpressionsBoolean Functions and Expressions

The The complement complement of the Boolean function F is the of the Boolean function F is the function –F, where –F(bfunction –F, where –F(b11, b, b22, …, b, …, bnn) = ) = -(F(b-(F(b11, b, b22, …, b, …, bnn)).)).Let F and G be Boolean functions of degree n. The Let F and G be Boolean functions of degree n. The Boolean sum F+GBoolean sum F+G and and Boolean product FGBoolean product FG are are then defined bythen defined by(F + G)(b(F + G)(b11, b, b22, …, b, …, bnn) = F(b) = F(b11, b, b22, …, b, …, bnn) + G(b) + G(b11, b, b22, , …, b…, bnn))(FG)(b(FG)(b11, b, b22, …, b, …, bnn) = F(b) = F(b11, b, b22, …, b, …, bnn) G(b) G(b11, b, b22, …, b, …, bnn))

Page 13: Yes, No, Maybe

04/24/23 13

Boolean Functions and ExpressionsBoolean Functions and ExpressionsQuestion:Question: How many different Boolean functions of How many different Boolean functions of degree 1 are there?degree 1 are there?Solution:Solution: There are four of them, F There are four of them, F11, F, F22, F, F33, and F, and F44::

xx FF11 FF22 FF33 FF44

00 00 00 11 11

11 00 11 00 11

Page 14: Yes, No, Maybe

04/24/23 14

Boolean Functions and ExpressionsBoolean Functions and ExpressionsQuestion:Question: How many different Boolean How many different Boolean functions of degree 2 are there?functions of degree 2 are there?Solution:Solution: There are 16 of them, F There are 16 of them, F11, F, F22, …, F, …, F1616::

11000000FF22

00000000FF11

001100110011001111

000000FF33yyxx

11111100FF88

00111100FF77

000000

11FF99

00001100FF55

11110000FF44

110011

00FF66

00110011FF1111

11000011FF1010

001111

11FF1212

11001111FF1414

00001111FF1313

111100

11FF1515

11111111FF1616

Page 15: Yes, No, Maybe

04/24/23 15

Boolean Functions and ExpressionsBoolean Functions and ExpressionsQuestion:Question: How many different Boolean How many different Boolean functions of degree n are there?functions of degree n are there?Solution:Solution: There are 2There are 2nn different n-tuples of 0s and 1s. different n-tuples of 0s and 1s.A Boolean function is an assignment of 0 or 1 A Boolean function is an assignment of 0 or 1 to each of these 2to each of these 2nn different n-tuples. different n-tuples.Therefore, there are Therefore, there are 2222nn different Boolean different Boolean functions.functions.

Page 16: Yes, No, Maybe

04/24/23 16

DualityDualityThere are useful identities of Boolean There are useful identities of Boolean expressions that can help us to transform an expressions that can help us to transform an expression A into an equivalent expression B expression A into an equivalent expression B (see Table 5 on page 597 in the textbook).(see Table 5 on page 597 in the textbook).We can derive additional identities with the We can derive additional identities with the help of the help of the dualdual of a Boolean expression. of a Boolean expression.The dual of a Boolean expression is obtained The dual of a Boolean expression is obtained by interchanging Boolean sums and Boolean by interchanging Boolean sums and Boolean products and interchanging 0s and 1s.products and interchanging 0s and 1s.

Page 17: Yes, No, Maybe

04/24/23 17

DualityDualityExamples:Examples:The dual of The dual of x(y + z)x(y + z) is is x + yz.x + yz.The dual of The dual of -x-x1 + (-y + z) 1 + (-y + z) isis (-x + 0)((-y)z).(-x + 0)((-y)z).

The The dual of a Boolean function Fdual of a Boolean function F represented represented by a Boolean expression is the function by a Boolean expression is the function represented by the dual of this expression.represented by the dual of this expression.This dual function, denoted by FThis dual function, denoted by Fdd, , does not does not dependdepend on the particular Boolean expression on the particular Boolean expression used to represent F.used to represent F.

Page 18: Yes, No, Maybe

04/24/23 18

DualityDualityTherefore, an identity between functions Therefore, an identity between functions represented by Boolean expressions represented by Boolean expressions remains remains validvalid when the duals of both sides of the when the duals of both sides of the identity are taken.identity are taken.We can use this fact, called the We can use this fact, called the duality duality principleprinciple, to derive new identities., to derive new identities.For example, consider the absorption law For example, consider the absorption law x(x + y) = xx(x + y) = x..By taking the duals of both sides of this By taking the duals of both sides of this identity, we obtain the equation identity, we obtain the equation x + xy = xx + xy = x, , which is also an identity (and also called an which is also an identity (and also called an absorption law).absorption law).

Page 19: Yes, No, Maybe

04/24/23 19

Definition of a Boolean AlgebraDefinition of a Boolean AlgebraAll the properties of Boolean functions and All the properties of Boolean functions and expressions that we have discovered also expressions that we have discovered also apply to apply to other mathematical structuresother mathematical structures such as propositions and sets and the such as propositions and sets and the operations defined on them.operations defined on them.If we can show that a particular structure is a If we can show that a particular structure is a Boolean algebra, then we know that all results Boolean algebra, then we know that all results established about Boolean algebras apply to established about Boolean algebras apply to this structure.this structure.For this purpose, we need an For this purpose, we need an abstract abstract definitiondefinition of a Boolean algebra. of a Boolean algebra.

Page 20: Yes, No, Maybe

04/24/23 20

Definition of a Boolean AlgebraDefinition of a Boolean AlgebraDefinition:Definition: A Boolean algebra is a set B with two A Boolean algebra is a set B with two binary operations binary operations and and , elements 0 and 1, and a , elements 0 and 1, and a unary operation – such that the following unary operation – such that the following properties hold for all x, y, and z in B:properties hold for all x, y, and z in B:x x 0 = x and x 0 = x and x 1 = x 1 = x (identity laws)(identity laws)x x (-x) = 1 and x (-x) = 1 and x (-x) = 0 (-x) = 0 (domination laws)(domination laws)(x (x y) y) z = x z = x (y (y z) and z) and (x (x y) y) z = x z = x (y (y z) and z) and (associative laws)(associative laws)x x y = y y = y x and x x and x y = y y = y x x (commutative laws)(commutative laws)x x (y (y z) = (x z) = (x y) y) (x (x z) and z) andx x (y (y z) = (x z) = (x y) y) (x (x z) z) (distributive laws)(distributive laws)

Page 21: Yes, No, Maybe

04/24/23 21

Logic GatesLogic GatesElectronic circuits consist of so-called gates.Electronic circuits consist of so-called gates.There are three basic types of gates:There are three basic types of gates:

xx

yyx+x+yy OR gateOR gate

AND gateAND gatexx

yyxyxy

xx -x-x inverterinverter

Page 22: Yes, No, Maybe

04/24/23 22

Logic GatesLogic GatesExample:Example: How can we build a circuit that How can we build a circuit that computes the function xy + (-x)y ?computes the function xy + (-x)y ?

xy + (-xy + (-x)yx)y

xx

yyxyxy

xx -x-x

yy(-x)y(-x)y

Page 23: Yes, No, Maybe

04/24/23 23

TheTheEndEnd