Chapter 2 (Part 1) - 2
Chapter 2 (Part 1) - 2
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
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)'
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
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
F1 = x + y'z
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
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
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
(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
18
9
3/15/2014
(a): x + x = x
(b): x · x = x
19
(a): x + 1 = 1
(b): x · 0 = 0
20
10
3/15/2014
21
22
11
3/15/2014
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
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
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)
29
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