You are on page 1of 72

8/25/15

ECE 238L - 1
Computer Logic Design

Dr. Ramiro Jordan


rjordan@ece.unm.edu

ECE 238L – ECE Dept, Fall 2015


1

Textbook and Website


Fundamentals of Digital and
Computer Design with VHDL

Authors:
Richard S. Sandige
Michael L. Sandige

Website:
http://www.mhhe.com/sandige

ECE 238L – ECE Dept, Fall 2015


2

1
8/25/15

Boolean Algebra, Boolean


Functions, Truth Tables,
VHDL, and Gates
Dr. Ramiro Jordan
rjordan@ece.unm.edu

ECE 238L – ECE Dept, Fall 2015


3

ECE 238L – ECE Dept, Fall 2015


4

2
8/25/15

Boolean
Functions/Expressions
and Boolean Algebra

ECE 238L – ECE Dept, Fall 2015


5

Boolean Functions/Expressions
Boolean functions are used to specify logic or digital
circuits (yes-no, true-false, 0-1, salt-pepper, High-
Low, …). Specify a “state”.
Different ways to express Boolean Functions.
1.  Boolean Algebra is a mathematical form used to represent
Boolean functions.
2.  Gates are a graphical form to represent Boolean functions.
3.  VHDL (Very High Speed Integrated Circuit Hardware Description
Language) is a textual form to represent Boolean functions.

(Three more: K-MAPS, Truth Tables, Timing Diagrams)


One more?
Examples of Digital Circuits: ???
ECE 238L – ECE Dept, Fall 2015
6

3
8/25/15

Boolean Algebra
Basic mathematics needed for the study of the logic design of
Digital Systems. Has many other applications including Set
Theory and Mathematical Logic. Two-valued Boolean Algebra is
also referred to as Switching Algebra, all variables assume only
two values.

We will use a Boolean variable such as X or Y to represent the


input or output of a switching element. Each variable can only
take two different values. The symbols “1” or “0” are used to
represent these two values.

Also known as Binary Logic: deals with variables that take on two
discrete values, and with operations that assume logical
meaning.

ECE 238L – ECE Dept, Fall 2015


7

Boolean Algebra
The symbols “0” and “1” in Boolean Algebra do not have a
numeric value; instead they represent two different states in a
logical circuit and are the two values of a switching variable.

In a logic gate, 0 (usually) represents a range of low voltages, and


1 represents a range of high voltages. In a switch, 0 (usually)
represents an open switch, and 1 represents a closed circuit.

Logic gates are blocks of hardware (digital circuits) that produce a


logic-1 or a logic-0 output if input logic is valid. Digital circuit =
switching circuit = logic circuit = gate.

Well suited for the analysis and design of Digital Systems


(collection of digital circuits).

ECE 238L – ECE Dept, Fall 2015


8

4
8/25/15

Boolean Algebra

Algebra is defined on a set of elements, a set of operators, and a


number of postulates (laws) (unproven axioms).

Postulates are the building blocks from which it is possible to


deduce the rules, theorems, and properties of the algebraic
system.

Two-valued Boolean Algebra is defined on a set of elements


S={0,1}; a set of operators AND (intersection), OR (union), and
NOT (invert or complement).

Binary Logic ≠ Binary Arithmetic

ECE 238L – ECE Dept, Fall 2015


9

Boolean Algebra

Elements, Operators and Postulates (Laws – unproven axioms)

ECE 238L – ECE Dept, Fall 2015


10

5
8/25/15

Boolean Algebra
Algebra is defined on a set of elements, a
set of operators, and a number of
postulates (laws) (unproven axioms).

Postulates are the building blocks from


which it is possible to deduce the rules,
theorems, and properties of the algebraic
system.

Two-valued Boolean Algebra is defined on


a set of elements S={0,1}; a set of
operators AND (intersection), OR (union),
and NOT (invert or complement).

ECE 238L – ECE Dept, Fall 2015


11

Basic Operations
The basic operations of Boolean Algebra are AND, OR,
and complement (also known as the Inverse or NOT
operations)

Operator precedence: parentheses, NOT, AND, OR

EX: complement of 0 is 1, complement of 1 is 0. Symbol ‘ denotes


complementation.

EX: X’ = 1 if X = 0 and X’ = 0 if X = 1

Note : X = X'

ECE 238L – ECE Dept, Fall 2015


12

6
8/25/15

Basic Operations
The basic operations of Boolean Algebra are AND, OR, and
complement (also known as the Inverse or NOT operations)

EX: AND operation XY=Z, XŸY=Z Z=1 iff X=1 and Y=1
When two or more variables are ANDed together, the value of the
result will be 1 iff all the variables have the value 1. If any of the
variables have the value 0, the result of the AND operation will
be 0.
EX: OR operation X+Y=Z, XvY=Z Z=0 iff X=0 and Y=0
When two or more variables are ORed together, the value of the
result will be 1 iff any of the variables have the value 1. The
result of the OR operation will be a 0 iff all of the variables have
the value 0.

NOTE: Binary Logic (Boolean Algebra) ≠ Binary Arithmetic

ECE 238L – ECE Dept, Fall 2015


13

INVERTER (NOT)
The electronic circuit which forms the
inverse of X is referred to as an inverter

X' = 1 if X = 0
X' = 0 if X = 1

ECE 238L – ECE Dept, Fall 2015


14

7
8/25/15

AND (INTERSECTION)
Truth Table
AND Gate
Note that C = 1 if
and only if A and B
are both 1.

Input Output

ECE 238L – ECE Dept, Fall 2015


15

OR (UNION)
Truth Table
OR Gate
Note that C = 1 if and
only if A or B (or both)
are 1.

Input Output

ECE 238L – ECE Dept, Fall 2015


16

8
8/25/15

Switching Algebra
Switches
If switch X is open, then we will define the value
of X to be 0; if switch X is closed, then we will
define the value of X to be 1.
Seventh way of
playing with Boolean
Functions!!!!

ECE 238L – ECE Dept, Fall 2015


17

Switching Algebra

T = AB

ECE 238L – ECE Dept, Fall 2015


18

9
8/25/15

Switching Algebra

T = A+B

ECE 238L – ECE Dept, Fall 2015


19

TABLE 1.1 Major binary operators with variables (or


signals) in a Boolean expression

Operator precedence: parentheses, NOT, AND, OR

ECE 238L – ECE Dept, Fall 2015


20

10
8/25/15

Venn Diagrams, Black


Boxes for Boolean
Functions, and Basic
Functions

ECE 238L – ECE Dept, Fall 2015


21

Venn Diagrams for the


Complement, Intersection and
Union operators
Graphical representation of algebraic operation.

ECE 238L – ECE Dept, Fall 2015


22

11
8/25/15

Black Boxes for Boolean


Functions

One Boolean function that meets the criteria for


the black box is F=X’

Independent Dependent
variable variable

ECE 238L – ECE Dept, Fall 2015


23

Contents of the black box are


unknown.

Independent
variables

Dependent
variable
Two Boolean functions that meet the criteria for
the black box are F=XY and F=X+Y

ECE 238L – ECE Dept, Fall 2015


24

12
8/25/15

Basic Logic Symbols

ECE 238L – ECE Dept, Fall 2015


25

Logic circuit diagrams for Boolean


functions F1, F2, and F3

ECE 238L – ECE Dept, Fall 2015


26

13
8/25/15

Truth Tables for the NOT, AND,


and OR operator definitions

ECE 238L – ECE Dept, Fall 2015


27

Definition of binary operators


NOT, AND, and OR

ECE 238L – ECE Dept, Fall 2015


28

14
8/25/15

Boolean Algebra
Postulates and
Theorems

ECE 238L – ECE Dept, Fall 2015


29

Boolean Algebra

Elements, Operators and Postulates (Laws – unproven axioms)

ECE 238L – ECE Dept, Fall 2015


30

15
8/25/15

Boolean Algebra
Algebra is defined on a set of elements, a
set of operators, and a number of
postulates (laws) (unproven axioms).

Postulates are the building blocks from


which it is possible to deduce the rules,
theorems, and properties of the algebraic
system.

Two-valued Boolean Algebra is defined on


a set of elements S={0,1}; a set of
operators AND (intersection), OR (union),
and NOT (invert or complement).

ECE 238L – ECE Dept, Fall 2015


31

Boolean Algebra Postulates: List of


Huntington's first set of postulates
Each postulate or rule has a dual: interchange the
identity elements (0,1) and the binary operators
(AND, OR)

ECE 238L – ECE Dept, Fall 2015


32

16
8/25/15

Boolean Algebra Theorems

ECE 238L – ECE Dept, Fall 2015


33

Comparing circuit complexity for the Boolean


functions F1 and F2
In general, it is better to use fewer logic gates to
minimize complexity, cost, and power requirements.

Adjacency
Theorem

ECE 238L – ECE Dept, Fall 2015


34

17
8/25/15

Proving Boolean Algebra Theorems

ECE 238L – ECE Dept, Fall 2015


35

Proof of Adjacency Theorem

ECE 238L – ECE Dept, Fall 2015


36

18
8/25/15

Boolean Algebra or
Switching Algebra

ECE 238L – ECE Dept, Fall 2015


37

More on Switching Algebra

If two switches are both labeled with the variable A, this means that both
switches are open when A = 0 and both are closed when A = 1, thus the
following circuits are equivalent:

ECE 238L – ECE Dept, Fall 2015


38

19
8/25/15

Switching Algebra

ECE 238L – ECE Dept, Fall 2015


39

Switching Algebra

ECE 238L – ECE Dept, Fall 2015


40

20
8/25/15

Switching Algebra

ECE 238L – ECE Dept, Fall 2015


41

Switching Algebra

A in parallel with A’ can be replaced with a closed circuit because one or


the other of the two switches is always closed.

ECE 238L – ECE Dept, Fall 2015


42

21
8/25/15

Switching Algebra

Similarly, switch A in series with A’ can be replaced with an open circuit


because one or the other of the two switches is always open.

ECE 238L – ECE Dept, Fall 2015


43

Boolean Functions,
Truth Tables,
and Logic Circuits

ECE 238L – ECE Dept, Fall 2015


44

22
8/25/15

Truth Table for XOR function: Odd function

X≠Y

ECE 238L – ECE Dept, Fall 2015


45

Boolean Expressions/Functions
and Truth Tables
Boolean expressions are formed by application of the basic
operations to one or more variables or constants.
Parentheses are added as needed to specify the order in
which the operations are performed.

A Truth Table (also called a table of combinations) is a Table


of all possible combinations of variables. It specifies the
values of a given Boolean expression for every possible
combination of values of the variables in the expression.
It shows the relationship between variables and result of
operation. Input/Output relationship.

ECE 238L – ECE Dept, Fall 2015


46

23
8/25/15

Expressions/Boolean Functions
Each appearance of a variable or its complement in
an expression will be referred to as a literal.

Each literal in an expression corresponds to a gate


input.

AB’C+A’B+A’BC’+B’C’: 3 variables, 10 literals

ABC+A’BE+B’C’D: 5 variables, 9 literals

ECE 238L – ECE Dept, Fall 2015


47

Summary: Boolean Functions

An expression formed with:


1)  Binary variables (take value 0 or 1)
2)  Binary operators (AND, OR, NOT, other)
3)  Parenthesis and equal sign
4)  Operator precedence: parentheses, NOT, AND, OR

ECE 238L – ECE Dept, Fall 2015


48

24
8/25/15

Boolean Functions
• Algebraic expression (many for same function)
•  Problem: possible to have two or more
expressions that specify the same function
•  Solution: simplification of expressions
•  Algebraic manipulations
• Truth Table (only one for a function)
•  With n number of variables then we have n
columns and 2n number of rows
• Can be transformed
•  Boolean functions çè Logic gates

ECE 238L – ECE Dept, Fall 2015


49

Powers of 2n
Base   Power   Result   Denomina2on  
               
2   1   2      
    2   4      
    3   8      
    4   16      
    5   32      
    6   64      
    7   128      
    8   256      
    9   512      
    10   1024  KILO  
    11   2048      
    12   4096      
    13   8192      
    14   16384      
    15   32768      
    16   65536      
    17   131072      
    18   262144      
    19   524288      
    20   1048576  MEGA  
    30   1073741824  GIGA  
        1073741824      
        1.09951E+12      
    40   1.09951E+12  TERA  
               

ECE 238L – ECE Dept, Fall 2015


50

25
8/25/15

Circuits for Expressions and


Boolean Functions

F = AB’ + C: 3 variables,
3 literals

F = [A(C + D)]’ + BE:


5 variables, 5 literals
ECE 238L – ECE Dept, Fall 2015
51

Other Logic Operations

ECE 238L – ECE Dept, Fall 2015


52

26
8/25/15

Other Logic Operations


n
For n binary variables there are 2 2 functions.

For two-valued Boolean Algebra, 2 variables, there are

2 2 = 2 2 = 16€
n 2

16 possible Boolean functions. AND, OR are two of the


16. All 16 functions can be expressed algebraically
€ by means of Boolean expressions.

Other extensively used functions are NOR, NAND, XOR, XNOR

ECE 238L – ECE Dept, Fall 2015


53

Other Logic Operations

ECE 238L – ECE Dept, Fall 2015


54

27
8/25/15

Truth Tables and


Canonical or Standard
Forms

ECE 238L – ECE Dept, Fall 2015


55

Truth Table
We can use a Truth Table to specify the output values of a
circuit of logic gates in terms of the values of the input
variables. Input/Output relationship.

If an expression has n variables and each variable can


have the value 0 or 1, the number of different combinations
of values of the variables is 2n.

Thus, a Truth Table for an n-variable expression will have n


columns and 2n rows.

Two expressions are equal if they have the same value for
every possible combination of the variables.

ECE 238L – ECE Dept, Fall 2015


56

28
8/25/15

Boolean Functions and


Truth Tables
EX: F=X’YZ’ implies that F=1 if X’=0, Y=1, and
Z’=0 otherwise F=0

Truth Table: X Y Z F
n=3; number of columns 0 0 0 0
2n=23=8; number of rows 0 0 1 0
Same as X’YZ’ 0 1 0 1
0 1 1 0
(minterm if F = 1 1 0 0 0
1 0 1 0
maxterm if F = 0) 1 1 0 0
1 1 1 0
Input Output
ECE 238L – ECE Dept, Fall 2015
57

Two Input Circuit and


Truth Table
Figure shows a truth table which
specifies the output of the circuit
in Figure (a) for all possible
combinations of values of the
inputs A and B.

Input Output

ECE 238L – ECE Dept, Fall 2015


58

29
8/25/15

Truth Table for 3 variables


Since the expression (A + C)(B’ + C) has the same value as AB’ + C
for all eight combinations of values of the variables A, B, and C, we
conclude that:
AB’ + C = (A + C)(B’ + C)

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


000 1 0 0 0 1 0
001 1 0 1 1 1 1
010 0 0 0 0 0 0
011 0 0 1 1 1 1
100 1 1 1 1 1 1
101 1 1 1 1 1 1
110 0 0 0 1 0 0
111 0 0 1 1 1 1

ECE 238L – ECE Dept, Fall 2015


59

Deriving Boolean Functions from


Truth Tables
A standard way of expressing a logic function or
Boolean function is by a Truth Table.
•  Boolean Function
•  F = Boolean expression (in terms of the 1s of
the function), or
•  F = Boolean expression (in terms of the 0s of
the function)

ECE 238L – ECE Dept, Fall 2015


60

30
8/25/15

Canonical or Standard Forms


•  A binary variable may be in its normal form, X, or
on its complement form, X’.
•  Minterm or Standard Product (chase the 1s):
•  A product term in which all variables appear exactly once in either
true or complemented form
•  Product term is derived from a truth table for which the function is
equal to 1
•  Each minterm is obtained from an AND operation of all variables,
with each variable complemented if corresponding bit of the binary
number is 0 and uncomplemented if it is a 1
•  For n variables, there is 2n distinct minterms (0 to [2n -1])
•  Symbol for minterms is mj; j is the decimal equivalent of the binary
number
ECE 238L – ECE Dept, Fall 2015
61

Canonical or Standard Forms


•  A binary variable may be in its normal form, X, or
on its complement form, X’.
•  Maxterm or Standard Sum (chase the 0s):
•  Each sum term is obtained from an OR operation of all the
variables, with each variable being complemented if the
corresponding bit is 1 and uncomplemented if 0
•  For n variables, there is 2n distinct maxterms (0 – [2n - 1])
•  Symbol for a maxterm is Mj , j is the decimal equivalent of the binary
number
•  All variables appear exactly once in either true or complemented
form

ECE 238L – ECE Dept, Fall 2015


62

31
8/25/15

Canonical or Standard Forms


One variable

A Function Minterm Maxterm

0 m0 – A’ M0 – A

1 m1 – A M1 – A'

Each minterm is the complement of corresponding


maxterm and vice versa

ECE 238L – ECE Dept, Fall 2015


63

Canonical or Standard Forms


Two variables

A B Function Minterm Maxterm

0 0 m0 - A'B' M0 - A+B

0 1 m1 - A'B M1 - A+B'

1 0 m2 - AB' M2 - A'+B

1 1 m3 - AB M3 - A'+B'

Each maxterm is the complement of corresponding


minterm and vice versa

ECE 238L – ECE Dept, Fall 2015


64

32
8/25/15

Ex: 2 variables A and B

For 2 variables m2 = AB’


m2’ = (AB’)’ = A‘ + B M2

Each maxterm is the complement of corresponding


minterm and vice versa

ECE 238L – ECE Dept, Fall 2015


65

Canonical or Standard Forms


Two variables
A B Function Minterm Maxterm

0 0 1 m0 - A'B' M0 - A+B
XNOR
0 1 0 m1 - A'B M1 - A+B'

1 0 0 m2 - AB' M2 - A'+B

1 1 1 m3 - AB M3 - A'+B'

Sum of minterns, denotes ORing:


F = A’B’ + AB = m0 + m3 = ∑ m(0,3)
Complement of F:
F’ = A’B + AB’ = m1 + m2 =∑ m(1,2)

ECE 238L – ECE Dept, Fall 2015
66

33
8/25/15

Canonical or Standard Forms


Two variables
A B Function Minterm Maxterm

0 0 1 m0 - A'B' M0 - A+B
XNOR
0 1 0 m1 - A'B M1 - A+B'

1 0 0 m2 - AB' M2 - A'+B

1 1 1 m3 - AB M3 - A'+B'

Product of maxterms, denotes ANDing:


F = (A + B’) (A’ + B)= M1 M2 = ∏ M(1,2)
Complement of F:
F’ = (A + B)(A’ + B’) = M0 M3 = ∏ M(0,3)

ECE 238L – ECE Dept, Fall 2015
67

Canonical or Standard Forms


Two variables

A B Function Minterm Maxterm

0 0 1 m0 - A'B' M0 - A+B
XNOR
0 1 0 m1 - A'B M1 - A+B'

1 0 0 m2 - AB' M2 - A'+B

1 1 1 m3 - AB M3 - A'+B'

NOTE: mj’ = Mj and vice versa

ECE 238L – ECE Dept, Fall 2015


68

34
8/25/15

Canonical or Standard Forms


Three variables

A B C Function Minterm Maxterm

0 0 0 m0 - A'B'C' M0 - A+B+C

0 0 1 m1 - A'B'C M1 - A+B+C'

0 1 0 m2 - A'BC' M2 - A+B'+C

0 1 1 m3 - A'BC M3 - A+B'+C'

1 0 0 m4 - AB'C' M4 - A'+B+C

1 0 1 m5 - AB'C M5 - A'+B+C'

1 1 0 m6 - ABC' M6 - A'+B'+C

1 1 1 m7 - ABC M7 - A'+B'+C'

ECE 238L – ECE Dept, Fall 2015


69

Canonical or Standard Forms


Four variables
A B C D Function Minterm Maxterm
0 0 0 0 m0 - A'B'C'D' M0 - A+B+C+D
0 0 0 1 m1 - A'B'C'D M1 - A+B+C+D'
0 0 1 0 m2 - A'B'CD' M2 - A+B+C'+D
0 0 1 1 m3 - A'B'CD M3 - A+B+C'+D'
0 1 0 0 m4 - A'BC'D' M4 - A+B'+C+D
0 1 0 1 m5 - A'BC'D M5 - A+B'+C+D'
0 1 1 0 m6 - A'BCD' M6 - A+B'+C'+D
0 1 1 1 m7 - A'BCD M7 - A+B'+C'+D'
1 0 0 0 m8 - AB'C'D' M8 - A'+B+C+D
1 0 0 1 m9 - AB'C'D M9 - A'+B+C+D'
1 0 1 0 m10 -AB'CD' M10 - A'+B+C'+D
1 0 1 1 m11 - AB'CD M11 - A'+B+C'+D'
1 1 0 0 m12 - ABC'D' M12 - A'+B'+C+D
1 1 0 1 m13 - ABC'D M13 - A'+B'+C+D'
1 1 1 0 m14 - ABCD' M14 -A'+B'+C'+D
1 1 1 1 m15 - ABCD M15 - A'+B'+C'+D'

ECE 238L – ECE Dept, Fall 2015


70

35
8/25/15

Canonical or Standard Forms


Five variables
A B C D E Function Minterm Maxterm
0 0 0 0 0 m0 - A'B'C'D'E' M0 - A+B+C+D+E
0 0 0 0 1 m1 - A'B'C'D'E M1 - A+B+C+D+E'
0 0 0 1 0 m2 - A'B'C'DE' M2 - A+B+C'+D'+E
0 0 0 1 1 m3 - A'B'CD M3 - A+B+C'+D'
0 0 1 0 0 m4 - A'B'C'D' M4 - A+B'+C+D
0 0 1 0 1 m5 - A'BC'D M5 - A+B'+C+D'
0 0 1 1 0 m6 - A'BCD' M6 - A+B'+C'+D
0 0 1 1 1 m7 - A'BCD M7 - A+B'+C'+D'
0 1 0 0 0 m8 - AB'C'D' M8 - A'+B+C+D
0 1 0 0 1 m9 - AB'C'D M9 - A'+B+C+D'
0 1 0 1 0 m10 - AB'CD' M10 - A'+B+C'+D Complete/Correct the
0 1 0 1 1 m11 - AB'CD M11 - A'+B+C'+D'
0 1 1 0 0 m12 - ABC'D' M12 - A'+B'+C+D Truth Table
0 1 1 0 1 m13 - ABC'D M13 - A'+B'+C+D'
0 1 1 1 0 m14 - ABCD' M14 - A'+B'+C'+D
0 1 1 1 1 m15 - ABCD M15 - A'+B'+C'+D'
1 0 0 0 0 m0 - A'B'C'D' M0 - A+B+C+D
1 0 0 0 1 m1 - A'B'C'D M1 - A+B+C+D'
1 0 0 1 0 m2 - A'B'CD' M2 - A+B+C'+D
1 0 0 1 1 m3 - A'B'CD M3 - A+B+C'+D'
1 0 1 0 0 m4 - A'B'C'D' M4 - A+B'+C+D
1 0 1 0 1 m5 - A'BC'D M5 - A+B'+C+D'
1 0 1 1 0 m6 - A'BCD' M6 - A+B'+C'+D
1 0 1 1 1 m7 - A'BCD M7 - A+B'+C'+D'
1 1 0 0 0 m8 - AB'C'D' M8 - A'+B+C+D
1 1 0 0 1 m9 - AB'C'D M9 - A'+B+C+D'
1 1 0 1 0 m10 - AB'CD' M10 - A'+B+C'+D
1 1 0 1 1 m11 - AB'CD M11 - A'+B+C'+D'
1 1 1 0 0 m12 - ABC'D' M12 - A'+B'+C+D
1 1 1 0 1 m13 - ABC'D M13 - A'+B'+C+D'
1 1 1 1 0 m14 - ABCD' M14 - A'+B'+C'+D
1 1 1 1 1 m15 - ABCDE M15 - A'+B'+C'+D'+E'

ECE 238L – ECE Dept, Fall 2015


71

Canonical or Standard Forms


NOTE: Boolean Functions are said to be in “Canonical
Form” if expressed as:
•  Sum of Minterms (SOM)
•  Product of Maxterms (POM)
NOTE: for SOM or POM each term must contain all the
variables
•  to implement the function in hardware (logic gates)
the Boolean function needs to be minimized (SOP,
POS)
EX: F(X,Y,Z) = ∑ m(1,2,5,7) = ∏ M(0,3,4,6)
ECE 238L – ECE Dept, Fall 2015
72

36
8/25/15

Boolean Functions:
Minterms and
Maxterms

ECE 238L – ECE Dept, Fall 2015


73

Boolean Functions
A Boolean Function may be expressed algebraically
from a Truth Table by:
•  1) Sum of Minterms:
•  forming a minterm for each combination of the variables that
produce a “1” in the function, and taking the OR of all minterms

•  2) Product of Maxterms:
•  forming a maxterm for each combination of all the maxterms
variables which produce a “0” in the function, and takes the AND of
all maxterms

ECE 238L – ECE Dept, Fall 2015


74

37
8/25/15

Minterm and Maxterm Expansions

f = A′BC + AB′C′ + AB′C + ABC′ + ABC

Each of the terms in the above equation is referred to as a


minterm. In general, a minterm of n variables is a product of
n literals in which each variable appears exactly once in
either true or complemented form, but not both.

(A literal is a variable or its complement)

ECE 238L – ECE Dept, Fall 2015


75

Minterms and Maxterms for


Three Variables

Input Output: Minterms & Maxterms

ECE 238L – ECE Dept, Fall 2015


76

38
8/25/15

Minterm and Maxterm Expansions


Minterm expansion for a function is unique. Look at the
equation bellow, it can be rewritten in terms of m-notation
as:
f = A′BC + AB′C′ + AB′C + ABC′ + ABC
f (A, B, C) = m3 + m4 + m5 + m6 + m7

This can be further abbreviated by listing only the decimal


subscripts in the form:

f (A, B, C) = Ʃ m(3, 4, 5, 6, 7)

ECE 238L – ECE Dept, Fall 2015


77

Minterm Expansion Example


Find the minterm expansion of f(a,b,c,d) = a'(b' + d) + acd'.

ECE 238L – ECE Dept, Fall 2015


78

39
8/25/15

Maxterm Expansion Example


Find the maxterm expansion of f(a,b,c,d) = a'(b' + d) + acd'.

ECE 238L – ECE Dept, Fall 2015


79

General Truth Table for Three Variables

Table represents a truth table for


a general function of three
variables. Each ai is a constant
with a value of 0 or 1.

ECE 238L – ECE Dept, Fall 2015


80

40
8/25/15

General Minterm and Maxterm


Expansions
We can write the minterm expansion for a general function
of three variables as follows; ai = 1:

The maxterm expansion for a general function of three


variables is; ai = 0:

ECE 238L – ECE Dept, Fall 2015


81

Conversion of Forms
Summarizes the procedures for conversion between
minterm and maxterm expansions of F and F'

ECE 238L – ECE Dept, Fall 2015


82

41
8/25/15

Example

ECE 238L – ECE Dept, Fall 2015


83

Truth Table for EXAMPLE 1-7

ECE 238L – ECE Dept, Fall 2015


84

42
8/25/15

Truth Table for EXAMPLE 1.8

ECE 238L – ECE Dept, Fall 2015


85

VHDL Basics

ECE 238L – ECE Dept, Fall 2015


86

43
8/25/15

Writing VHDL Designs for Simple Gate


Functions
A VHDL Design consists of three parts: library part, entity
declaration, and architecture declaration.
The terms entity and architecture are the main sections of
VHDL you need to become familiar.
Like any other programming language there are keywords,
reserved words, that cannot be used freely.

Entity contains the description for the inputs and the


outputs in a circuit just like a black box.
Architecture contains the description of an actual logic
circuit in terms of a Boolean function.

ECE 238L – ECE Dept, Fall 2015


87

Structure of VHDL Code


•  Library files that are used in design

Library
•  library IEEE;
•  use IEEE.STD_LOGIC_1164.ALL;
•  use IEEE.STD_LOGIC_ARITH.ALL;

•  Define Input and Output Ports

Entity
•  Assume the design as a black box
•  Definition of the type of data for the inputs
and outputs

•  Definition of Entity

Architecture
•  Declaration of Signals, Variables and
Components
•  Functionality of the Black box

ECE 238L – ECE Dept, Fall 2015


88

44
8/25/15

VHDL Design for a NOT function

ECE 238L – ECE Dept, Fall 2015


89

VHDL Design for a NOT function

ECE 238L – ECE Dept, Fall 2015


90

45
8/25/15

VHDL Design for a NOT function

ECE 238L – ECE Dept, Fall 2015


91

VHDL Design for a NOT function

ECE 238L – ECE Dept, Fall 2015


92

46
8/25/15

VHDL Design for a NOT function

ECE 238L – ECE Dept, Fall 2015


93

WAVEFORM for NOT function

ECE 238L – ECE Dept, Fall 2015


94

47
8/25/15

VHDL Design for an AND function

ECE 238L – ECE Dept, Fall 2015


95

WAVEFORM for AND function

ECE 238L – ECE Dept, Fall 2015


96

48
8/25/15

VHDL Design for an OR function

ECE 238L – ECE Dept, Fall 2015


97

WAVEFORM for OR function

ECE 238L – ECE Dept, Fall 2015


98

49
8/25/15

Logic symbol summary for the XOR operation

ECE 238L – ECE Dept, Fall 2015


99

Truth Table for XOR or ODD function

ECE 238L – ECE Dept, Fall 2015


100

50
8/25/15

VHDL Design for an XOR function

ECE 238L – ECE Dept, Fall 2015


101

WAVEFORM for XOR function

ECE 238L – ECE Dept, Fall 2015


102

51
8/25/15

Truth Table for NAND function

ECE 238L – ECE Dept, Fall 2015


103

Logic symbol summary for the NAND operation

ECE 238L – ECE Dept, Fall 2015


104

52
8/25/15

VHDL Design for NAND function

ECE 238L – ECE Dept, Fall 2015


105

WAVEFORM for NAND function

ECE 238L – ECE Dept, Fall 2015


106

53
8/25/15

Truth Table for NOR function

ECE 238L – ECE Dept, Fall 2015


107

Logic symbol summary for the NOR


operation

ECE 238L – ECE Dept, Fall 2015


108

54
8/25/15

VHDL Design for NOR function

ECE 238L – ECE Dept, Fall 2015


109

WAVEFORM for NOR function

ECE 238L – ECE Dept, Fall 2015


110

55
8/25/15

Truth Table for XNOR function

ECE 238L – ECE Dept, Fall 2015


111

Logic symbol summary for


the XNOR operation

ECE 238L – ECE Dept, Fall 2015


112

56
8/25/15

Logic symbol summary for the XNOR or


EVEN operation

X=Y

ECE 238L – ECE Dept, Fall 2015


113

VHDL Design for XNOR function

ECE 238L – ECE Dept, Fall 2015


114

57
8/25/15

WAVEFORM for XNOR function

ECE 238L – ECE Dept, Fall 2015


115

Truth Table for BUFFER function

ECE 238L – ECE Dept, Fall 2015


116

58
8/25/15

Logic symbol summary for


the BUFFER operation

ECE 238L – ECE Dept, Fall 2015


117

VHDL Design for BUFFER function

ECE 238L – ECE Dept, Fall 2015


118

59
8/25/15

WAVEFORM for BUFFER function

ECE 238L – ECE Dept, Fall 2015


119

Other Logic Functions,


Functionally Complete
Gates, Equivalent Logic
Circuits, International
Logic Symbols

ECE 238L – ECE Dept, Fall 2015


120

60
8/25/15

Truth Table for a Two-1s function F

ECE 238L – ECE Dept, Fall 2015


121

VHDL Design for Two-1s


function

ECE 238L – ECE Dept, Fall 2015


122

61
8/25/15

WAVEFORM for Two-1s function

ECE 238L – ECE Dept, Fall 2015


123

Other Logic Operations


n
For n binary variables there are 2 2 functions.

For two-valued Boolean Algebra, 2 variables, there are

2 2 = 2 2 = 16€
n 2

16 possible Boolean functions. AND, OR are two of the


16. All 16 functions can be expressed algebraically
€ by means of Boolean expressions.

Other extensively used functions are NOR, NAND, XOR, XNOR

ECE 238L – ECE Dept, Fall 2015


124

62
8/25/15

Other Logic Operations

ECE 238L – ECE Dept, Fall 2015


125

Functionally Complete Gates

Rule: Change AND to OR; change OR to AND; add bubbles to all inputs
and outputs, use double negation theorem

ECE 238L – ECE Dept, Fall 2015


126

63
8/25/15

Functionally Complete Gates

ECE 238L – ECE Dept, Fall 2015


127

Functionally Complete Gates

ECE 238L – ECE Dept, Fall 2015


128

64
8/25/15

Equivalent Gate Circuits

ECE 238L – ECE Dept, Fall 2015


129

Logic Symbols

ECE 238L – ECE Dept, Fall 2015


130

65
8/25/15

Rectangular Shape Logic


Symbols - IEEE

ECE 238L – ECE Dept, Fall 2015


131

Sample Problems

ECE 238L – ECE Dept, Fall 2015


132

66
8/25/15

Problem 1.18

ECE 238L – ECE Dept, Fall 2015


133

Problem 1.50

ECE 238L – ECE Dept, Fall 2015


134

67
8/25/15

Problem 1.54

ECE 238L – ECE Dept, Fall 2015


135

Problem 1.73

ECE 238L – ECE Dept, Fall 2015


136

68
8/25/15

Problem 1.74

ECE 238L – ECE Dept, Fall 2015


137

Problem 1.75

ECE 238L – ECE Dept, Fall 2015


138

69
8/25/15

Problem 1.84

ECE 238L – ECE Dept, Fall 2015


139

Problem 1.85

ECE 238L – ECE Dept, Fall 2015


140

70
8/25/15

Problem 1.86

ECE 238L – ECE Dept, Fall 2015


141

Problem 1.87

ECE 238L – ECE Dept, Fall 2015


142

71
8/25/15

ECE 238L – ECE Dept, Fall 2015


143

Q&A

ECE 238L – ECE Dept, Fall 2015


144

72

You might also like