Professional Documents
Culture Documents
Eslam El Maghraby
eem00@fayoum.edu.eg
Logic Gates
Denote True and False by 1 and 0 that represent Vcc and 0
voltages.
A bit (binary digit) is a symbol of these two values.
A Boolean Variable is a variable that is either True or False (or
simply 1 or 0); hence a bit.
Given a set B=0,1, the three operators .(AND), +(OR), ′(NOT)
are defined by:
A truth table is the table that represents all the possible
combinations of the input to a logical (Boolean)function
Logic Gates X = A.B.C = ABC
1) The AND operation
A B C X=ABC
X= A.B = AB 0 0 0 0
A B X=A.B 0 0 1 0
0 1 0 0
0 0 0
0 1 1 0
0 1 0 1 0 0 0
1 0 0 1 0 1 0
1 1 1 1 1 0 0
1 1 1 1
3
Timing Diagrams of AND gates
4
2) The OR operation
X = A+B+C
A B C X=A+B+C
X = A+B
0 0 0 0
A B X=A+B
0 0 1 1
0 0 0 0 1 0 1
0 1 1 1
0 1 1
1 0 0 1
1 0 1 1 0 1 1
1 1 1 1 1 0 1
1 1 1 1
5
Timing Diagrams of OR gates
6
3) The NOT operation 4) The Buffer
X = A’ X=A
A X=A’ A X=A
0 1 0 0
1 0 1 1
7
5) The NAND operation
X= A.B = AB
A B X=A.B
0 0 1
0 1 1
1 0 1
1 1 0
10
Timing diagram
11
Boolean Algebra
What is Boolean Algebra?
Boolean algebra is an algebraic structure defined by a set of elements,
together with binary operators, + and .
Provided that the following (Huntington) postulates are satisfied:
1. The structure is closed with respect to the operators (+) and ()
2. Identity element x+ 0 = 0+ x = x
1x=x1=x
3. Commutative x+y =y+x
xy =yx
4. Distributive x ( y + z ) = x y+ x z
x + ( y z) = ( x + y ) ( x + z )
5. Complement x + x` = 1
x x` = 0
Boolean Algebra
Terminology:
Literal: A variable or its complement
Product term: literals connected by •
Sum term: literals connected by +
Duality
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.
Boolean Algebra
Postulates and Theorems of Boolean algebra:
Postulate (a) x 0 x (b) x . 1 x
Postulate (a) x x 1 (b) x. x0
Theorem (a) x xx (b) x.xx
Theorem (a) x 11 (b) x. 00
Theorem, involution ( x) x
Postulate, commutative (a) x y yx (b) x.y y.x
Theorem, associative (a) x (y z) (y x) z (b) x . (y. z) (x . y) . z
Postulate, distributive (a) x (y z) xy xz (b) x (y.z) (x y) . (x z)
Theorem, DeMorgan (a) (x y) x y (b) (xy) x y
Theorem, absorption (a) x xy x (b) x(x y) x
Boolean Algebra
x (y z) xy xz
(x y) x y
Boolean Functions
A Boolean function
Binary variables
Binary operators OR and AND
Unary operator NOT
Parentheses
Examples
F1 xy z
F2 x yz
F3 x yz x yz x y
F4 x y xz
x y z z’ F1=xyz’ x y z x’ y’ x’y’z x’yz xy’ F3=x’y’z+x’yz+xy’
0 0 0 1 0 0 0 0 1 1 0 0 0 0
0 0 1 0 0 0 0 1 1 1 1 0 0 1
0 1 0 1 0 0 1 0 1 0 0 0 0 0
0 1 1 0 0 0 1 1 1 0 0 1 0 1
1 0 0 1 0 1 0 0 0 1 0 0 1 1
1 0 1 0 0 1 0 1 0 1 0 0 1 1
1 1 0 1 1 1 1 0 0 0 0 0 0 0
1 1 1 0 0 1 1 1 0 0 0 0 0 0
F3
F3
Boolean Functions
F3 F4
F3 = x` y` z + x` y z + x y`
= x`z (y` +y) + x y`
= x`z+ x y`
Algebraic Manipulation
To minimize Boolean expressions
Literal: a primed or unprimed variable (an input to a gate) ex. x, y ,z
Term: an implementation with a gate xy , x+y+z
The minimization of the number of literals and the number of terms
gives a circuit with less equipment
It is a hard problem (no specific rules to follow)
Examples:
• x( x y) x x xy 0 xy xy
• x xy (x x )(x y) 1 (x y) x y
• (x y)(x y) xx xy x y y y x xy x y 0 x(1 y y) x.1 x
• xy xz yz xy xz yz(x x ) xy xz yzx yzx
xy(1 z) xz(1 y) xy xz
Canonical and Standard Forms
Minterms and Maxterms
A minterm (standard product): an AND term consists of all literals in their
normal form or in their complement form.
For example, two binary variables x and y,
xy, x y, xy, x y
It is also called a standard product.
n variables can be combined to form 2n minterms.
A maxterm (standard sums): an OR term
It is also call a standard sum.
x y, x y, x y, x y
n
2 maxterms.
Any Boolean function can be expressed as
A sum of minterms (“sum” meaning the ORing of terms).
A product of maxterms (“product” meaning the ANDing of terms).
Both boolean functions are said to be in Canonical form.
Canonical and Standard Forms
Each maxterm is the complement of its corresponding
minterm, and vice versa.
Min terms Max terms
x y z Term Designation Term Designation
0 0 0 x` y` z` m0 x+y+ z M0
0 0 1 x` y` z m1 x + y + z` M1
0 1 0 x` y z` m2 x + y`+ z M2
0 1 1 x` y z m3 x + y` + z` M3
1 0 0 x y` z` m4 x`+ y + z M4
1 0 1 x y` z m5 x` + y + z` M5
1 1 0 x y z` m6 x` + y` + z M6
1 1 1 x y z m7 x ` + y` +z` M7
Canonical and Standard Forms
A Boolean function can be expressed by
A truth table
Sum of minterms
f1 (1,4,7) x yz x yz xyz m1 m 4 m 7 (Minterms)
F(A, B, C) (1, 4, 5, 6, 7)
or, build the truth table first
Conversion between Canonical Forms
The complement of a function expressed as the sum of
minterms equals the sum of minterms missing from the
original function.
F(A, B, C) ( 1, 4, 5, 6, 7 )
Thus, F(A, B, C) ( 0, 2, 3 )
By DeMorgan's theorem
F(A, B, C) ( 0, 2, 3 )
F(A, B, C) ( 1, 4, 5, 6, 7 )
Canonical and Standard Forms
The complement of a Boolean function
The minterms that produce a 0
f1' = m0 + m2 +m3 + m5 + m6