You are on page 1of 28

By

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

 In a boolean logic simulator, a buffer is


mainly used to increase propagation delay.
 In a real-world circuit, a buffer can be used to
amplify a signal if its current is too weak.

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

Negative OR Equivalent Operation of the NAND Gate


A
A
A’+B’=(A.B)’
B B 8
6) The NOR operation
X= A+B
A B Y=A+B
0 0 1
0 1 0
1 0 0
1 1 0

Negative AND equivalent of a NOR gate


A A
A’.B’=(A+B)’
B B
7)The Exclusive- OR Gate (XOR)
Inputs output
X= AB’+A’B = A ⊕ B
A B X
0 0 0
0 1 1
1 0 1
1 1 0
8) The Exclusive-NOR Gate
Inputs output
A B X X= AB+A’B’ = (A ⊕B)’
0 0 1
0 1 0
1 0 0
1 1 1

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
1x=x1=x
3. Commutative x+y =y+x
xy =yx
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. x0
Theorem (a) x  xx (b) x.xx
Theorem (a) x  11 (b) x. 00
Theorem, involution ( x)  x
Postulate, commutative (a) x  y  yx (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

x y z y’ y’z F2=x+y’z x y z x’ y’ xy’ x’z F4=xy’+x’z


0 0 0 1 0 0 0 0 0 1 1 0 0 0
0 0 1 1 1 1 0 0 1 1 1 0 1 1
0 1 0 0 0 0 0 1 0 1 0 0 0 0
0 1 1 0 0 0 0 1 1 1 0 0 1 1 F1  xy z
1 0 0 1 0 1 1 0 0 0 1 1 0 1 F2  x  yz
1 0 1 1 1 1 1 0 1 0 1 1 0 1
F3  x yz  x yz  x y
1 1 0 0 0 1 1 1 0 0 0 0 0 0
1 1 1 0 0 1 1 1 1 0 0 0 0 0 F4  x y  xz
Boolean Functions
 The truth table of 2n entries
Inputs Outputs
x y z F1 F2 F3 F4
0 0 0 0 0 0 0
0 0 1 0 1 1 1
F1  xy z
0 1 0 0 0 0 0 F2  x  yz
0 1 1 0 0 1 1
F3  x yz  x yz  x y
1 0 0 0 1 1 1
1 0 1 0 1 1 1 F4  x y  xz
1 1 0 1 1 0 0
1 1 1 0 1 0 0
 Two Boolean expressions may specify the same function
 F3=F4
Boolean Functions
F1 = x + y` z
F3 = x` y` z + x` y z + x y`
F4 = x y` + x` z

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 2   (3,5,6,7)  xyz  x yz  xyz  xyz  m 3  m 5  m 6  m 7 (Minterms)


Canonical and Standard Forms
 Example : express F  A  BC as a sum of minterms.

F  A  BC  A (B  B)  BC  AB  A B  BC  AB(C  C)  A B(C  C)  (A  A)BC


 ABC  ABC  A BC  A BC  A BC
F  A BC  A BC  A BC  ABC  ABC  m1  m4  m5  m6  m7

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

f1   (1,4,7)  x yz  x y z  xyz  m1  m 4  m 7 (Minterms)

f1   (0,2,3,5,6)  x yz  xyz  xyz  x yz  xyz x y z F F’


0 0 0 0 1 m0
 m 0  m 2  m 3  m 5  m 6 (Minterms)
0 0 1 1 0 m1
0 1 0 0 1 m2
0 1 1 0 1 m3
1 0 0 1 0 m4
1 0 1 0 1 m5
1 1 0 0 1 m6
1 1 1 1 0 m7
Complement of a Function
 The complement of a function F is F’and is obtained from an interchange
of 0’s for 1’s and 1’s for 0’s in the value of F.
 The complement of a function may be derived algebraically through
DeMorgan’s theorems
Any number of variables
(A+B+C+D+…+F)` = A`B`C`D`…F`
and:
(ABCD…F )`= (A`+B`+C`+D`+…+F`)
Complement of a Function:
F1  ( xy z  x yz)
F2  x( y z  yz)
F1  ( xy z  x yz)  ( xy z) . ( x yz)  (x  y  z) (x  y  z)
F2  [x( yz  yz)]  x  (yz).( yz)  x  ( y  z).( y  z)  x  y y  z z  yz  yz
 x  yz  yz

You might also like