Title: CT455: Computer Organization Boolean Algebra
1CT455 Computer OrganizationBoolean Algebra
2Lecture 3 Boolean Algebra
- Digital circuits
- Boolean Algebra
- Two-Valued Boolean Algebra
- Boolean Algebra Postulates
- Precedence of Operators
- Truth Table Proofs
- Duality
3Lecture 3 Boolean Algebra
- Basic Theorems of Boolean Algebra
- Boolean Functions
- Complement of Functions
- Standard Forms
- Minterm Maxterm
- Canonical Forms
- Conversion of Canonical Forms
- Binary Functions
4Digital Circuits
- Digital circuit can be represented by a black-box
with inputs on one side, and outputs on the other.
The input/output signals are discrete/digital in
nature, typically with two distinct voltages (a
high voltage and a low voltage).
In contrast, analog circuits use continuous
signals.
5Digital Circuits
- Advantages of Digital Circuits over Analog
Circuits - more reliable (simpler circuits, less
noise-prone) - specified accuracy (determinable)
- but slower response time (sampling rate)
- Important advantages for two-valued Digital
Circuit - Mathematical Model Boolean Algebra
- Can help design, analyse, simplify Digital
Circuits.
6(No Transcript)
7Boolean Algebra
What is an Algebra? (e.g. algebra of
integers) set of elements (e.g. 0,1,2,..) set
of operations (e.g. , -, ,..) postulates/axioms
(e.g. 0xx,..)
- Boolean Algebra named after George Boole who used
it to study human logical reasoning calculus of
proposition. - Events true or false
- Connectives a OR b a AND b, NOT a
- Example Either it has rained OR someone
splashed water, must be tall AND good vision.
8Boolean Algebra
Later, Shannon introduced switching algebra
(two-valued Boolean algebra) to represent
bi-stable switching circuit.
9Two-valued Boolean Algebra
- Set of Elements 0,1
- Set of Operations ., ,
x.y
Signals High 5V 1 Low 0V 0
10Boolean Algebra Postulates
A Boolean algebra consists of a set of elements
B, with two binary operations and . and a
unary operation ', such that the following
axioms hold
- Commutative laws
- A B B A
- A . B B . A
11Boolean Algebra Postulates
- Associative laws
- (A B) C A (B C) A B C
- (A . B) . C A .( B . C) A . B . C
- Distributive laws
- A . (B C) (A . B) (A . C)
- A (B . C) (A B) . (A C)
12Boolean Algebra Postulates
- Complement For every x in B, there exists an
element x' in B such that - x x' 1
- x . x' 0
-
13Precedence of Operators
- To lessen the brackets used in writing Boolean
expressions, operator precedence can be used. - Precedence (highest to lowest) ' .
- Examples
- a . b c (a . b) c
- b' c (b') c
- a b' . c a ((b') . c)
14Precedence of Operators
- Use brackets to overwrite precedence.
- Examples
- a . (b c)
- (a b)' . c
15Rules for Boolean Algebra
1. A 0 A
9. (A) A
2. A 1 1
10. A AB A
3. A . 0 0
11. A AB A B
4. A . 1 A
12. (A B)(A C) ABC
5. A A A
6. A A 1
7. A . A A
8. A . A 0
1610. A AB A A AB A(1 B) DISTRIBUTIVE
LAW A . 1 RULE 2 A RULE 4
A B AB AAB
0 0 1 1 0 1 0 1 0 0 0 1 0 0 1 1
17Theorem 10 (Absorption) (a) a ab a (b) a(a
b) a Examples (X Y) (X Y)Z X
Y T4(a) AB'(AB' B'C) AB' T4(b)
1811. A AB A B A AB (A AB)
AB (AA AB) AB AA AB AA
AB (A A)(A B) 1. (A B) ( A
B)
A B AB AAB AB
0 0 1 1 0 1 0 1 0 1 0 0 0 1 1 1 0 1 1 1
19Theorem 11 (a) a a'b a b (b) a(a' b)
ab Examples B AB'C'D B
AC'D T11(a) (X Y)((X Y)' Z) (X
Y)Z T11(b)
2011. A AB A B
??????????????????????
A AB A B
A AB A B
A ABC A BC
(AB) ABCD (AB) CD
21 12. (A B)(B C) AA AC AB BC A
AC AB BC A(1C) AB BC A.1
AB BC A(1B) BC A.1 BC A .
BC
A B C AB AC (AB)(AC) BC ABC
0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 1 1 1 1 1 1 0 1 0 1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1
22Theorem (a) ab ab' a (b) (a b)(a b')
a Examples ABC AB'C AC T6(a) (W' X'
Y' Z')(W' X' Y' Z)(W' X' Y Z')(W'
X' Y Z) (W' X' Y')(W' X' Y
Z')(W' X' Y Z) (W' X' Y')(W' X'
Y) (W' X')
23Theorem 7 (a) ab ab'c ab ac (b) (a
b)(a b' c) (a b)(a c) Examples wy'
wx'y wxyz wxz' wy' wx'y wxy
wxz' T7(a) wy' wy wxz' T7(a)
w wxz' T7(a) w T7(a) (x'y'
z)(w x'y' z') (x'y' z)(w
x'y') T7(b)
24Basic Theorems of Boolean Algebra
6. DeMorgan. (a) (x y)' x'.y' (b)
(x.y)' x' y' 7. Consensus. (a) x.y
x'.z y.z x.y x'.z (b)
(xy).(x'z).(yz) (xy).(x'z)
25Laws of Boolean Algebra
DeMorgan's Law
(X Y)' X' ? Y'
NOR is equivalent to AND with inputs complemented
(X ? Y)' X' Y'
NAND is equivalent to OR with inputs complemented
DeMorgan's Law can be used to convert AND/OR
expressions to OR/AND expressions or NAND/NAND
expression
Example
Z A' B' C A' B C A B' C A B C
AND - OR (ABC) ? (ABC) ? (ABC) ?
(ABC) NAND - NAND Z' (A B C') ?
(A B' C') ? (A' B C') ? (A' B' C)
26- Theorem 8 (DeMorgan's Theorem)
- (a) (a b)' a'b' (b) (ab)' a' b'
- Generalized DeMorgan's Theorem
- (a) (a b z)' a'b' z' (b) (ab z)'
a' b' z' - Examples
- (a bc)' (a (bc))'
- a'(bc)' T8(a)
- a'(b' c') T8(b)
- a'b' a'c' P5(b)
- Note (a bc)' ¹ a'b' c'
27- More Examples for DeMorgan's Theorem
- (a(b z(x a')))' a' (b z(x
a'))' T8(b) - a' b' (z(x a'))' T8(a)
- a' b' (z' (x a')') T8(b)
- a' b' (z' x'(a')') T8(a)
- a' b' (z' x'a) T3
- a' b' (z' x') T5(a)
- (a(b c) a'b)' (ab ac a'b)' P5(b)
- (b ac)' T6(a)
- b'(ac)' T8(a)
- b'(a' c') T8(b)
28Truth Table
- Provides a listing of every possible combination
of inputs and its corresponding outputs. - Example (2 inputs, 2 outputs)
29Switching Functions
- Switching algebra Boolean algebra with the set
of elements K 0, 1 - If there are n variables, we can define
switching functions. - Sixteen functions of two variables (Table 2.3)
- A switching function can be represented by a
table as above, or by a switching expression as
follows - f0(A,B) 0, f6(A,B) AB' A'B, f11(A,B) AB
A'B A'B' A' B, ... - Value of a function can be obtained by plugging
in the values of all variables - The value of f6 when A 1 and B 0 is
0 1 1.
30Truth Tables (1)
- Shows the value of a function for all possible
input combinations. - Truth tables for OR, AND, and NOT (Table 2.4)
31Truth Tables (2)
- Truth tables for f(A,B,C) AB A'C AC' (Table
2.5)
32Truth Table
- Example (3 inputs, 2 outputs)
33Proof using Truth Table
- Can use truth table to prove by perfect
induction. - Prove that x . (y z) (x . y) (x . z)
- (i) Construct truth table for LHS RHS of above
equality. - (ii) Check that LHS RHS
- Postulate is SATISFIED because output column 2
5 (for LHS RHS expressions) are equal for all
cases.
34Basic Theorems of Boolean Algebra
- Apart from the axioms/postulates, there are other
useful theorems. - 1. Idempotency.
- (a) x x x (b) x . x x
- Proof of (a)
- x x (x x).1 (identity)
- (x x).(x x') (complementarity)
- x x.x' (distributivity)
- x 0 (complementarity)
- x (identity)
35Basic Theorems of Boolean Algebra
- 2. Null elements for and . operators.
- (a) x 1 1 (b) x . 0 0
- 3. Involution. (x')' x
- 4. Absorption.
- (a) x x.y x (b) x.(x y) x
- 5. Absorption (variant).
- (a) x x'.y xy (b) x.(x' y) x.y
36Basic Theorems of Boolean Algebra
- Theorem 4a (absorption) can be proved by
- x x.y x.1 x.y
(identity) - x.(1 y)
(distributivity) - x.(y 1)
(commutativity) - x.1
(Theorem 2a) - x
(identity) - By duality, theorem 4b
- x.(xy) x
- Try prove this by algebraic manipulation.
37Boolean Functions
- Boolean function is an expression formed with
binary variables, the two binary operators, OR
and AND, and the unary operator, NOT, parenthesis
and the equal sign. - Its result is also a binary value.
- We usually use . for AND, for OR, and ' or
for NOT. Sometimes, we may omit the . if there
is no ambiguity.
38Boolean Functions
- Examples
- F1 x.y.z'
- F2 x y'.z
- F3(x'.y'.z)(x'.y.z)(x.y')
- F4x.y'x'.z
From the truth table, F3F4. Can you also prove
by algebraic manipulation that F3F4?
39Simplifying logic expressions
40- EXAMPLE
- A(AB) AA AB
- A AB
- A(1 B)
- A
- A(A B) AA AB
- AB
- ( AB AB) (A B)(A B)
- AA AB AB BB
- AB AB
41X ABC ABC AB ( C C) AB.1 AB
A X(XYZ XYZ) XXYZ XXYZ 0.YZ
0.YZ 0
42EXAMPLE AB AB ABAAABBB
A(BA) B(AB) (AB)(AB)
(AB)(AB)
A B AB AB (AB) AB
0 0 0 1 1 0 1 1 0 0 1 0 0 1 0 0 1 1 1 0 0 1 1 1
ABAB (AB)(AB)
0 1 1 0 0 1 1 0
43EXAMPLE Y AB AB AB
Y B(A A) AB
Y B.1 AB
Y B AB
Y B A
44W AB(AC B) ABAC ABB 0.BC
AB 0 AB AB
45Z ( X.Y) ( X . ( Y X )
Z ( X.Y) ( X.Y) (X.X)
Z ( X.Y) ( X.Y) (0)
Z ( X.Y) ( X.Y)
Z Y. ( X X)
Z Y. 1
Z Y
46Z ( X.Y) ( X . Y ) Y )
Z ( X . Y ).(X . Y ) ( X . Y ) Y )
Z ( X . X ).(Y . Y ) X . (Y Y )
Z ( X . X ).( 0 ) X . (Y Y )
Z 0 X . Y
Z X . Y
47Z X X.Y Y.X
Z X X. (Y Y)
Z X X. (1)
Z 1
48Z X( X Y )(Y X)
Z (X.X XY )( Y X )
Z ( 0 XY)( Y X
Z XY( Y X)
Z XYY XYX
Z 0 0
49Z w( y w )( x y w ) (wy ww)( x y
w ) (wy w)( x y w ) (w wy)( x
y w ) w( x y w ) wx wy ww wx
( wy w ) wx ( w wy) wx w w
wx w
50Simplify
AB BC(B C) AB BBC BCC AB BC BC AB
BC B( A C)
AB(A BC C) ABA ABBC ABC AB ABBC
ABC AB ABC AB(1 C) AB
51EXAMPLE
SIMPLIFY THE EXPRESSION AB A(B C) B(B C)
USING BOOLEAN ALGEBRA
- AB AB AC BB BC
- AB AB AC B BC
- AB AC B BC
- AB AC B(1 C)
- AB AC B.1
- AB AC B
- B(A 1) AC
- B.1 AC
- B AC
52SIMPLIFY THE EXPRESSION AB(C BD) ABC
USING BOOLEAN ALGEBRA
- AB(C BD) ABC
- (ABC ABBD AB)C
- (ABC A.0.D AB)C
- (ABC 0 AB)C
- (ABC AB)C
- ABCC ABC
- ABC ABC
- BC(A A)
- BC.1
- BC
53SIMPLIFY THE EXPRESSION ABC ABC ABC
ABC ABC USING BOOLEAN ALGEBRA
ABC ABC ABC ABC ABC BC(A A)
ABC ABC ABC BC.1 AB(C C)
ABC BC AB.1 ABC BC B(A AC) BC
B(A C) BC AB BC
54Gate Logic Laws of Boolean Algebra
Apply the laws and theorems to simplify Boolean
equations
Example full adder's carry out function
identity
Cout A' B Cin A B' Cin A B Cin' A
B Cin
A' B Cin A B' Cin A B Cin' A B Cin
A B Cin A' B Cin A B Cin A B' Cin
A B Cin' A B Cin (A' A) B Cin A
B' Cin A B Cin' A B Cin (1) B Cin
A B' Cin A B Cin' A B Cin B Cin A
B' Cin A B Cin' A B Cin A B Cin B
Cin A B' Cin A B Cin A B Cin' A B
Cin B Cin A (B' B) Cin A B Cin'
A B Cin B Cin A (1) Cin A B Cin' A
B Cin B Cin A Cin A B (Cin' Cin)
B Cin A Cin A B (1) B Cin A Cin
A B
associative
55Z (x y) w (xy) ( x y ) w ( x
y ) ( x y ) w ( x y ) . 1 (
x y ) ( w 1) ( x y ) (1) x y
56M (A BC) (A) (B)(C) ABC
S (AB(C D)) (AB) (C D)
(A) (B) (C) (D) A B CD
57Complement of Functions
- Given a function, F, the complement of this
function, F', is obtained by interchanging 1 with
0 in the functions output values.
Example F1 xyz' Complement
F1' (x.y.z')' x' y'
(z')' DeMorgan x' y' z
Involution
58Complement of Functions
- More general DeMorgans theorems useful for
obtaining complement functions - (A B C ... Z)' A' . B' . C' .
Z' - (A . B . C ... . Z)' A' B' C'
Z'
59Algebraic Forms of Switching Functions (1)
- Literal A variable, complemented or
uncomplemented. - Product term A literal or literals ANDed
together. - Sum term A literal or literals ORed together.
- SOP (Sum of Products)
- ORing product terms
- f(A, B, C) ABC A'C B'C
- POS (Product of Sums)
- ANDing sum terms
- f (A, B, C) (A' B' C')(A C')(B C')
60Algebraic Forms of Switching Functions (2)
- A minterm is a product term in which all the
variables appear exactly once either complemented
or uncomplemented. - Canonical Sum of Products (canonical SOP)
- Represented as a sum of minterms only.
- Example f1(A,B,C) A'BC' ABC' A'BC
ABC (2.1) - Minterms of three variables
61Algebraic Forms of Switching Functions (3)
- Compact form of canonical SOP form
- f1(A,B,C) m2 m3 m6 m7 (2.2)
- A further simplified form
- f1(A,B,C) S m (2,3,6,7) (minterm list
form) (2.3) - The order of variables in the functional notation
is important. - Deriving truth table of f1(A,B,C) from minterm
list
62Algebraic Forms of Switching Functions (4)
- Example Given f(A,B,Q,Z) A'B'Q'Z' A'B'Q'Z
A'BQZ' A'BQZ, express f(A,B,Q,Z) and f
'(A,B,Q,Z) in minterm list form. - f(A,B,Q,Z) A'B'Q'Z' A'B'Q'Z A'BQZ' A'BQZ
- m0 m1 m6 m7
- S m(0, 1, 6, 7)
- f '(A,B,Q,Z) m2 m3 m4 m5 m8 m9 m10
m11 m12 - m13 m14 m15
- S m(2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14,
15) - (2.6)
- AB (AB)' 1 and AB A' B' 1, but AB
A'B' ¹ 1.
63Algebraic Forms of Switching Functions (5)
- A maxterm is a sum term in which all the
variables appear exactly once either complemented
or uncomplemented. - Canonical Product of Sums (canonical POS)
- Represented as a product of maxterms only.
- Example f2(A,B,C) (ABC)(ABC')(A'BC)(A'B
C') (2.7) - Maxterms of three variables
64Algebraic Forms of Switching Functions (6)
- f2(A,B,C) M0M1M4M5 (2.8)
- PM(0,1,4,5) (maxterm list
form) (2.9) - The truth table for f2(A,B,C)
65Algebraic Forms of Switching Functions (7)
- Truth tables of f1(A,B,C) of Eq. (2.3) and
f2(A,B,C) of Eq. (2.7) are identical. - Hence, f1(A,B,C) S m (2,3,6,7)
- f2(A,B,C)
- PM(0,1,4,5)
(2.10) - Example Given f(A,B,C) ( ABC')(AB'C')(A'B
C')(A'B'C'), construct the truth table and
express in both maxterm and minterm form. - f(A,B,C) M1M3M5M7 PM(1,3,5,7) S m (0,2,4,6)
66Algebraic Forms of Switching Functions (8)
- Relationship between minterm mi and maxterm Mi
- For f(A,B,C), (m1)' (A'B'C)' A B C' M1
- In general, (mi)' Mi (2.11)
- (Mi)' ((mi)')'
mi (2.12)
67Algebraic Forms of Switching Functions (9)
- Example Relationship between the maxterms for a
function and its complement. - For f(A,B,C) ( ABC')(AB'C')(A'BC')(A'B'C
') - The truth table is
68Algebraic Forms of Switching Functions (10)
- From the truth table
- f '(A,B,C) PM(0,2,4,6) and f(A,B,C)
PM(1,3,5,7) - Since f(A,B,C) f '(A,B,C) 0,
- (M0M2M4M6)(M1M3M5M7) 0 or
- In general, (2.13)
- Another observation from the truth table
- f(A,B,C) S m (0,2,4,6) PM(1,3,5,7)
- f '(A,B,C) S m (1,3,5,7) PM(0,2,4,6)
69Derivation of Canonical Forms (1)
- Derive canonical POS or SOP using switching
algebra. - Theorem 10. Shannon's expansion theorem
- (a). f(x1, x2, , xn) x1 f(1, x2, , xn)
(x1)' f(0, x2, , xn) - (b). f(x1, x2, , xn) x1 f(0, x2, , xn)
(x1)' f(1, x2, , xn) - Example f(A,B,C) AB AC' A'C
- f(A,B,C) AB AC' A'C A f(1,B,C) A'
f(0,B,C) - A(1B 1C' 1'C) A'(0B 0C'
0'C) A(B C') A'C - f(A,B,C) A(B C') A'C BA(1C') A'C
B'A(0 C') A'C - BA A'C B'AC' A'C AB A'BC
AB'C' A'B'C - f(A,B,C) AB A'BC AB'C' A'B'C
- CAB A'B1 AB'1' A'B'1 C'AB
A'B0 AB'0' A'B'0 - ABC A'BC A'B'C ABC' AB'C'
70Derivation of Canonical Forms (2)
- Alternative Use Theorem 6 to add missing
literals. - Example f(A,B,C) AB AC' A'C to canonical
SOP form. - AB ABC' ABC m6 m7
- AC' AB'C' ABC' m4 m6
- A'C A'B'C A'BC m1 m3
- Therefore,
- f(A,B,C) (m6 m7) (m4 m6) (m1 m3)
?m(1, 3, 4, 6, 7) - Example f(A,B,C) A(A C') to canonical POS
form. - A (AB')(AB) (AB'C')(AB'C)(ABC')(ABC)
- M3M2M1M0
- (AC') (AB'C')(ABC') M3M1
- Therefore,
- f(A,B,C) (M3M2M1M0)(M3M1) ?M(0, 1, 2, 3)
71Incompletely Specified Functions
- A switching function may be incompletely
specified. - Some minterms are omitted, which are called
don't-care minterms. - Don't cares arise in two ways
- Certain input combinations never occur.
- Output is required to be 1 or 0 only for certain
combinations. - Don't care minterms di Don't
care maxterms Di - Example f(A,B,C) has minterms m0, m3, and m7 and
don't-cares d4 and d5. - Minterm list is f(A,B,C) ?m(0,3,7) d(4,5)
- Maxterm list is f(A,B,C) ?M(1,2,6)D(4,5)
- f '(A,B,C) ?m(1,2,6) d(4,5)
?M(0,3,7)D(4,5) - f (A,B,C) A'B'C' A'BC ABC d(AB'C' AB'C)
- B'C' BC (use d4 and omit d5)
72Standard Forms
- Sum Term a single literal or a logical sum (OR)
of several literals. - Examples x, xyz', A'B, AB
- Sum-of-Products (SOP) Expression a product term
or a logical sum (OR) of several product terms. - Examples x, xy.z', x.y'x.y.z, A.BA'.B'
- Product-of-Sums (POS) Expression a sum term or a
logical product (AND) of several sum terms. - Exampes x, x.(yz'), (xy').(x'yz),
(AB).(A'B')
73Standard Forms
- Every Boolean expression can either be expressed
as sum-of-products or product-of-sums expression. - Examples
- SOP x?.y x.y? x.y.z
- POS (x y?).(x? y).(x? z?)
- both x? y z or x.y.z?
- neither x.(w? y.z) or z? w.x?.y v.(x.z
w?)
74Two Level Canonical Forms
Sum of Products
product term / minterm
Minterms
ANDed product of literals in which each variable
appears exactly once, in true or complemented
form (but not both!)
F in canonical form
F(A,B,C) ?m(3,4,5,6,7)
m3 m4 m5 m6 m7 A' B C A B' C'
A B' C A B C' A B C
Shorthand Notation for Minterms of 3 Variables
canonical form/minimal form
F A B' (C C') A' B C A B (C' C)
A B' A' B C A B A (B' B) A' B
C A A' B C A B C
B
F
C
A
F (A B C)' A' (B' C') A' B' A' C'
2-Level AND/OR Realization
752 Level Canonical Forms
Product of Sums / Conjunctive Normal Form /
Maxterm Expansion
Maxterm
ORed sum of literals in which each variable
appears exactly once in either true or
complemented form, but not both!
Maxterm form
Find truth table rows where F is 0 0 in input
column implies true literal 1 in input column
implies complemented literal
Maxterm Shorthand Notation for a Function of
Three Variables
(?m(0,1,2)) (ABC ABC ABC)
F(A,B,C) ?M(0,1,2)
(A B C) (A B C') (A B' C)
F(A,B,C) ?M(3,4,5,6,7)
(A B' C') (A' B C) (A' B C') (A'
B' C) (A' B' C')
76Two Level Canonical Forms
F' A' B' C' A' B' C A' B C'
Apply DeMorgan's Law to obtain F
(F')' (A' B' C' A' B' C A' B C')'
F (A B C) (A B C') (A B' C)
F' (A B' C') (A' B C) (A' B C') (A'
B' C) (A' B' C')
Apply DeMorgan's Law to obtain F
(F')' (A B' C') (A' B C) (A' B C')
(A' B' C) (A' B' C')'
F A' B C A B' C' A B' C A B C'
A B C