You are on page 1of 40

Digital Circuits

Boolean Algebra and Logic Gate

Chapter 2
Boolean Algebra and Logic Gate
Lecture 4

Dr. Marwa Fayez Fahmy


Definition of Boolean Algebra

 We need to define algebra for binary values


 Developed by George Boole in 1854
 Huntington postulates for Boolean algebra (1904):
 B = {0, 1} and two binary operations, + and.
 Closure with respect to operator + and operator ·
 Identity element 0 for operator + and 1 for operator ·
 Commutativity with respect to + and ·
x+y = y+x, x·y = y·x
 Distributivity of · over +, and + over ·
x·(y+z) = (x·y)+(x·z) and x+(y·z) = (x+y)·(x+z)
 Complement for every element x is x’ with x+x’=1, x·x’=0
 There are at least two elements x,yB such that xy

22
Boolean Algebra
 Terminology:
 Literal: A variable or its complement
 Product term: literals connected by •
 Sum term: literals connected by +

33
Postulates)‫ مسلمه (فرضية‬of Two-
Valued Boolean Algebra
 B = {0, 1} and two binary operations, + and.
 The rules of operations: AND、OR and NOT.

AND OR NOT
x y x.y x y x+y x x'
0 0 0 0 0 0 0 1
0 1 0 0 1 1 1 0
1 0 0 1 0 1
1 1 1 1 1 1
1. Closure (+ and‧)
2. The identity elements
(1) +: 0
(2).: 1

44
Postulates of Two-Valued Boolean Algebra
3. The commutative laws ‫تبادلية‬
4. The distributive laws
x·(y+z) = (x·y)+(x·z) and
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
5
5
Postulates of Two-Valued Boolean Algebra
5. Complement
 x+x'=1 → 0+0'=0+1=1; 1+1'=1+0=1
 x.x'=0 → 0.0'=0.1=0; 1.1'=1.0=0

 Note
 A set of two elements
 + : OR operation; .: AND operation
 A complement operator: NOT operation
 Binary logic is a two-valued Boolean algebra

66
‫ازدواجية‬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
a + (bc) = (a + b)(a + c)
 Following the replacement rules…
a(b + c) = ab + ac
 Take care not to alter the location of the parentheses if they are
present.

77
Basic Theorems

88
Boolean Theorems
 Huntington’s postulates define some rules
Post. 1:
closure
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 that are derived from postulates
 What is a theorem?
 A formula or statement that is derived from postulates
(or other proven theorems)

99
Basic theorems of Boolean algebra

10
Theorem 1: Idempotent‫التتاثر‬
 denoting an element of a set which is unchanged in value when
multiplied or otherwise operated on by itself.

 Theorem 1(a): (x + x) = x
 Theorem 1(b): (x.x)= x

11
11
Proof of x+x=x
 We can only use Huntington postulates:
Huntington postulates:
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
 Show that x+x=x.
x+x = (x+x)·1 by 2(b)
= (x+x)(x+x’) by 5(a)
= x+xx’ by 4(b)
= x+0 by 5(b)
=x by 2(a)
Q.E.D.
 We can now use Theorem 1(a) in future proofs
12
12
Proof of x·x=x
Huntington postulates:
 Similar to previous
proof 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
Th. 1: (a) x+x=x

 Show that x·x = x.


x·x = xx+0 by 2(a)
= xx+xx’ by 5(b)
= x(x+x’) by 4(a)
= x·1 by 5(a)
=x by 2(b)
Q.E.D.

13
13
Theorem 2: Annulment ‫الغاء‬
 Theorem 2(a): (x + 1) = 1
 Theorem 2(b): (x.0)= 0

14
14
Proof of x+1=1
 Theorem 2(a): x + 1 = 1 Huntington postulates:

x + 1 = 1.(x + 1) by 2(b) 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,
=(x + x')(x + 1) 5(a) (b) x+yz = (x+y)(x+z)
Post. 5: (a) x+x’=1, (b) x·x’=0
= x + x' 1 4(b) Th. 1: (a) x+x=x

= x + x' 2(b)
=1 5(a)
 Theorem 2(b): x.0 = 0 by duality

15
15
Involution Theorem
 Theorem 3 : (x’)’ = x
 Postulate 5 defines the complement of x, x + x' = 1 and x x' = 0
 The complement of x' is x is also (x')’

 By means of truth table

x x’ (x’)’

0 1 0
1 0 1

16
16
Associative Theorem
 Theorem 4(a): (x + y)+z = x+(y+z)
 Theorem 4(b): (x.y).z = x.(y.z)
 By means of truth table
x y z x+y (x+y)+z y+z x+(y+z)

0 0 0 0 0 0 0
0 0 1 0 1 1 1
0 1 0 1 1 1 1
0 1 1 1 1 1 1
1 0 0 1 1 1 1
1 0 1 1 1 1 1
1 1 0 1 1 1 1

17
1 1 1 1 1 1 1
17
DeMorgan’s Theorem
 Theorem 5(a): (x + y)’ = x’y’
 Theorem 5(b): (xy)’ = x’ + y’
 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

18
18
Absorption Property (Covering)
Huntington postulates:
 Theorem 6(a): x + xy = x
 x + xy = x.1 + xy by 2(b) Post. 2: (a) x+0=x, (b) x·1=x
= x (1 + y) 4(a) Post. 3: (a) x+y=y+x, (b) x·y=y·x
= x (y + 1) 3(a) Post. 4: (a) x(y+z) = xy+xz,
= x.1 Th 2(a) (b) x+yz = (x+y)(x+z)
=x 2(b) Post. 5: (a) x+x’=1, (b) x·x’=0
Th. 1: (a) x+x=x
 Theorem 6(b): x (x + y) = x by duality  Report
 By means of truth table (another way to proof )

x y xy x+xy
0 0 0 0
0 1 0 0
1 0 0 1
1 1 1 1
19
19
Report
Proof That :
1. xy + x’z + yz = xy + x’z
2. (x+y)•(x’+z)•(y+z) = (x+y)•(x’+z) -- (dual)

20
20
Description of the Laws of
Boolean Algebra
• Annulment Law – A term AND´ed with a “0”
equals 0 or OR´ed with a “1” will equal 1

• A . 0 = 0 A variable AND’ed with 0 is always


equal to 0
• A + 1 = 1 A variable OR’ed with 1 is always
equal to 1

• IdentityLaw – A term OR´ed with a “0”


or AND´ed with a “1” will always equal that term

• A + 0 = A A variable OR’ed with 0 is always equal


to the variable
• A . 1 = A A variable AND’ed with 1 is always
22
equal to the variable
• Idempotent Law – An input that is AND´ed or OR´ed
with itself is equal to that input
• A+A=A A variable OR’ed with itself is always equal
to the variable
• A . A = A A variable AND’ed with itself is always
equal to the variable

• Complement Law – A term AND´ed with its


complement equals “0” and a term OR´ed with its
complement equals “1”

• A .A= 0 A variable AND’ed with its complement is
always equal to 0
• A + A = 1 A variable OR’ed with its complement is
23 always equal to 1
• Commutative Law – The order of application of
two separate terms is not important

• A. B = B .A The order in which two variables are
AND’ed makes no difference
• A + B = B + A The order in which two variables are
OR’ed makes no difference

• Double Negation Law – A term that is inverted
twice is equal to the original term

• (A’)’ = A A double complement of a variable is
always equal to the variable
24
• Distributive Law – This law permits the multiplying or
factoring out of an expression.

• A(B + C) = A.B + A.C (OR Distributive Law)
• A + (B.C) = (A + B).(A + C) (AND Distributive Law)

• Absorptive Law – This law enables a reduction in a
complicated expression to a simpler one by absorbing
like terms.

• A + (A.B) = A (OR Absorption Law)
• A(A + B) = A (AND Absorption Law)

25
• Associative Law – This law allows the removal of
brackets from an expression and regrouping of the
variables.
• A + (B + C) = (A + B) + C = A + B + C (OR
Associate Law)
• A(B.C) = (A.B)C = A . B . C (AND Associate Law)

• de Morgan´s Theorem – There are two “de


Morgan´s” rules or theorems,
(1) Two separate terms NOR´ed together is the same
as the two terms inverted (Complement) and AND´ed
for example: A+B = A . B
(2) Two separate terms NAND´ed together is the
same as the two terms inverted (Complement)
26 and OR´ed for example: A.B = A + B
Operator Precedence

 The operator precedence for evaluating Boolean Expression


is
 Parentheses
 NOT
 AND
 OR
 Examples
 x y' + z
 (x y + z)'

27
27
Truth Tables for the Laws of
Boolean
Boolean Equivalent Boolean Algebra
Description
Expression Switching Circuit Law or Rule

A in parallel with
A+1=1 Annulment
closed = “CLOSED”

A in parallel with
A+0=A Identity
open = “A”

A in series with
A.1=A Identity
closed = “A”

A in series with
A.0=0 Annulment
open = “OPEN”

A in parallel with
A+A=A Idempotent
A = “A”

A in series with
A.A=A Idempotent
Report

A = “A”

NOT NOT A
NOT A’ = A Double Negation
(double negative) = “A”

A in parallel with
A+A=1 Complement
NOT A = “CLOSED”

A in series with
A.A=0 Complement
NOT A = “OPEN”

A in parallel with B =
A+B = B+A Commutative
B in parallel with A

A in series with B =
A.B = B.A Commutative
B in series with A

A+B = A.B invert and replace OR with AND de Morgan’s Theorem


A.B = A+B invert and replace AND with OR de Morgan’s Theorem

29
Reports

Report 1 Slide 19
Report 2 Slide 20
Report 3 Slide 29
Boolean Algebra Examples
Boolean Algebra Example No1
 Construct a Truth Table for the logical functions at
points C, D and Q in the following circuit and identify
a single logic gate that can be used to replace the
whole circuit.

33
Inputs Output at

A B C D Q

0 0 1 0 0

0 1 1 1 1

1 0 1 1 1

1 1 0 0 1

34
Boolean Algebra Example No2
 Find the Boolean algebra expression for the following
system.

35
Inputs Intermediates Output
B A A.B A+B Q
0 0 0 1 1
0 1 0 0 0
1 0 0 0 0
1 1 1 0 1

36
Boolean Algebra Example No3

 Find the Boolean algebra expression for the


following system.

37
Inputs Intermediates Output

C B A A.B.C B C B+C A.(B+C) Q

0 0 0 0 1 1 1 0 0
0 0 1 0 1 1 1 1 1
0 1 0 0 0 1 1 0 0
0 1 1 0 0 1 1 1 1
1 0 0 0 1 0 1 0 0
1 0 1 0 1 0 1 1 1
1 1 0 0 0 0 0 0 0
38 1 1 1 1 0 0 0 0 1
Report
Proof That
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).

39
39

You might also like