Docsity

Boolean Algebra and Logic Gates - Design and Analysis - Lecture Notes, Study notes of Digital Systems Design

Toggle sidebar
bg1
1
COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES
Chapter 2: Boolean Algebra and Logic Gates
NOTE: For more examples and detailed description of the material in the lecture
notes, please refer to the main textbook:
Digital Design 3rd Edition, By Morris Mano, Publisher Prentice Hall, 3rd Edition
All examples used in the lecture notes are from the above reference.
Definition of Boolean Algebra
- A set of elements denoted by B, together with two binary operators denoted by +
and . form a Boolean algebra if the following properties (Huntington postulates)
are satisfied:
1. (a) Closure w.r.t. the operator +. This means that for any , we obtain a
unique
Byx โˆˆ,
B
zโˆˆ by the operation
z
y
x
=
+
.
(b) Closure w.r.t. the operator .. This means that for any , we obtain a
unique
Byx โˆˆ,
B
zโˆˆ by the operation zy
x
=
..
2. (a) There exists an identity element in B w.r.t. +, denoted by 0. This means that
Bxxxx
โˆˆ
โˆ€=+=+ ,00 .
(b) There exists an identity element in B w.r.t. ., denoted by 1. This means that
.
Bxxxx โˆˆโˆ€== ,.11.
3. (a) Commutative w.r.t. +. This means that Byxxyyx โˆˆ
โˆ€
+
=
+
,, .
(b) Commutative w.r.t. .. This means that Byxxyyx
โˆˆ
โˆ€
=
,,.. .
4. (a) The operator . is distributive over the operator +. This means that
Bzyxzxyxzyx
โˆˆ
โˆ€
+=+ ,,),.().().( .
(b) The operator + is distributive over the operator .. This means that
Bzyxzxyxzyx
โˆˆ
โˆ€
++=+ ,,),).(().( .
5. For every element , there exists a complement element with the
following properties: (a)
BxโˆˆBx โˆˆ'
1'
=
+
xx and (b) 0'.
=
xx .
6. There exist at least two distinct elements in
B
.
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Boolean Algebra and Logic Gates - Design and Analysis - Lecture Notes and more Study notes Digital Systems Design in PDF only on Docsity!

COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES

Chapter 2: Boolean Algebra and Logic Gates NOTE: For more examples and detailed description of the material in the lecture notes, please refer to the main textbook: Digital Design 3rd Edition, By Morris Mano, Publisher Prentice Hall, 3rd Edition All examples used in the lecture notes are from the above reference.

Definition of Boolean Algebra

  • A set of elements denoted by B , together with two binary operators denoted by + and. form a Boolean algebra if the following properties (Huntington postulates) are satisfied:
  1. (a) Closure w.r.t. the operator +. This means that for any , we obtain a unique

x , y โˆˆ B z โˆˆ B by the operation x^ +^ y = z. (b) Closure w.r.t. the operator.. This means that for any , we obtain a unique

x , y โˆˆ B z โˆˆ B by the operation x. y = z.

  1. (a) There exists an identity element in B w.r.t. +, denoted by 0. This means that x + 0 = 0 + x = x , โˆ€ x โˆˆ B. (b) There exists an identity element in B w.r.t.. , denoted by 1. This means that x. 1 = 1. x = x , โˆ€ x โˆˆ B.
  2. (a) Commutative w.r.t. +. This means that x + y = y + x , โˆ€ x , y โˆˆ B. (b) Commutative w.r.t... This means that x. y = y. x , โˆ€ x , y โˆˆ B.
  3. (a) The operator. is distributive over the operator +. This means that x .( y + z )=( x. y )+( x. z ), โˆ€ x , y , z โˆˆ B. (b) The operator + is distributive over the operator.. This means that x + ( y. z )=( x + y ).( x + z ), โˆ€ x , y , z โˆˆ B.
  4. For every element , there exists a complement element with the following properties: (a)

x โˆˆ B x 'โˆˆ B x + x '= 1 and (b) x. x '= 0.

  1. There exist at least two distinct elements in B.
  • In order to have a Boolean algebra, one must show:
    1. the elements of the set B ,
    2. the rules of operation for the two binary operators, and
    3. that the set of elements, B , together with the two operators, satisfy the above properties.

Two-Valued Boolean Algebra

  • A two-valued Boolean algebra is defined on a set of two elements, , with

the rules for binary operators given below:

B ={ 0 , 1 }

x y x.y 0 0 0 0 1 0 1 0 0 1 1 1

x y x+y 0 0 0 0 1 1 1 0 1 1 1 1

  • It can be easily verified that the above operators and the set B satisfy properties 1 to 4 and property 6 of Boolean algebra.
  • For example, to show that the operator. is distributive over + (Property 4(a)), we can use the following truth table: x y z 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1

y+z x. ( y+z ) 0 1 1 1 0 1 1 1 0 0 0 0 0 1 1 1

x.y x.z ( x.y ) + ( x.z ) 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 1

= x + x ' = 1

  • Part (b) of this theorem can be proved in a similar way as above, or by using the duality principle.
  • Involution Theorem: ( x ')'= x
  • We can prove this theorem by using the fact that x is the complement of and that the complement is unique.

x '

  • Associative Theorem: (a) (^) x + ( y + z )=( x + y )+ z (b) (^) x .( y. z )=( x. y ). z
  • This theorem can easily be proved by using a truth table (the algebraic proof is long).
  • DeMorganโ€™s Theorem: (a) ( x + y )'= x '. y ' (b) ( x. y )'= x '+ y '
  • This theorem can easily be proved by using a truth table (the algebraic proof is long).
  • Absorption Theorem: (a) x + x. y = x (b) x .( x + y )= x
  • Part (a) of this theorem can be proved by replacing x with x. 1 and using the distributive property of. over +.
  • Part (b) can be proved by using the duality principle or by replacing x with x +0 and using the distributive property of + over..
  • Combining Theorem: (a) ( x + y ).( x + y ')= x (b) x. y + x. y '= x
  • Part (a) can be proved by using distributive property of + over..
  • Part (b) can be proved by using the duality principle or by using the distributive property of. over +.
  • The operator precedence for evaluating a Boolean expression is (1) parentheses, (2) complement, (3) the operator. , and (4) the operator +.

Boolean Functions

  • Boolean function can be represented by an expression (consisting of binary variables, the constants 0 and 1).
  • It can also be represented by a truth table.
  • For example consider the function F 1 represented by the expression:

F 1 (^) = x + y '. z

  • The function F 1 is equal to either 1 or 0, depending on the value of x , y , z.
  • This can be shown in the following truth table:

x y z F 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 0 1 1 1 1

  • In general, the truth table has rows, where is the number of variables used in the function expression.

2^ n n

  • It gives all different combinations of binary values for each variable. Each

combination represents a binary number between 0 and 2 n^ โˆ’ 1.

  • A Boolean expression can also be implemented by logic gates.
  • The. and + operators are represented by AND and OR gates, respectively.
  • The complement is represented by a NOT gate or inverter.
  • As an example, the function F 1 can be implemented as follows:
  • This implies that and are equivalent. This can also be shown by using the

properties of Boolean algebra as follows:

F 2 F 3

F 2 (^) = x '. y '. z + x '. y. z + x. y '= x '. z .( y '+ y )+ x. y '= x '. z + x. y '= F 3

  • The function can be implemented by using three AND gates and one OR gate

(and two inverters) while the function can be implemented by using only two AND gates and one OR gate.

F 2

F 3

  • Fewer gates means a more efficient design (less wires and components and higher speed).
  • Each variable within a term in a Boolean algebra is called a literal.
  • For example the function has three terms and eight literals, while the function

has two terms and four literals.

F 2 F 3

  • By reducing the number of terms and/or literals, the implementation of the expression will be simplified.

Example x + x '. y =( x + x ').( x + y )= 1 .( x + y )= x + y (an expression with two terms and three

literals is reduced to an expression with two terms and two literals).

x. y + x '. z + y. z = x. y + x '. z + y. z .( x + x ' ) = x. y + x '. z + x. y. z + x '. y. z = x. y .( 1 + z )+ x '. z .( 1 + y ) (an expression with three terms and six literals is reduced to

an expression with two terms and four literals).

= x. y + x '. z

  • Complement of a function can be obtained by using DeMorganโ€™s theorem in general case as follows:

( A + B + C +K + E )'= A '. B '. C '.K. E '

( A. B. C .K. E )'= A '+ B '+ C '+...+ E '

Example

x y z y z

x y z yz

F x yz yz

F x y z yz

Canonical and Standard Forms

  • Assume that we have 2 binary variables x and y.
  • These variables can be combined with an AND operation in 4 different ways ' ,

, , and

x '. y x '. y x. y ' x. y.

  • Each one of the above four terms will be referred to as a minterm, or a standard product.
  • Similarly, these two variables can also be combined with an OR operation in 4 different ways x + y , x + y ' , x '+ y , and x ' + y '.
  • Each of these four terms is called a maxterm, or a standard sum.
  • In general, n variables can be combined to form 2 n minterms or 2 n maxterms.
  • The minterms and maxterms and the corresponding symbols for three binary variables are given in the following table:

f (^) 1 = x '. y '. z + x. y '. z '+ x. y. z

or:

f (^) 1 = m 1 + m 4 + m 7

  • Similarly:

f (^) 1 =( x + y + z ).( x + y '+ z ).( x + y '+ z ').( x '+ y + z ').( x '+ y '+ z )

or:

f (^) 1 = M 0. M 2. M 3. M 5. M 6

  • Similarly for f 2 we can write:

f (^) 2 = m 3 + m 5 + m 6 + m 7 = M 0. M 1. M 2. M 4

Example

  • It is desired to write the Boolean function F = A + B '. C as a sum of minterms.
  • We have to insert the missing variables to each term as follows:

F = A .( B + B ')+ B '. C .( A + A ' ) = A. B + A. B '+ A. B '. C + A '. B '. C = A. B .( C + C ')+ A. B '.( C + C ')+ A. B '. C + A '. B '. C = A. B. C + A. B. C '+ A. B '. C + A. B '. C '+ A. B '. C + A '. B '. C = A '. B '. C + A. B '. C '+ A. B '. C + A. B. C '+ A. B. C

or:

F = m 1 + m 4 + m 5 + m 6 + m 7

  • Sometimes a function of the above form is written in the following short form:

F ( A , B , C )= โˆ‘( 1 , 4 , 5 , 6 , 7 )

  • It is very important to note that in general F ( A , B )โ‰  F ( B , A ) because the number

given in the sigma represents the binary number corresponding to the minterms in the truth table with the specific order of variables given in parentheses.

  • Similarly the function F can be written as the product of maxterms as follows:

F = M 0. M 2. M 3

or:

F ( A , B , C )=ฮ ( 0 , 2 , 3 )

  • Other than the two canonical forms, there are other ways to represent a Boolean function.
  • For example, if a Boolean function is expressed as a sum of products or product of sums, where the number of literals in each term is not equal to the number of variables, the function is said to be in standard form. For example:

F 1 (^) = y '+ x. y + x '. y. z '

or:

F 2 (^) = x .( y '+ z ).( x '+ y + z ' )

  • Such expressions have a two-level gating structure as shown below:

x y F 0 F 1 F 2 F 3 F 4 F 5 F 6 F 7 F 8 F 9 F 10 F 11 F 12 F 13 F 14 F 15 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

  • The Boolean expression and symbols for each of these functions (one or two input operators) are given in the following table:

Boolean Function Operator Symbol Name Comments Standard Gate F 0 = 0 Null Binary Constant 0

F 1 = x. y x. y AND x and y โˆš

F 2 = x. y โ€™ x / y Inhibition x , but not y

F 3 = x Transfer (Buffer) x โˆš

F 4 = x โ€™. y y / x Inhibition y , but not x

F 5 = y Transfer (Buffer) y โˆš

F 6 = x. y โ€™+ x โ€™. y x โŠ• y Exclusive-OR (XOR)

x or y , but not both โˆš

F 7 = x + y x + y OR x or y โˆš

F 8 = ( x + y )โ€™ x โ†“ y NOR Not-OR โˆš

F 9 = x. y + x โ€™. y โ€™ (^) ( x โŠ• y )โ€™ Equivalence (Exclusive-NOR)

x equals y โˆš

F 10 = y โ€™ y โ€™ Complement (Inverter)

Not y โˆš

F 11 = x + y โ€™ (^) y โ†’ x Implication If y , then x

F 12 = x โ€™ x โ€™ Complement (Inverter)

Not x โˆš

F 13 = x โ€™+ y (^) x โ†’ y Implication If x , then y

F 14 = ( x. y )โ€™ x โ†‘ y NAND Not-AND โˆš

F 15 = 1 Identity Binary Constant 1

  • Usually if negative logic is assumed, a polarity indicator triangle is used in the graphic symbols of each gate (in the inputs and the outputs of the gate).
  • In this course, we will not use negative logic gates (only positive logic will be used).

Reference: [1] Digital Design 3rd Edition, By Morris Mano, Publisher Prentice Hall, 3rd Edition.