0% found this document useful (0 votes)
24 views17 pages

Chapter 2 (Part 1) - 2

hhj

Uploaded by

twalbeh01
Copyright
© © All Rights Reserved
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)
24 views17 pages

Chapter 2 (Part 1) - 2

hhj

Uploaded by

twalbeh01
Copyright
© © All Rights Reserved
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/ 17

3/15/2014

Chapter 2(Part 1)
Boolean Algebra and Logic
Gates
0306201: Digital Logic Design
Faculty of Science and Information Technology (FSIT)
Zarqa University (ZU)
Prof. Musbah M. Aqel

Binary Variables
 Binary variables take on one of two values.
 The two binary values have different names:
 1/0
 High (H)/Low (L)
 True (T)/False (F)
 On/Off
 Yes (Y)/No (N)
 We use 1 and 0 to denote the two values.
 Variable identifier examples:
 A, B,C, x,y, z

1
3/15/2014

Logical Operations
 Logical operators operate on binary values and
binary variables.
 The three basic logical operations are:
 AND
 OR
 NOT
 AND is denoted by a dot (·).
 OR is denoted by a plus (+).
 NOT is denoted by an overbar ( ¯ ), a single quote
mark (') after, or (~) before the variable.

Boolean Functions
 Binary variable = Boolean expression
 A Boolean expression is formed with
 Binary variables
 Binary constant
 Binary operators OR and AND
 Unary operator NOT
 Parentheses
 Examples
 F = a’•b + b’
 G = x•(y+z’)
 H=x+1

 Boolean function value/output can be either 0 or 1

2
3/15/2014

Operator Precedence
 The operator precedence for evaluating Boolean
Expression is
 Parentheses  Highest Priority
 NOT
 AND
 OR  Lowest Priority
 Examples
 x y' + z
 (x y + z)'

Logic Circuits and Boolean Expressions


 Boolean Expressions (Functions) are fully defined by
their truth tables.
 Each Boolean function (expression) can be
implemented by a digital logic circuit which consists of
logic gates.
 Variables of the function correspond to signals in the logic
circuit,
 Operators of the function are converted into corresponding
logic gates in the logic circuit.

3
3/15/2014

Example
Truth Table
x y z F Boolean Function

F = x’ + y z’
0 0 0 1
0 0 1 1
0 1 0 1
Logic Circuit Diagram
0 1 1 1 z
1 0 0 0
y
1 0 1 0
x F
1 1 0 1
1 1 1 0
 Boolean expressions, truth tables and logic circuit
diagrams describe the same function!
 Truth tables are unique; expressions and logic circuits
diagram are not. This gives flexibility in implementing
functions.
7

More Examples
 Consider the following Boolean functions:
 F1 = x + y'z
 F2 = x' y' z + x' y z + x y'
 F3 = x y' + x' z

1. Construct the truth table for each function.


2. Implement / transform each functions into logic circuit
diagram.

4
3/15/2014

Truth Tables
 The truth table of 23 entries for the three functions

x y z F1 F2 F3
0 0 0 0 0 0
0 0 1 1 1 1
0 1 0 0 0 0
0 1 1 0 1 1
1 0 0 1 1 1
1 0 1 1 1 1
1 1 0 1 0 0
1 1 1 1 0 0
 Two Boolean expressions may specify the same
function.
 Truth tables for F2 and F3 are identical  same function
9

Logic Circuit Diagrams


 Implementation of the three functions with logic gates
 F3 is more economical (less components) compared to F2

F1 = x + y'z

F2 = x' y' z + x' y z + x y'

F3 = x y' + x' z

10

5
3/15/2014

Boolean Algebra
 VERY nice mathematical system used to specifying and
manipulating (simplifying) Boolean functions.
 Developed by George Boole in 1854
 We study Boolean algebra as a foundation for
designing and analyzing digital systems!
 Terminology:
 Literal: A variable or its complement
 Product term: literals connected by •
 Sum term: literals connected by +

11

Algebra
 What is algebra?
 Mathematical system consisting of
 Set of elements
 Set of operators
 Axioms or postulates
 Why is it important?
 Defines rules of “calculations”
 Example: arithmetic on natural numbers
 Set of elements: N = {1,2,3,4,…}
 Operator: +, –, *
 Axioms: associative, distributive, closure, identity elements, etc.

12

6
3/15/2014

Two-Valued Boolean Algebra


 A two-valued Boolean algebra is defined on a set of
elements, B = {0, 1}, with rules for the two binary
operations + and . As shown in the following operators
tables.
AND OR
x y x.y x y x+y
0 0 0 0 0 0
0 1 0 0 1 1
1 0 0 1 0 1
1 1 1 1 1 1

 From the truth tables of the AND and OR operations shown


above, we can derive some basic postulates. These
postulates can be easily verified by showing that they are
valid for both possible values of X (0 and 1).
13

Postulates of Two-Valued Boolean Algebra


1. Closure: that is the structure is closed with respect of the
two operators, since the result of each operation is either 0
or 1 and 0,1 ∈ Β.
AND OR
x y x· y x y x+y
0 0 0 0 0 0
0 1 0 0 1 1
1 0 0 1 0 1
1 1 1 1 1 1

2. Identity elements:
(a) x + 0 = x → 0 + 0 = 0; 1 + 0 = 1
(b) x· 1 = x → 0· 1 = 0; 1· 1 = 1
There are two identity elements, 0 for + and 1 for ·
14

7
3/15/2014

Postulates of Two-Valued Boolean Algebra


3. Commutative: with respect to + and ·
(a) x+y = y+x (b) x·y = y·x
4. Distributive: · over + and + over ·
(a) x·(y+z) = (x·y)+(x·z) (b) x+(y·z) = (x+y)·(x+z)

x y z y+z x · (y+z) x·y x·z (x·y)+(x·z)

0 0 0 0 0 0 0 0
0 0 1 1 0 0 0 0
0 1 0 1 0 0 0 0
0 1 1 1 0 0 0 0
1 0 0 0 0 0 0 0
1 0 1 1 1 0 1 1
1 1 0 1 1 1 0 1
1 1 1 1 1 1 1 1
15

Postulates of Two-Valued Boolean Algebra


5. Complement:

(a): x + x’ = 1

(b): x · x’ = 0

16

8
3/15/2014

Duality
 The principle of duality is an important concept.
This says that if an expression is valid in Boolean
algebra, the dual of that expression is also valid.
 To form the dual of an expression, replace all +
operators with . operators, all . operators with +
operators, all ones with zeros, and all zeros with
ones.
 Form the dual of the expression
x + (yz) = (x + y)(x + z)
 Following the replacement rules…
x(y + z) = xy + xz
 Take care not to alter the location of the
parentheses if they are present.
17

Basic Theorems of Boolean Algebra


 Postulates define some rules
Post. 2: (a) x+0=x (b) x·1=x
Post. 3: (a) x+y=y+x (b) x·y=y·x
Post. 4: (a) x(y+z) = xy+xz (b) x+yz = (x+y)(x+z)
Post. 5: (a) x+x’=1 (b) x·x’=0

 Need more rules to modify algebraic expressions


 Theorems are derived from postulates
 What is a theorem?
 A formula or statement that is derived from postulates
(or other proven theorems)

18

9
3/15/2014

Basic Theorems of Boolean Algebra


1. Theorem 1, Idempotent:

(a): x + x = x

(b): x · x = x

19

Basic Theorems of Boolean Algebra


2. Theorem 2, Inverse:

(a): x + 1 = 1

(b): x · 0 = 0

20

10
3/15/2014

Basic Theorems of Boolean Algebra


3. Theorem 3, Involution:
(x’)’ = x

This can be proven by the NOT operation as shown


below:

21

Basic Theorems of Boolean Algebra


4. Theorem 4, Associative:
(a): x + (y + z) = (x + y) + z (b): x(y · z) = (x · y)z

Proof of Theorem 4(a) by means of truth table.


Proof of Theorem 4(b) by duality
x y z y+z x+ (y+z) x+y (x+ y)+ z
0 0 0 0 0 0 0
0 0 1 1 1 0 1
0 1 0 1 1 1 1
0 1 1 1 1 1 1
1 0 0 0 1 1 1
1 0 1 1 1 1 1
1 1 0 1 1 1 1
1 1 1 1 1 1 1

22

11
3/15/2014

Basic Theorems of Boolean Algebra


5. Theorem 5, DeMorgan’s:
(a): (x + y)’ = x’ · y’ (b): (x · y)’ = x’ + y’

Proof of Theorem 5(a) and Theorem 5(b) by means of truth table.

x y x’ y’ x+y (x+y)’ x’y’ xy x’+y' (xy)’

0 0 1 1 0 1 1 0 1 1

0 1 1 0 1 0 0 0 1 1

1 0 0 1 1 0 0 0 1 1

1 1 0 0 1 0 0 1 0 0

23

Basic Theorems of Boolean Algebra


6. Theorem 6, Absorption:
(a): x + x y = x (b): x( x + y) = x

Proof of Theorem 6(a) by means of truth table.


Proof of Theorem 6(b): x (x + y) = x by duality

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

24

12
3/15/2014

Boolean Algebra Postulates & Theorems

Identity
Complement
Idempotent
Inverse

25

Algebraic Manipulation
 To minimize Boolean expressions
 Literal: a primed or unprimed variable (an input to a gate)
 Term: an implementation with a gate
 The minimization of the number of literals and the number of
terms → a circuit with less equipment
 Examples: Simplify the following Boolean expressions to a
minimum number of literals.
1. x(x'+y) = xx' + xy (by post. 4(a) distributive)
= 0+xy (by post. 5(b) complement )
= xy + 0 (by post. 3(a) commutative)
= xy (by post. 2(a) identity)
2. x+x'y = (x+x')(x+y) (by post. 4(b) distributive)
= 1 (x+y) (by post. 5(a) complement)
= (x + y) 1 (by post. 3(b) commutative)
= x+y (by post. 2(b) identity)
26

13
3/15/2014

Examples (Cont’d)
3. (x+y)(x+y') = x(x+y’) + y(x+ y’)
= xx+xy’+xy+yy' (by post. 4(a) distributive)
= x+ xy’+ xy + yy’ (by Th. 1(b) idempotent)
= x+ xy’ + xy + 0 (by post. 5(b) complement)
= x(1+y’+ y)
= x( 1 + 1) (by post. 5(a) complement)
=x1
=x (by post. 2(b) complement)

27

Examples (Cont’d)
4. (x+y)(x’+y)(y’+z) = x’(x+y)+y(x+y)(y’+z)
= x’x+x’y+xy+yy(y’+z) (by post. 4(a) distributive)
= 0+x’y+xy+yy(y’+z) (by post. 5(b) complement)
= x’y+xy+yy(y’+z) (by post. 2(a) identity)
= x’y +xy + y(y’+z) (by Th. 1(b) idempotent)
= y(x’+x+y)(y’+z)
= y(1+y)(y’+z) (by post. 5(b) complement)
= y(1)(y’+z) (by Th. 2 (a) inverse)
= y(y’+z) (by post. 2(b) identity)
= yy’+yz (by post. 4(a) distributive)
= 0+yz (by post. 5(b) complement)
= yz (by post. 2(a) identity)

28

14
3/15/2014

Examples (Cont’d)
5. (A+B’C)’ = A’(B’C)’ (by Th. 5(a) DeMorgan)
= A’((B’)’+C’) (by Th. 5(b) DeMorgan)
= A’(B+C’) ( by Th.3 involution)

6. ABC+AB’(A’C’)’ = ABC+AB’((A’)’+(C’)’) (by Th. 5(b) DeMorgan)


= ABC+AB’(A+C) (by Th.3 involution)
= ABC+AAB’+AB’C (by post. 4(a) distributive)
= ABC+AB’+AB’C (by Th. 1(b) idempotent)
= AC(B+B’)+AB’
= AC+AB’ (by post.5(a) complement)
= A(C+B’)

29

Simplification Using Boolean Algebra


 AB+A(B+C)+B(B+C)
 (by post. 4(a) distributive) A
 AB+AB+AC+BB+BC
 (by Th.1(b) idempotent) B
 AB+AB+AC+B+BC C AB+A(B+C)+B(B+C)

 (by Th.1(a) idempotent)


 AB+AC+B+BC
 (by Th.6(a) absorption)
 AB+AC+B B B+AC
 (by Th.6(a) absorption)
 B+AC A
C

30

15
3/15/2014

Consensus Theorem
1. xy + x’z + yz = xy + x’z
2. (x+y)•(x’+z)•(y+z) = (x+y)•(x’+z) -- (dual)
 Proof:
xy + x’z + yz = xy + x’z + (x+x’)yz
= xy + x’z + xyz + x’yz
= (xy + xyz) + (x’z + x’zy)
= xy + x’z
QED (2 true by duality).

31

Complement of a Function
 The complement of the function F (F’) is obtained by
interchanging AND and OR operators and
complementing each literal.
 F = (A+B+C)
 F’ can be derived by DeMorgan's theorem
 F’ = (A+B+C)' = (A+X)' let B+C = X
= A'X' by theorem 5(a) (DeMorgan's)
= A‘ (B+C)' substitute B+C = X
= A‘ (B'C') by theorem 5(a) (DeMorgan's)
= A'B'C' by theorem 4(b) (associative)
 Generalizations:
 (A+B+C+D+ ... +F)' = A'B'C'D'... F'
 (ABCD ... F)' = A'+ B'+C'+D' ... +F'

32

16
3/15/2014

Examples
 Example 1
 F1 = x'yz' + x'y'z.
 F1' = (x'yz' + x'y'z)' = (x'yz')' (x'y'z)' = (x+y'+z) (x+y+z')
 F2 = x(y' z' + yz).
 F2' = [x(y'z'+yz)]' = x' + (y'z'+yz)' = x' + (y'z')' (yz)‘
= x' + (y+z) (y'+z')
= x' + yz‘+y'z
 Example 2: a simpler procedure
 Take the dual of the function and complement each literal
1. F1 = x'yz' + x'y'z.
The dual of F1 is (x'+y+z') (x'+y'+z).
Complement each literal: (x+y'+z)(x+y+z') = F1'
2. F2 = x(y' z' + yz).
The dual of F2 is x+(y'+z') (y+z).
Complement each literal: x'+(y+z)(y' +z') = F2' 33

17

You might also like