0% found this document useful (0 votes)
7 views

02_boolean algebra

The document provides an overview of Boolean algebra, its principles, and applications in digital systems. It explains the basic logic operations (AND, OR, NOT), truth tables, and the role of logic gates in circuit design. Additionally, it discusses combinational logic optimization and properties of Boolean functions.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

02_boolean algebra

The document provides an overview of Boolean algebra, its principles, and applications in digital systems. It explains the basic logic operations (AND, OR, NOT), truth tables, and the role of logic gates in circuit design. Additionally, it discusses combinational logic optimization and properties of Boolean functions.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 96

‫جبر بول‬

Boolean Algebra
‫جبر بول‬

‫• قوت اصلي سيستم هاي‬


:‫ديجيتال‬
‫ جامعيت و قدرت فرموالسيون رياضي‬
‫جبر بول‬
IF
IFthe
AND
thelift
liftdoor
ANDaabutton
doorisisclosed
closed
buttonisispressed
pressedatataafloor
floor
:‫• مثال‬
THEN
THENthe thelift
liftmust
mustmove
move

:‫هر دو شرط‬
‫ و‬the lift door is closed
true ‫ بايد‬a button is pressed at a floor
.‫باشند تا آسانسور حرکت کند‬

2
Digital Systems: Boolean Algebra
and Logical Operations
• In Boolean algebra:
 Values: 0,1
 0: if a logic statement is false,
 1: if a logic statement is true.
• Operators: AND, OR, NOT

X Y X AND Y X Y X OR Y X NOT 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
3
‫مثال‬

IF
IFthe
thelift
liftdoor
doorisisclosed
closed
AND
ANDaabutton
buttonisispressed
pressedatataafloor
floor
THEN
THENthe thelift
liftmust
mustmove
move

door closed? button pressed? move lift?


false/0 false/0 false/0
false/0 true/1 false/0
true/1 false/0 false/0
true/1 true/1 TRUE/1

4
‫سيستم هاي نوعي‬

‫‪System‬‬

‫• ورودي ها‪:‬‬
‫‪ ‬فشار کليد (ديجيتال)‬
‫‪ ‬درجةحرارت محيط (آنالوگ)‬
‫‪ ‬تغييرات سطح مايع (آنالوگ)‬
‫• خروجي ها‪:‬‬
‫‪ ‬ولتاژ راه اندازي موتور (آنالوگ)‬
‫‪ ‬بازکردن‪/‬بستن شير (آنالوگ يا‬
‫ديجيتال)‬
‫‪ ‬نمايش روي ‪( LCD‬ديجيتال)‬
‫‪5‬‬
‫سيستم هاي نوعي‬
Analog
Phenomena

Sensors & System


other inputs
Analog
Inputs
A2D
Digital :‫• ورودي ها‬
Digital
Inputs )‫ فشار کليد (ديجيتال‬
Inputs )‫ درجةحرارت محيط (آنالوگ‬
Digital )‫ تغييرات سطح مايع (آنالوگ‬
System :‫• خروجي ها‬
Digital Digital )‫(آنالوگ‬ ‫ ولتاژ راه اندازي موتور‬
Outputs Outputs
‫بستن شير (آنالوگ يا‬/‫ بازکردن‬
D2A
)‫ديجيتال‬
Actuators and Other Outputs )‫ (ديجيتال‬LCD ‫ نمايش روي‬
6
‫ دستگاه اطفاي حريق‬:‫مثال‬
‫خودکار‬
Analog
Phenomena

Sensors & System


other inputs
Analog
Inputs
Digital
A2D
Inputs

:‫• رفتار سيستم‬


Digital
Inputs

Digital ‫ اگر درجة حرارت محيط از مقدار‬


System ‫مشخصي بيشتر است و کليد فعال‬
Digital Digital ‫ شير‬،‫سازي دستگاه روشن است‬
Outputs Outputs .‫آب را باز کن‬
D2A

Actuators and Other Outputs


7
‫ چراغ هشدار کمربند ايمني‬:‫مثال‬
Analog
Phenomena

Sensors &
other inputs
Analog
Inputs
Digital
A2D
Inputs
Digital
Inputs

Digital
System .‫ کمربند بسته است‬:’S = ‘1 
Digital Digital .‫ سوييچ داخل است‬:’K = ‘1 
Outputs
.‫ راننده روي صندلي است‬:’P = ‘1 
Outputs
D2A

Actuators and Other Outputs


8
‫ عملگرهاي منطقي‬:‫سوييچ ها‬

IF the lift door is closed Door Button Open


AND a button is pressed at a floor closed pressed off
AND “Open” button is off
THEN the lift must move True Move lift

Open
button

9
‫ عملگرهاي منطقي‬:‫سوييچ ها‬

IF the lift door is closed Door Button Open


AND a button is pressed at a floor closed pressed off
AND “Open” button is off
THEN the lift must move True Move lift

Open
button
Button Open
at a floor Is off Door
closed
IF ((a button pressed at a floor
AND “Open” button is off) True
Move lift
OR a button inside the lift is pressed)
AND the door lift is closed True
THEN the lift can move Button
inside

10
Binary Logic
Deals with binary variables that take
2 discrete values (0 and 1), and with
logic operations
Basic logic operations:
− AND, OR, NOT
Binary/logic variables: letters: A,B,C,
…,X,Y,Z

11
Binary Logic Function
F(vars) = expression

 Operators ( +, •, ‘ )
 Variables
set of binary
 Constants ( 0, 1 )
variables
 Groupings (parenthesis)
Example:
F(a,b) = a’•b + b’
G(x,y,z) = x•(y+z’)

12
Basic Logic Operators
AND (also •, )
Binary
OR (also +, )
NOT (also ’, ) Unary

F(a,b) = a•b, reads F is 1 if and only if a=b=1


G(a,b) = a+b, reads G is 1 if either a=1 or b=1 or both
H(a) = a’, reads H is 1 if a=0

13
Basic Logic Operators (cont.)
• 1-bit logic AND resembles binary
multiplication:
0 • 0 = 0, 0 • 1 = 0,
1 • 0 = 0, 1 • 1 = 1
• 1-bit logic OR resembles binary
addition, except for one operation:
0 + 0 = 0, 0 + 1 = 1,
1 + 0 = 1, 1 + 1 = 1 (≠ 102)

14
Truth Tables for logic
Truth table:
operators
tabular form that uniquely represents the
relationship between the input variables of a
function and its output

2-Input AND 2-Input OR


NOT
A B F=A•B A B F=A+B A ’F=A
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

15
Truth Tables (cont.)
• Q:
Let a function F() depend on n
variables. How many rows are there
in the truth table of F() ?
• A:
2n rows, since there are 2n possible
binary patterns/combinations for the n
variables

16
Logic Gates
Logic gates are abstractions of electronic
circuit components that operate on one or
more input signals to produce an output
signal.

2-Input AND 2-Input OR NOT (Inverter)


A A
F G A H
B B

F = A•B G = A+B H = A’

17
Timing Diagram
t0 t1 t2 t3 t4 t5 t6
1
Input A 0
1 Transitions
signals B 0

1
F=A•B 0 Basic
Gate
1 Assumption:
Output G=A+B 0 Zero time for
Signals
1 signals to
H=A’ 0 propagate
Through gates

18
The Real World
 Physical electronic components are continuous, not
discrete!
− Transition from logic 1 to logic 0 does not take place
instantaneously in real digital systems
 These are the building blocks of all digital components!

 Intermediate values may be


visible for an instant
+5
 Boolean algebra useful for Logic 1
describing the steady state
V
behavior of digital systems
Logic 0
 Be aware of the dynamic, time
0
varying behavior too! Time
19
Circuit that implements
logical negation (NOT)

Logic 0 Input
+5 Voltage

Inverter behavior as a function of


VOut
Logic 1 Input
input voltage
Voltage input ramps from 0V to 5V
output holds at 5V for some range
of small input voltages
0 V In +5 then changes rapidly, but not in-
stantaneously!

20
Logic Gates

• Steady state matters in Boolean algebra

21
Three-Input Gates

22
Combinational Logic Circuit
from Logic Function
• Combinational Circuit Design:
• F = A’ + B•C’ + A’•B’
 connect input signals and logic gates:
− Circuit input signals  from function variables (A, B, C)
− Circuit output signal  function output (F)
− Logic gates  from logic operations

A F

23
Logic Evaluation
Circuit of logic gates :

Logic Expression :

24
Logic Evaluation
Circuit of logic gates :

Logic Expression : [ A(C  D)]' BE

Logic Evaluation : A=B=C=1, D=E=0

[ A(C  D )]'  BE [1(1  0)]'1 0 [1(1)]'0 0  0 0

25
Logic Evaluation

Logic Evaluation : A=B=C=1, D=E=0 [ A(C  D)]' BE

26
Combinational Logic Optimization
 In order to design a cost-effective and
efficient circuit, we must minimize A B C F G
− the circuit’s size
0 0 0 1 1
− area
− propagation delay 0 0 1 1 1
− time required for an input signal 0 1 0 1 1
change to be observed correctly at 0 1 1 1 1
the output line
 Observe the truth table of 1 0 0 0 0
F = A’ + B•C’ + A’•B’
G = A’ + B•C’ 1 0 1 0 0
are identical  same function 1 1 0 1 1
1 1 1 0 0
 Use G to implement the logic circuit
− less components

27
Proof Using Truth Table
AB'C ( A  C )( B 'C )

n variable needs 2 2 2  2 n rows

n times

A B C ’B ’AB AB’ + C A+C B’ + C )B’ + C( )A + C(


0 0 1 0 0 0 1 0
0 1 0 1 1 1 1
0 0 0 0 0 0 0 0
1 0 0 1 1 1 1
1 0 1 1 1 1 1 1
0
1 1 1 1 1 1
1 0
0 0 0 1 0 0
1
0 0 1 1 1 1
0 1
28
0
Combinational Logic Optimization

F=A’ + B•C’ + A’•B’ A F

C
G=A’ + B•C’ B
A G

29
Boolean Algebra
VERY nice machinery used to manipulate
(simplify) Boolean functions
George Boole (1815-1864): “An investigation of
the laws of thought”
Terminology:
− Literal: A variable or its complement
A, B’, x’
− Product term: literals connected by •
X.Y
A.B’.C.D,
− Sum term: literals connected by +
A+B’
A’+B’+C

30
Boolean Algebra Properties
Let X: boolean variable, A B F=A+B
0,1: constants 0 0 0
0 1 1
1 0 1
1. X + 0 = X -- Zero Axiom 1 1 1
2. X • 1 = X -- Unit Axiom A B F=A•B
3. X + 1 = 1 -- Unit Property 0 0 0
4. X • 0 = 0 -- Zero Property 0 1 0
1 0 0
1 1 1
Example: ( AB' D) E  1 1
31
Boolean Algebra Properties (cont.)

Let X: boolean variable, A B F=A+B

0,1: constants 0 0 0
0 1 1
1 0 1
1. X + X = X -- Idempotent
2. X • X = X -- Idempotent 1 1 1
3. X + X’ = 1 -- Complement
A B F=A•B
4. X • X’ = 0 -- Complement
5. (X’)’ = X -- Involution 0 0 0
0 1 0
Example: 1 0 0
1 1 1
( AB' D)( AB' D)' 0
32
The Duality Principle
 The dual of an expression is obtained by exchanging
(• and +), and (1 and 0) in it,
− provided that the precedence of operations is not changed.
 Do not exchange x with x’
 Example:
− Find H(x,y,z), the dual of F(x,y,z) = x’yz’ + x’y’z
− H = (x’+y+z’) (x’+y’+ z)
 Dual does not always equal the original expression

• If a Boolean equation is valid, its


dual is also valid
33
The Duality Principle (cont.)

With respect to duality, Identities 1 – 8


have the following relationship:

1. X+0=X 2. X•1 =X (dual of 1)


3. X+1 =1 4. X•0 =0 (dual of 3)
5. X+X=X 6. X • X = X (dual of 5)
7. X + X’ = 1 8. X • X’ = 0 (dual of 8)

34
More Boolean Algebra
Properties
Let X,Y, and Z: boolean variables
10. X+Y=Y+X 11. X • Y = Y • X -- Commutative
12. X + (Y+Z) = (X+Y) + Z 13. X•(Y•Z) = (X•Y)•Z -- Associative
14. X•(Y+Z) = X•Y + X•Z 15. X+(Y•Z) = (X+Y) • (X+Z)
-- Distributive
16. (X + Y)’ = X’ • Y’ 17. (X • Y)’ = X’ + Y’ -- DeMorgan’s

In general,
( X1 + X2 + … + Xn )’ = X1’•X2’ • … •Xn’

( X1•X2•… •Xn )’ = X1’ + X2’ + … + Xn’

35
Associative Laws for AND

A
=B
C C

(AB)C=ABC

B
A
C = B
A C

A(BC)=ABC

36
Proof of Associative Law
( XY ) Z  X (YZ )  XYZ
Associative Laws:
( X  Y )  Z  X  (Y  Z )  X  Y  Z
Proof of Associative Law for AND

X Y Z XY YZ Z X(YZ))XY(
0 0 0 0 0 0 0
1 0 0 0 0 0 0
0 1 0 0 0 0 0
1 1 0 1 0 0 0
0 0 1 0 0 0 0
1 0 1 0 0 0 0
0 1 1 0 1 0 0
1 1 1 1 1 1 1

37
Distributive Law

Distributive Laws: X (Y  Z )  XY  XZ
X  YZ ( X  Y )( X  Z )
Valid only for Boolean
algebra not for ordi-
nary algebra

(A+B).C = A.C + B.C


Proof of the second law:

( X  Y )( X  Z )  X ( X  Z )  Y ( X  Z )  XX  XZ  YX  YZ
C  X  XZ  XY  YZ  X 1  XZ  XY  YZ
 X (1  Z  Y )  YZ  X 1  YZ  X  YZ

38
Absorption Property
(Covering)
1. x + x•y = x
2. x•(x+y) = x (dual)
• Proof:
x + x•y = x•1 + x•y
= x•(1+y)
= x•1
=x
QED (2 true by duality)

39
Absorption Property
(Covering)
1. x + x’•y = x + y
2. x•(x’+y) = x y (dual)
• Proof of 2:
x • (x’+ y) = x•x’ + x•y
= 0 + (x•y)
= x•y
QED (1 true by duality)

40
DeMorgan’s Laws
( X  Y )'  X ' Y '
Proof ( XY )'  X 'Y '
X Y ’X’ Y X+Y ’) X + Y ( ’X’ Y XY ’) XY ( ’X’ + Y

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

DeMorgan’s Laws for n variables

( X 1  X 2  X 3  ...  X n )'  X 1 ' X 2 ' X 3 '...X n '


( X 1 X 2 X 3 ... X n )'  X 1 ' X 2 ' X 3 '...  X n '
Example
( X 1  X 2  X 3 )' ( X 1  X 2 )' X 3 '  X 1 ' X 2 ' X 3 '
41
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). 42
Consensus Theorem

Example:
a' b'ac  bc'b' c  ab  a' b'ac  bc'

43
Consensus Theorem
Example:
Reducing an expression
by adding a term and eliminate.

F  ABCD  B ' CDE  A' B ' BCE'

45
Consensus Theorem
Example:
Reducing an expression
by adding a term and eliminate.

F  ABCD  B ' CDE  A' B ' BCE'

F  ABCD  B ' CDE  A' B ' BCE ' ACDE

Consensus
Term added
Final expression F  A' B ' BCE ' ACDE

46
Algebraic Manipulation
• Boolean algebra: A useful tool for simplifying
digital circuits.
• Why do simplification?
− Simpler can mean cheaper, smaller, faster

• Reduce number of literals (gate inputs; fan-in)


- Limited in some technologies
- Larger fanin = Larger circuit
- Larger fanin = Slower circuit
• Reduce number of gates
- influences manufacturing costs

• Reduce number of levels of gates


- Reduced signal propagation delays
47
Levels of Gates
• Number of levels:
 From inputs to outputs

48
Algebraic Manipulation
Example: Simplify F = x’yz + x’yz’ + xz.
F= x’yz + x’yz’ + xz yx
= x’y(z+z’) + xz
F
= x’y•1 + xz z
= x’y + xz

x
y
F
z

50
Sum of Products (SOP)
Sum of product form: AB'CD' E  AC ' E

Still considered to be ABC ' DEFG  H


in sum of product form:
A  B 'C  D' E

Not in Sum of product form: ( A  B )CD  EF

Multiplying out and eliminating redundant terms

( A  BC )( A  D  E )  A  AD  AE  ABC  BCD  BCE


 A(1  D  E  BC )  BCD  BCE
 A  BCD  BCE
52
Product of Sums (POS)

Product of sum form: ( A  B ' )(C  D' E )( A  C ' E ' )

Still considered to be
( A  B )(C  D  E ) F
in product of sum form: AB' C ( D' E )

53
Circuits for SOP and POS form

D’

C E
D’ + A
E B’
C
A
C'
E’

Sum of product form:

B’
A
C B’
D' + D’ C
E
E
A
C’ +
E’
Product of sum form:

54
Multiplying Out and Factoring
To obtain a sum-of-product form  Multiplying out using distributive laws

X (Y  Z )  XY  XZ
( X  Y )( X  Z )  X  YZ
678
Theorem for multiplying out: ( X + Y )(X ' + Z ) = XZ + X ' Y (3-3)
1 44 2 4 43

If X = 0, (3 - 3) reduces to Y(1+ Z) = 0 + 1*Y or Y = Y.


If X = 1, (3 - 3) reduces to (1 + Y)Z = Z + 0 *Y or Z= Z.
because the equation is valid for both X = 0 and X =1, it is always valid.

Example:
6 78
A1B + C ' = ( A + C )(A '+ B)
4 2 A43
The use of Theorem 3-3 for factoring:

55
Multiplying out (Another Proof)
678
Theorem for multiplying out: ( X + Y )( X ' + Z ) = XZ + X ' Y (3-3)
1 44 2 4 43

( X  Y )( X 'Z )  XX ' XZ  YZ  YZ
0  XZ  X ' Y  YZ
 XZ  X ' Y
Factoring Expressions

To obtain a product-of-sum form  Factoring using distributive laws

Example of factoring: AC + A'BD ' +A' BE + A'C ' DE


= AC + A' (BD ' +BE +C ' DE )
XZ X ' Y
=( A +BD ' +BE +C ' DE )( A' +C )
=[ A +C ' DE + B(D ' +E )]( A' +C )
X Y Z
=( A + B +C ' DE )( A +C ' DE +D ' +E )( A' +C )
=( A + B +C ')( A + B + D)( A + B + E )( A +D ' +E )( A' +C )

57
Graphic Look at Algebraic Manipulation
-All various forms of an arbitrary
Boolean function with a unique
An Arbitrary Boolean Function
truth table may be considered
points in the big circle
-Assume brown x is an arbitrary
starting point
-Assume green x is the optimal
point
-Amber manipulation path is a
correct but long path from the
starting point to the optimal
-Green path is a better path to
the optimal point
-Correct manipulations remain
within the circle
-Any incorrect manipulation
takes you out of the circle (the
red arrow)

58
Conversion of English Sentences
to Boolean Equations
 The first step in designing a logic network:
− Translate English sentences to Boolean
Eqns.
− Break down each sentence into phrases
− Associate a Boolean variable with each phrase
(possible if a phrase can have a “true”/”false” value)
 Example:
− Turn on light if it is night and a movement is
detected.
−  F=A.B

59
Main Steps
 Three main steps in designing a
single-output combinational
switching network:
− Find a switching (Boolean) function
which specifies the desired behavior.
− Simplify the function.
− Realize the simplified function using
logic elements.

60
Example
 Four chairs in a row:
− Occupied: ‘1’
− Empty: ‘0’
− F = ‘1’ iff there are no adjacent empty
chairs.

A B C D

F = (B’C’ + A’B’ + C’D’)’

61
Example
F = (B’C’ + A’B’ + C’D’)’
F = (B+C).(A+B).(C+D)
= (B+AC).(C+D)
= BC + BD + AC + ACD
= BC + BD + AC

62
Circuit Analysis
 Circuit to be analyzed:

65
Circuit Analysis
 Circuit to be analyzed:

 Consider all possible combinations of inputs

66
Circuit Analysis
 Circuit to be analyzed:

 Can also name the nodes N1 = X+Y’ N2 = N1.Z


N1 N3 = X’.Y.Z’
N2
F = N2+N3
N3
F = N1.Z+ X’.Y.Z’
= (X+Y’). Z+ X’.Y.Z’
67
Complementation: Example

• Find the complement of


F(x,y,z) = xy’z’ + x’yz
 G = F’

69
Complementation: Example

• Find the complement of


F(x,y,z) = xy’z’ + x’yz
 G = F’ = (xy’z’ + x’yz)’
= (xy’z’)’ • (x’yz)’ DeMorgan
= (x’+y+z) • (x+y’+z’) DeMorgan again
• Note:
 Complement of F: dual(F) then complement all literals

70
Complement of a Function

• •↔+
• 1↔0
• X ↔ X’
Interchange 1s to 0s in the truth table
column showing F.
The complement of a function IS NOT
THE SAME as the dual of a function.

71
De Morgan’s Law for a Complex
Expression

• Example:
((A + B’).C’.D + EF)’
= ((A’.B) + C + D’) . (E’ + F’)

• Note:
 Don’t change operator precedence

72
Shannon Theorem

 F(x1,x2,…,xn) = x1.F(1,x2,…,xn) + x1’.F(0,x2,…,xn)

 F(x1,x2,…,xn) = [x1 + F(0,x2,…,xn)].[x1’+ F(1,x2,…,xn)]

73
Relationship Among
Theorem: Representations
* Any Boolean function that can be expressed as a truth table can be written as
an expression in Boolean Algebra using AND, OR, NOT.

unique
? Truth Table
not ?
unique ed co v
e r e
cov covered red gate
Boolean not
representation
Expression unique
covered (schematic)
[convenient for [close to
manipulation] implementaton]

How do we convert from one to the other?


Optimizations?
75
Ckt (Gate) to Truth Table
 Circuit to be analyzed:

 Consider all possible combinations of inputs

76
Ckt to Boolean + Boolean to TT
Circuit of logic gates :

Logic Expression : [ A(C  D)]' BE

Logic Evaluation : A=B=C=1, D=E=0

[ A(C  D )]'  BE [1(1  0)]'1 0 [1(1)]'0 0  0 0

77
Boolean to Ckt
• Combinational Circuit Design:
• F = A’ + B•C’ + A’•B’
 connect input signals and logic gates:
− Circuit input signals  from function variables (A, B, C)
− Circuit output signal  function output (F)
− Logic gates  from logic operations

A F

78
Minterms and Maxterms
• Minterm:
x y z Minterm Maxterm
 a product term in
which all the variables 0 0 0 x’y’z’ = m0 x+y+z = M0
appear exactly once, 0 0 1 x’y’z = m1 x+y+z’ = M1
either complemented
0 1 0 x’yz’ = m2 x+y’+z = M2
or uncomplemented
• Maxterm: 0 1 1 x’yz = m3 x+y’+z’= M3

 a sum term in which 1 0 0 xy’z’ = m4 x’+y+z = M4


…. 1 0 1 xy’z = m5 x’+y+z’ = M5
 Minterms and Maxterms
1 1 0 xyz’ = m6 x’+y’+z = M6
are easy to denote using a
truth table. 1 1 1 xyz = m7 x’+y’+z’ = M7

• Observe that: mj = Mj’


79
Canonical Forms: Unique
 Any Boolean function F( ) can be
expressed as a unique sum of
minterms (and a unique product of
maxterms)
 In other words, every function F() has
two canonical forms:
− Canonical Sum-Of-Products (sum of
minterms)
− Canonical Product-Of-Sums (product of
maxterms)

80
Canonical Forms (cont.)

• Canonical Sum-Of-Products:
The minterms included are those mj’s
such that F( ) = 1 in row j of the truth
table for F( ).
• Canonical Product-Of-Sums:
The maxterms included are those Mj’s
such that F( ) = 0 in row j of the truth
table for F( ).
81
Example
a b c f1
f1(a,b,c) = m1 + m2 + m4 + m6
0 0 0 0
0
= a’b’c + a’bc’ + ab’c’ + 0 0 1 1 1
abc’
0 1 0 2 1
0 1 1 3 0
f1(a,b,c) = M0 • M3 • M5 • M7
1 0 0 4 1
= (a+b+c)•(a+b’+c’)• 1 0 1 5 0
(a’+b+c’)•(a’+b’+c’). 1 1 0 6 1
1 1 1 7 0

82
Shorthand: ∑ and ∏

• f1(a,b,c) = ∑ m(1,2,4,6),
 m1+ m2 + m4 + m6.
• f1(a,b,c) = ∏ M(0,3,5,7),
 M0 . M3 . M5 . M7.

83
Conversion Between Canonical Forms

1. Replace ∑ with ∏ (or vice versa)


2. Replace those j’s that appeared in the original
form with those that do not.
• Example:
 f1(a,b,c) = a’b’c + a’bc’ + ab’c’ + abc’
= m1 + m2 + m4 + m6
= ∑(1,2,4,6)
= ∏(0,3,5,7)
=
(a+b+c)•(a+b’+c’)•(a’+b+c’)•(a’+b’+c’)

84
Standard Forms (NOT Unique)
Standard forms are “like” canonical
forms,
− Not all variables need appear in the
individual product (SOP) or sum (POS)
terms.
• Example:
 f1(a,b,c) = a’b’c + bc’ + ac’
is a standard sum-of-products form
 f1(a,b,c) = (a+b+c)•(b’+c’)•(a’+c’)
is a standard product-of-sums form.
85
Graphic Look at SoP and PoS
An Arbitrary Boolean Function

Canonical SoP or Canonical PoS


sum of minterms or product of
maxterms

Sum of Products Product of Sums

86
Alternative Implementations
A
F(A,B,C) = Sm(3,4,5,6,7)
F = A' B C + A B' C' + A B' C + A B C' + A B C
B

Canonical Sum of Products


F1
C

Minimized Sum of Products

F2
A + BC

Canonical Products of Sums

F3

F(A,B,C) = PM(0,1,2)
= (A + B + C) (A + B + C') (A + B' + C)

87
Conversion of SOP from
standard to canonical
Expand non-canonical terms by inserting
equivalent of 1 in each missing variable
− x: (x + x’) = 1
Remove duplicate minterms
f1(a,b,c) = a’b’c + bc’ + ac’
= a’b’c + (a+a’)bc’ + a(b+b’)c’
= a’b’c + abc’ + a’bc’ + abc’ +
ab’c’
= a’b’c + abc’ + a’bc + ab’c’
88
Conversion of POS from
standard to canonical
Expand noncanonical terms by adding 0 in
terms of missing variables (e.g., xx’ = 0) and
using the distributive law
Remove duplicate maxterms
f1(a,b,c) = (a+b+c)•(b’+c’)•(a’+c’)
= (a+b+c)•(aa’+b’+c’)•(a’+bb’+c’)
= (a+b+c)•(a+b’+c’)•(a’+b’+c’)•
(a’+b+c’)•(a’+b’+c’)
=
(a+b+c)•(a+b’+c’)•(a’+b’+c’)•(a’+b+c’)
89
More Logic Gates
• NAND:
 NOT-AND
− Its output = 1, only if both inputs are not 1.
− (A • B)’

A B )A.B(

0 0 1
0 1 1
1 0 1
1 1 0
 has traditionally been the universal gate in digital circuits.
− It is simple to implement in hardware and can be used to construct
the other gates.

90
More Logic Gates
• NOR:
 NOT-OR
− Its output = 1, only if no input is 1.
− (A + B)’
A B ’)A+B(
0 0 1
0 1 0
1 0 0
1 1 0

 Can be a universal gate.

91
More Logic Gates
• XOR:
 Inequality
− Its output = 1, only if exactly one input is 1.
− (A  B)
A B A XOR B
0 0 0
0 1 1
1 0 1
1 1 0

(A  B) = A.B’ + A’.B

92
More Logic Gates
• 3-input XOR:

− Its output = 1, only if one or three inputs are 1.


− (A  B  C)

A B C A XOR B XOR C
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1

93
More Logic Gates
• XNOR:
 Equality
− Its output = 1, only both inputs are equal.
− (A  B)’
A B A XNOR B
0 0 1
0 1 0
1 0 0
1 1 1

(A  B)’ = A.B + A’.B’

94
Theorems for XOR
X  0 X
X 1  X '
X  X 0
X  X ' 1
X  Y Y  X (commutativ e law)
( X  Y )  Z  X  (Y  Z )  X  Y  Z (associativ e law)
X (Y  Z )  XY  XZ (distributi ve law)

( X  Y )'  X  Y'  X'  Y  XY  X'Y'


( XY ' X ' Y )'  XY  X ' Y '

95
Problem Solving
 More often, we describe a logic function using the English-
language connectives “and,” “or,” and “not.”
• Example: CE Lift
 The MOVE output is 1 if
− a button in a floor (OUTSIDEB) is 1, and OPENB
button is 0 and door lift is closed (CLOSED = 1)

− or a button inside the lift (INSIDEB) is 1 and door lift is


closed (CLOSED = 1)

 OUTSIDEB is 1 if
− OUTBUTTON1 is 1 or OUTBUTTON2 is 1 or
OUTBUTTON3 is 1
 INSIDEB is 1 if
− KEY1 is 1 or KEY2 is 1 or KEY3 is 1

96
Problem Solving
 Sometimes we have to work with imprecise word
descriptions of logic functions,
• Example:
 “The ERROR output should be 1 if the GEAR,
CLUTCH, and BRAKE inputs are inconsistent.”

 Truth-table approach is best


− It allows us to determine the output required for every
input combination, based on our knowledge and
understanding of the problem environment
− e.g., the gear cannot be applied unless the clutch is
pressed.

97
‫‪Example‬‬
‫‪• A 4-bit Prime Number Detector‬‬
‫)‪F = SN3,N2,N1,N0(1, 2, 3, 5, 7, 11, 13‬‬
‫‪=N3¢.N2¢.N1¢.N0 + N3¢.N2¢.N1.N0¢ + N3¢.N2¢.N1.N0+‬‬
‫‪N3¢.N2.N1¢.N0 + N3¢.N2.N1.N0 + N3.N2¢.N1.N0 +‬‬
‫‪N3.N2.N1¢.N0‬‬
‫‪=N3¢.N1¢.N0 + N3¢.N2¢.N1 + N3¢.N2.N1.N0 +‬‬
‫‪N3.N2¢.N1.N0 + N3.N2.N1¢.N0‬‬
‫…=‬‫• براي عبارات پيچيده‪ ،‬کار بهينه سازي سخت تر مي‬
‫شود‪.‬‬
‫• روشي سيستماتيک و آسان تر‪ :‬نقشة کارنو‬
‫شما را از جبر بول بي نياز نمي کند‪.‬‬ ‫•‬ ‫‪98‬‬
7-Segment Decoder

• Seven-segment display:
7 LEDs (light emitting diodes), each one
controlled by an input a
1 means “on”, 0 means “off”
f b
Display digit “3”? g
Set a, b, c, d, g to 1
Set e, f to 0 e c

d
99
7-Segment Decoder

C0

C5 C1
C6

C4 C2
C3

C C C C C C C
0 1 2 3 4 5 6

4-bit Binary-to-7-segment
control signal
decoder

A B C D
100
7-Segment Decoder
• 7-Segment Decoder:
Input is a 4-bit binary code  4 inputs (A, B,
C, D).
Output is a 7-bit code (a,b,c,d,e,f,g) that
allows for the decimal equivalent to be
displayed.
a
• Example:
Input: 0000 f g b
Output: 1111110
e c
(a=b=c=d=e=f=1, g=0)
d
101
Binary-to-7Segment Truth Table

Digit ABCD abcdefg Digit ABCD abcdefg


0 0000 1111110 8 1000 1111111
9 1001 1110011
1 0001 0110000
1010 XXXXXXX
2 0010 1101101
1011 XXXXXXX
3 0011 1111001
1100 XXXXXXX
4 0100 0110011
1101 XXXXXXX
5 0101 1011011 1110 XXXXXXX
6 0110 1011111 1111 XXXXXXX
7 0111 1110000

??
102
Binary-to-7Segment Truth Table

Digit ABCD abcdefg Digit ABCD abcdefg


0 0000 1111110 8 1000 1111111
9 1001 111X011
1 0001 0110000
1010 XXXXXXX
2 0010 1101101
1011 XXXXXXX
3 0011 1111001
1100 XXXXXXX
4 0100 0110011
1101 XXXXXXX
5 0101 1011011 1110 XXXXXXX
6 0110 X011111 1111 XXXXXXX
7 0111 11100X0

??
103

You might also like