• Tidak ada hasil yang ditemukan

Boolean Algebra

N/A
N/A
Protected

Academic year: 2025

Membagikan "Boolean Algebra"

Copied!
23
0
0

Teks penuh

(1)

DISCRETE STRUCTURES

Boolean Algebra

Boolean Algebra

(2)

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.

•We are going to focus on three operations:

• Boolean complementation,

• Boolean sum, and

• Boolean product

(3)

Boolean Operations

•The complement is denoted by a bar (on the slides, we will use a minus sign). It is defined by

•-0 = 1 and -1 = 0.

•The Boolean sum, denoted by + or by OR, has the following values:

•1 + 1 = 1, 1 + 0 = 1, 0 + 1 = 1, 0 + 0 = 0

•The Boolean product, denoted by  or by AND, has the following values:

•1  1 = 1, 1  0 = 0, 0  1 = 0, 0  0 = 0

(4)

Boolean Functions and Expressions

Definition: Let B = {0, 1}. The variable x is called a Boolean variable if it assumes values only from B.

•A function from Bn, the set {(x1, x2, …, xn) |xiB,

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

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

(5)

Boolean Functions and Expressions

•The Boolean expressions in the variables x1, x2, …, xn are defined recursively as follows:

• 0, 1, x1, x2, …, xn are Boolean expressions.

• If E1 and E2 are Boolean expressions, then (-E1), (E1E2), and (E1 + E2) are Boolean expressions.

•Each Boolean expression represents a Boolean function.

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

(6)

Boolean Functions and Expressions

•For example, we can create Boolean expression in the variables x, y, and z using the “building blocks”

0, 1, x, y, and z, and the construction rules:

•Since x and y are Boolean expressions, so is xy.

•Since z is a Boolean expression, so is (-z).

•Since xy and (-z) are expressions, so is xy + (-z).

•… and so on…

(7)

Boolean Functions and Expressions

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

11 11

0 0

0 0 0

0 11

0 0 11

11

0 0 0

0 0

0

F(x, y) F(x, y) yy

x x

Possible solution:

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

(8)

Boolean Functions and Expressions

Another Example:

Possible solution I:

Possible solution I:

F(x, y, z) =

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

0 0 0 0 11 11

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

11 0 0 11 0 0 zz 0

0 0

0

11 0

0

11 0

0

0 0 0

0

yy x

x

0 0 0 0 0 0 11

11 0 0 11 0 0 11

11

11 11

0 0 11

0 0 11

Possible solution II:

Possible solution II:

F(x, y, z) = (

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

(9)

Boolean Functions and Expressions

•There is a simple method for deriving a Boolean

expression for a function that is defined by a table. This method is based on minterms.

Definition: A literal is a Boolean variable or its

complement. A minterm of the Boolean variables x1, x2, …, xn is a Boolean product y1y2…yn, where yi = xi or yi = -xi.

•Hence, a minterm is a product of n literals, with one literal for each variable.

(10)

Boolean Functions and Expressions

•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 or x = y = z = 0 or x = y = 0, z = 1 or x = y = 0, z = 1 or x = 1, y = z = 0

x = 1, y = z = 0 Therefore,

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

x(--y)(y)(--z)z) 0

0 0 0 11 11

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

11 0 0 11 0 0 zz 0

0 0

0

11 0

0

11 0

0

0 0 0

0

yy x

x

0 0 0 0 0 0 11

11 0 0 11 0 0 11

11

11 11

0 0 11

0 0 11

(11)

Boolean Functions and Expressions

Definition: The Boolean functions F and G of n variables are equal if and only if F(b1, b2, …, bn) = G(b1, b2, …, bn) whenever b1, b2, …, bn belong to B.

•Two different Boolean expressions that represent the same function are called equivalent.

•For example, the Boolean expressions xy, xy + 0, and xy1 are equivalent.

(12)

Boolean Functions and Expressions

•The complement of the Boolean function F is the function –F, where –F(b1, b2, …, bn) =

-(F(b1, b2, …, bn)).

•Let F and G be Boolean functions of degree n. The Boolean sum F+G and Boolean product FG are then defined by

•(F + G)(b1, b2, …, bn) = F(b1, b2, …, bn) + G(b1, b2, …, bn)

•(FG)(b1, b2, …, bn) = F(b1, b2, …, bn) G(b1, b2, …, bn)

(13)

Boolean Functions and Expressions

Question: How many different Boolean functions of degree 1 are there?

Solution: There are four of them, F1, F2, F3, and F4:

0 0 11 F F33

11 0 0 F F22

11 0

0 11

11 0

0 0

0

F F44 F

F11 x

x

(14)

Boolean Functions and Expressions

Question: How many different Boolean functions of degree 2 are there?

Solution: There are 16 of them, F1, F2, …, F16:

11 0 0 0 0 0 0

F F22

0 0 0 0 0 0 0 0

F F11

0 0 11

0 0

11 0

0 11

0 0 11

11

0 0 0

0 0 0

F F33 yy

x x

11 11 11 0 0

F F88

0 0 11 11 0 0

F F77

0 0 0 0 0 0 11

F F99

0 0 0 0 11 0 0

F F55

11 11 0 0 0 0

F F44

11 0 0 11 0 0

F F66

0 0 11 0 0 11

F F1111

11 0 0 0 0 11

F F1010

0 0 11 11 11

F F1212

11 0 0 11 11

F F11

4 4

0 0 0 0 11 11

F F11

3 3

11 11 0 0 11

F F11

5 5

11 11 11 11

F F1616

(15)

Boolean Functions and Expressions

Question: How many different Boolean functions of degree n are there?

Solution:

•There are 2n different n-tuples of 0s and 1s.

•A Boolean function is an assignment of 0 or 1 to each of these 2n different n-tuples.

•Therefore, there are 22n different Boolean functions.

(16)

Duality

•There are useful identities of Boolean expressions that can help us to transform an expression A into an

equivalent expression B (see Table 5 on page 705 in the textbook).

•We can derive additional identities with the help of the dual of a Boolean expression.

•The dual of a Boolean expression is obtained by

interchanging Boolean sums and Boolean products and interchanging 0s and 1s.

(17)

Duality

Examples:

The dual of

The dual of x(y + z)x(y + z) isis x + yz.x + yz.

The dual of

The dual of --xx1 + (1 + (--y + z) y + z) isis ((--x + 0)((x + 0)((--y)z).y)z).

The

The dual of a Boolean function Fdual of a Boolean function F represented by represented by a Boolean expression is the function represented a Boolean expression is the function represented by the dual of this expression.

by the dual of this expression.

This dual function, denoted by F

This dual function, denoted by Fdd, , does not does not depend

depend on the particular Boolean expression used on the particular Boolean expression used to represent F.

to represent F.

(18)

Duality

•Therefore, an identity between functions represented by Boolean expressions remains valid when the duals of both sides of the identity are taken.

•We can use this fact, called the duality principle, to derive new identities.

•For example, consider the absorption law x(x + y) = x.

•By taking the duals of both sides of this identity, we obtain the equation x + xy = x, which is also an identity (and also called an absorption law).

(19)

Definition of a Boolean Algebra

•All the properties of Boolean functions and expressions that we have discovered also apply to other mathematical structures such as propositions and sets and the

operations defined on them.

•If we can show that a particular structure is a Boolean algebra, then we know that all results established about Boolean algebras apply to this structure.

•For this purpose, we need an abstract definition of a Boolean algebra.

(20)

Definition of a Boolean Algebra

Definition: A Boolean algebra is a set B with two binary operations  and , elements 0 and 1, and a unary

operation – such that the following properties hold for all x, y, and z in B:

•x  0 = x and x  1 = x (identity laws)

•x  (-x) = 1 and x  (-x) = 0 (domination laws)

•(x  y)  z = x  (y  z) and

(x  y)  z = x  (y  z) and (associative laws)

•x  y = y  x and x  y = y  x (commutative laws)

•x  (y  z) = (x  y)  (x  z) and

x  (y  z) = (x  y)  (x  z) (distributive laws)

(21)

Logic Gates

•Electronic circuits consist of so-called gates.

There are three basic types of gates:

x x yy

x+y

x+y OR gateOR gate

AND gate AND gate x

x xyxy

x

x --xx

inverter inverter

(22)

Logic Gates

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

xy + (

xy + (--x)yx)y x

x yy

xy xy

x

x --xx

yy

((--x)yx)y

(23)

Logic, Sets, and Boolean Algebra

Logic Set Boolean Algebra

•False  0

•True U 1

•AB AB AB

•AB AB A+B

•A AC

Compare the equivalence laws of them A

Referensi

Dokumen terkait

Dengan nilai x, y, w dan z yang sama dengan soal no.23, berikut ini adalah ekspresi boolean yang bernilai true ..... Sofware yang merupakan aplikasi pengolah vektor

Having the position of white pixels of the mask, the reading of X, Y and Z coordinates at the same positions in the XYZ file of the image gives a list of X, Y and

Remark: i the merging operator combines two sets X and Y into a set Z = X ∪ Y such that all of the nodes in Z are not distinguished and are allowed to re-group within Z in the future;

X·Y’ = X’ + Y’ Note: 10-11 are referred to as commutative laws 12-13 are referred to as associative laws 14-15 are referred to as distributive laws 16-17 are referred to as DeMorgan’s

Then X\O∪E is the set of all 3-digit natural numbers having at least one odd digit and at least one even digit.The desired sum is therefore X x∈X x−X y∈O y−X z∈E z.. Suppose the

a The following augmented matrices describe systems of equations with vari- ables x, y, z, and w.. In each case interpret the matrix and solve the

The aim of this paper is to handle the SAT problem for the formula over an arbitrary or big Boolean algebra[22, 23] by using a conventional method and a novel one for deriving

Chapter review „ Variety of primitive logic building blocks ‰ NOT, AND, OR, NAND, NOR, XOR and XNOR gates „ Axioms and theorems of Boolean algebra ‰ proofs by re-writing and perfect