0% found this document useful (0 votes)
37 views4 pages

Boolean Functions and Expressions Boolean Functions and Expressions

The document discusses Boolean functions and expressions. It defines how Boolean expressions are constructed recursively using variables, constants 0 and 1, and operators for negation, conjunction and disjunction. Boolean expressions represent Boolean functions, whose values are obtained by substituting 0 and 1 for the variables. Useful identities and principles like duality are discussed. Boolean algebras and their examples like sets and logic circuits are introduced. Common logic gates and circuits for addition are described. Methods for minimizing circuits like Karnaugh maps are also mentioned.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views4 pages

Boolean Functions and Expressions Boolean Functions and Expressions

The document discusses Boolean functions and expressions. It defines how Boolean expressions are constructed recursively using variables, constants 0 and 1, and operators for negation, conjunction and disjunction. Boolean expressions represent Boolean functions, whose values are obtained by substituting 0 and 1 for the variables. Useful identities and principles like duality are discussed. Boolean algebras and their examples like sets and logic circuits are introduced. Common logic gates and circuits for addition are described. Methods for minimizing circuits like Karnaugh maps are also mentioned.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

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.
27 Nov 2007 CS 320 1

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

27 Nov 2007

CS 320

Boolean Identities
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 753 [5th edition: page 705] in the textbook).

--x = x, law of double complement x+x = x,idempotent laws xx = x x+0 = x, identity laws x1 = x x+1 = 1, domination laws x0 = 0 x+y = y+x, commutative laws xy = yx
27 Nov 2007 CS 320 4

27 Nov 2007

CS 320

x+(y+z) = (x+y)+z, associative laws x(yz) = (xy)z x+yz = (x+y)(x+z), distributive laws x(y+z) = (xy)+(xz) -(xy) = -x + -y, De Morgans laws -(x+y) = (-x)(-y) x+xy = x, Absorption laws x(x+y) = x x+-x = 1, unit property x(-x) = 0, zero property
27 Nov 2007 CS 320 5 27 Nov 2007

Duality
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.

CS 320

Duality
Examples: The dual of x(y + z) is x + yz. The dual of -x1 + (-y + z) is (-x + 0)((-y)z). The dual is essentially the complement, but with any variable x replaced by -x. (ex. 29, p. 756) The dual of a Boolean function F represented by a Boolean expression is the function represented by the dual of this expression. This dual function, denoted by Fd, does not depend on the particular Boolean expression used to represent F. (exercise 30, page 756)
27 Nov 2007 CS 320 7

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).
27 Nov 2007 CS 320 8

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.

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 x (-x) = 1 and x (-x) = 0 (x y) z = x (y z) and (x y) z = x (y z) and (identity laws) (domination laws) (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)

27 Nov 2007

CS 320

27 Nov 2007

CS 320

10

Boolean Algebras
Examples of Boolean Algebras are: 1. The algebra of all subsets of a set U, with + = , = , - = complement, 0 = , 1 = U. 2. The algebra of propositions with symbols p1, p2,,pn, with + = , = , - = , 0 = F, 1 = T. 3. If B1, , Bn are Boolean Algebras, so is B1 .. Bn, with operations defined coordinate-wise.
27 Nov 2007 CS 320 11

Logic Gates
Electronic circuits consist of so-called gates. There are three basic types of gates. In each case the input is a Boolean expression and the output is another Boolean expression.

x x y x y
27 Nov 2007

-x x+y

inverter OR gate

xy
CS 320

AND gate
12

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

Multi switch light circuit


Suppose we want a circuit for a light controlled by two switches, where changing the state of either switch changes the state of the light (on or off). If we let x and y be the states of the switches (0 or 1) then the boolean expression xy + (-x)(-y) (- = complement) will do
the job.

x y
27 Nov 2007

-x

(-x)y

CS 320

13

27 Nov 2007

CS 320

14

Multi switch light circuit


This is because if both x and y are on (1) or off (0) xy + (-x)(-y) will be 1, and otherwise will be 0. We can generalize this method. For three switches the Boolean expression xyz + x(-y)(-z) + (-x)y(-z) + (-x)(-y)z will work. Can you draw circuits implementing these expressions? (see pp. 763, 764)
27 Nov 2007 CS 320 15

Adding binary integers


If we add two one bit integers x and y we get a sum for that bit position plus a carry bit. If we dont consider a carry bit from a lower bit addition we get whats called a half adder. If we do get consider an input carry bit we have a full adder. (see p. 765)
27 Nov 2007 CS 320 16

Half Adder
Given input bits x and y, the result bit will be x+y unless both x and y are 1, in which case the result is 0. This means that we can express the result bit as (x+y)(-(xy)), or (x+y)(-x + -y). The carry bit will be xy (we carry if both x and y are 1)
27 Nov 2007 CS 320 17

Full Adder
If we add a carry bit c0 from the previous order bit sum our result for this bit would be 1 if one or three of c0, x, y are 1, and 0 otherwise. This means xyc0+x(-y)(-c0)+(-x)y(-c0)+(-x)(-y)c0 would work, with carry bit xyc0+xy(-c0)+x(-y)c0+(-x)yc0 See p. 765 to check your implementation.
27 Nov 2007 CS 320 18

Minimizing Circuits
A Boolean function can be implemented by many different Boolean expressions. Disjunctive normal form, the sum-ofproducts expansion we got from the table of values of the expression, is often not the most efficient.
27 Nov 2007 CS 320 19

Minimizing Circuits
For example, the Boolean expression x1(-x2)x3 + x1x2x3 + (-x1)x3 = x1((-x2)+x2)x3 + (-x1)x3 = x1x3 + (-x1)x3 = (x1 + (-x1))x3 = x3 This last expression is a lot easier to compute. No gates required. Much simpler circuit.
27 Nov 2007 CS 320 20

Minimizing Circuits
Karnaugh Maps and the QuineMcCluskey Method are used for simplifying Boolean expressions. See section 11.4, page 766. Well do some examples on the board.
27 Nov 2007 CS 320 21

You might also like