Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Lecture 2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 60

Digital Circuits

Design
Dr. Omar A. M. Aly
Omar.aly@aun.edu.eg
Chapter 2:
Boolean Algebra
and Logic Gates

M. M. Mano, “Digital Design With an Introduction to the Verilog HDL,” 5th Edition, Pearson
Education, 2013.
Outline
Binary Logic and Gates
Boolean Algebra
Standard Forms
Other Gate Types
Exclusive-OR Operator and Gates

Digital Circuits Design Slide 3


Binary Logic and Gates
Binary variables take on one of two values.
Logical operators operate on binary values and binary variables.
Basic logical operators are the logic functions AND, OR and NOT.
Logic gates implement logic functions.
Boolean Algebra: a useful mathematical system for specifying and
transforming logic functions.
We study Boolean algebra as foundation for designing and analyzing digital
systems!

Digital Circuits Design Slide 4


Binary Variables
Recall that the two binary values have different names:
True/False
On/Off
Yes/No
1/0
We use 1 and 0 to denote the two values.
Variable identifier examples: A, B, y, z, or X1

Literal: A variable or its complement


Product term: literals connected by •
Sum term: literals connected by +
Digital Circuits Design Slide 5
Logical Operations
The three basic logical operations are:
AND
OR
NOT

AND is denoted by a dot (·)


OR is denoted by a plus (+).
NOT is denoted by an overbar ( ¯ ), a single quote mark (') after, or (~)
before the variable.

Digital Circuits Design Slide 6


Logical Operations
Notation Examples
Examples:
Y = A B is read “Y is equal to A AND B.”
z =x+y is read “z is equal to x OR y.”
X =A is read “X is equal to NOT A.”

 Note: The statement:


1 + 1 = 2 (read “one plus one equals two”)
is not the same as
1 + 1 = 1 (read “1 or 1 equals 1”).

Digital Circuits Design Slide 7


Logic Function Implementation
Using Switches Switches in parallel => OR
For inputs:
• logic 1 is switch closed
• logic 0 is switch open

For outputs:
• logic 1 is light on
• logic 0 is light off

Switches in series => AND

Digital Circuits Design Slide 8


Truth Tables
Truth table - a tabular listing of the values of a function for all possible
combinations of values on its arguments
Example: Truth tables for the basic logic operations:

Digital Circuits Design Slide 9


Logic Gates
In the earliest computers, switches were opened and closed by magnetic
fields produced by energizing coils in relays. The switches in turn opened
and closed the current paths.

Later, vacuum tubes that open and close current paths electronically
replaced relays.

Today, transistors are used as electronic switches that open and close
current paths.

Digital Circuits Design Slide 10


Logic Gates (continued)
Implementation of logic gates with transistors

Transistor gate circuits can be modeled by switch circuits


Digital Circuits Design Slide 11
Logic Diagrams and Expressions
Boolean equations, truth tables and logic diagrams describe the same
function!

Digital Circuits Design Slide 12


Boolean Algebra
Operator Precedence (‫)أولوية العمليات‬: The operator precedence for
evaluating Boolean expressions is:
1) parentheses,
2) NOT,
3) AND, and
4) OR

Digital Circuits Design Slide 13


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.
Example: F = a + (bc), Find FD
Answer: Following the replacement rules…
FD =a(b + c) = ab + ac

Be Sure not to alter the location of the parentheses if they are present.
Digital Circuits Design Slide 14
Duality
Unless it happens to be self-dual, the dual of an expression does not equal
the expression itself.

Digital Circuits Design Slide 15


Basic Theorems And Properties Of Boolean Algebra
Basic Theorems

Digital Circuits Design Slide 16


Boolean algebra: Basic Definitions
Boolean algebra, like any other deductive (‫ )استنتاجي‬mathematical system,
may be defined with:
oa set of elements
o a set of operators
oand a number of unproved axioms (‫ )البديهيات‬or postulates (‫)المسلمات‬

Digital Circuits Design Slide 17


Boolean algebra: Basic Definitions
Associative law (‫)القانون الترابطي‬: A binary operator * on a set S is said to be
associative whenever
(x * y) * z = x * (y * z) for all x, y, z, S.

Commutative law (‫)القانون تبادلي‬: A binary operator * on a set S is said to be


commutative whenever
x * y = y * x for all x, y  S

Digital Circuits Design Slide 18


Boolean algebra: Basic Definitions
Identity element: A set S is said to have an identity element with respect to
a binary operation * on S if there exists an element e  S with the property
that
e * x = x * e = x for every x  S.

Inverse: A set S having the identity element e with respect to a binary


operator * is said to have an inverse whenever, for every x  S, there exists
an element y  S such that

x * y = e.
Digital Circuits Design Slide 19
Boolean algebra: Basic Definitions
Distributive law (‫)قانون التوزيع‬: If * and . are two binary operators on a set S,
* is said to be distributive over . Whenever

x * (y . z) = (x * y) . (x * z)

Digital Circuits Design Slide 20


Boolean algebra: Basic Definitions
The operators and postulates have the following meanings:
oThe binary operator + defines addition.
oThe additive identity is 0.
oThe additive inverse defines subtraction.
oThe binary operator • defines multiplication.
oThe multiplicative identity is 1.
oFor a ≠ 0, the multiplicative inverse of a = 1/a defines division (i.e., a . 1/a =
1 ).
oThe only distributive law applicable is that of . over +:
a . (b + c) = (a .b) + (a . c)

Digital Circuits Design Slide 21


AXIOMATIC DEFINITION OF BOOLEAN ALGEBRA
Boolean algebra is an algebraic structure defined by a set of elements, B,
together with two binary operators, + and . , provided that the following
postulates are satisfied:
1. (a) The element 0 is an identity element with respect to +; that is,
x + 0 = 0 + x = x.

(b) The element 1 is an identity element with respect to . ; that is,


x . 1 = 1 . x = x.

Digital Circuits Design Slide 22


AXIOMATIC DEFINITION OF BOOLEAN ALGEBRA
2. (a) The structure is commutative with respect to +; that is,
x + y = y + x.
(b) The structure is commutative with respect to . ; that is,
x . y = y . x.

3. (a) The operator . is distributive over +; that is,


x . (y + z) = (x . y) + (x . z).
(b) The operator + is distributive over . ; that is,
x + (y . z) = (x + y) . (x + z).

Digital Circuits Design Slide 23


AXIOMATIC DEFINITION OF BOOLEAN ALGEBRA
4. For every element x  B, there exists an element x’  B (called the
complement of x) such that
(a) x + x’ = 1 and
(b) x . x’ = 0.

5. There exist at least two elements x, y  B such that x ≠ y.

Digital Circuits Design Slide 24


AXIOMATIC DEFINITION OF BOOLEAN ALGEBRA
Two‐Valued Boolean Algebra: A two‐valued Boolean algebra is defined on a
set of two elements, B = {0, 1}, with rules for the two binary operators + and
. as shown in the following operator tables
AND OR NOT

Digital Circuits Design Slide 25


AXIOMATIC DEFINITION OF BOOLEAN ALGEBRA
The distributive laws:
a) x.(y+z) = (x.y) + (x.z)
b) x+(y.z) = (x+y) . (x+z)

Digital Circuits Design Slide 26


Basic Theorems And Properties Of Boolean Algebra
Basic Theorems

Digital Circuits Design Slide 27


Boolean Function Evaluation

Digital Circuits Design Slide 28


Expression Simplification
An application of Boolean algebra
Simplify to contain the smallest number of literals (complemented and
uncomplemented variables):

Digital Circuits Design Slide 29


BOOLEAN FUNCTIONS
Example: Simplify the following Boolean functions to a minimum number
of literals.

Digital Circuits Design Slide 30


Complementing Functions
Use DeMorgan's Theorem to complement a function:
1. Interchange AND and OR operators
2. Complement each constant value and literal

Digital Circuits Design Slide 31


Overview – Canonical Forms
What are Canonical Forms?
Minterms and Maxterms
Index Representation of Minterms and Maxterms
Sum-of-Minterm (SOM) Representations
Product-of-Maxterm (POM) Representations
Representation of Complements of Functions
Conversions between Representations

Digital Circuits Design Slide 32


CANONICAL AND STANDARD FORMS
Minterms and Maxterms

Digital Circuits Design Slide 33


Canonical Forms
It is useful to specify Boolean functions in a form that:
Allows comparison for equality.
Has a correspondence to the truth tables

 Canonical Forms in common usage:


Sum of Minterms (SOM)
Product of Maxterms (POM)

Digital Circuits Design Slide 34


Examples – Four Variables

Digital Circuits Design Slide 35


Minterm and Maxterm Relationship
Review: DeMorgan's Theorem and

Two-variable example: and

Thus, M2 is the complement of m2 and vice-versa.


Since DeMorgan's Theorem holds for n variables, the above holds for terms
of n variables giving:
and

Thus, Mi is the complement of mi.

Digital Circuits Design Slide 36


Function Tables for Both
Each column in the maxterm function table is the complement of the
column in the minterm function table since Mi is the complement of mi.

Digital Circuits Design Slide 37


Observations
In the function tables:
Each minterm has one and only one 1 present in the 2n terms (a minimum of 1s). All other entries are
0.
Each maxterm has one and only one 0 present in the 2n terms All other entries are 1 (a maximum of
1s).
We can implement any function by "ORing" the minterms corresponding to "1" entries
in the function table. These are called the minterms of the function.
We can implement any function by "ANDing" the maxterms corresponding to "0" entries
in the function table. These are called the maxterms of the function.
This gives us two canonical forms:
Sum of Minterms (SOM)
Product of Maxterms (POM)
for stating any Boolean function.

Digital Circuits Design Slide 38


Minterm Function Example
Example: Find F1 = m1 + m4 + m7

Digital Circuits Design Slide 39


Minterm Function Example
 F(A, B, C, D, E) = m2 + m9 + m17 + m23
 F(A, B, C, D, E) =

Digital Circuits Design Slide 40


Maxterm Function Example
Example: Implement F1 in maxterms: F1 = M0 ·M2 · M3 ·M5 ·M6

F 1 = (x + y + z) ·(x + y + z)·(x + y + z )
·( x + y + z )·( x + y + z)

Digital Circuits Design Slide 41


Maxterm Function Example
Example: F( A , B, C, D) = M 3  M8  M11  M14

F(A, B,C,D) =

Digital Circuits Design Slide 42


Non-Canonical to Canonical form
Any Boolean function can be expressed as a Sum of Minterms.
For the function table, the minterms used are the terms corresponding to the 1's
For expressions, expand all terms first to explicitly list all minterms. Do this by
“ANDing” any term missing a variable v with a term ( v + v ).

Example: Implement f = x + x y as a sum of minterms.

First expand terms: f = x ( y + y ) + x y

Then distribute terms: f = xy + x y + x y

Express as sum of minterms: f = m3 + m2 + m0

Digital Circuits Design Slide 43


Another SOM Example
Example: F = A + B C
There are three variables, A, B, and C which we take to be the standard
order.
Expanding the terms with missing variables:

Collect terms (removing all but one of duplicate terms):


Express as SOM:
Digital Circuits Design Slide 44
Shorthand SOM Form
From the previous example, we started with:
F =A +B C
We ended up with:
F = m1+m4+m5+m6+m7
This can be denoted in the formal shorthand:
F( A, B, C) = m(1,4,5,6,7 )
Note that we explicitly show the standard variables in order and drop the
“m” designators.

Digital Circuits Design Slide 45


Canonical Product of Maxterms
Any Boolean Function can be expressed as a Product of Maxterms (POM).
For the function table, the maxterms used are the terms corresponding to
the 0's.
For an expression, expand all terms first to explicitly list all maxterms. Do
this by first applying the second distributive law , “ORing” terms missing
variable v with a term equal to v  v and then applying the distributive law
again.
Example: Convert to product of maxterms: f ( x , y , z ) = x + x y
Apply the distributive law: x + x y = (x + x )(x + y ) = 1  (x + y ) =x +y
Add missing variable z: x + y + z  z = ( x + y + z ) (x + y + z )
Express as POM: f = M2 ·M3

Digital Circuits Design Slide 46


Another POM Example

Digital Circuits Design Slide 47


Function Complements
The complement of a function expressed as a sum of minterms is
constructed by selecting the minterms missing in the sum-of-minterms
canonical forms.
Alternatively, the complement of a function expressed by a Sum of
Minterms form is simply the Product of Maxterms with the same indices.
Example: Given F ( x , y , z ) = m ( 1, 3 , 5 , 7 )
F ( x , y , z ) = m( 0, 2,4,6)
F ( x , y , z ) = PM(1, 3,5,7 )

Digital Circuits Design Slide 48


Conversion Between Forms
Conversion between Canonical Forms: The maxterm with subscript j is a
complement of the minterm with the same subscript j and vice versa, m’j =
Mj
To convert from one canonical form to another, interchange the symbols ∑
and ∏, and list those numbers missing from the original form

Example: F = xy +x’z
F(x, y, z) = ∑ (1, 3, 6, 7)
= ∏(0,2,4,5).

Digital Circuits Design Slide 49


Standard Forms
Standard Sum-of-Products (SOP) form: equations are written as an OR of
AND terms
Standard Product-of-Sums (POS) form: equations are written as an AND of
OR terms
Examples:
SOP: A B C + A B C + B
POS: (A + B) ·(A + B + C ) ·C
These “mixed” forms are neither SOP nor POS
(A B + C) (A + C)
A B C + A C (A + B)

Digital Circuits Design Slide 50


Standard Forms
Standard Forms: Another way to express Boolean functions is in standard
form. In this configuration, the terms that form the function may contain
one, two, or any number of literals.
There are two types of standard forms: the sum of products and products
of sums. This circuit configuration is referred to as a two‐level
implementation.

Digital Circuits Design Slide 51


Standard Forms
A Boolean function may be expressed in a
nonstandard form. For example, the function
F3 = AB + C(D + E)
 It can be changed to a standard form by
using the distributive law to remove the
parentheses:
F3 = AB + C(D + E) = AB + CD + CE
Two‐level implementation is preferred
because it produces the least amount of delay
through the gates when the signal propagates
from the inputs to the output.
Digital Circuits Design Slide 52
OTHER LOGIC OPERATIONS

Digital Circuits Design Slide 53


OTHER LOGIC OPERATIONS

Digital Circuits Design Slide 54


Logic Gate Symbols and Behavior
Logic gates have special symbols:

And waveform behavior in time as follows:

Digital Circuits Design Slide 55


OTHER LOGIC OPERATIONS
Two-input XOR Gate

Digital Circuits Design Slide 56


DIGITAL LOGIC GATES
Positive and Negative Logic:
oChoosing the high‐level H to Represent logic 1 defines a Positive logic
system.
oChoosing the low‐level L to Represent logic 1 defines a Negative logic
system.

Digital Circuits Design Slide 57


Levels of Integration
Digital ICs are often categorized according to the complexity of their
circuits, as measured by the number of logic gates in a single package.
oSmall‐scale integration (SSI) < 10 Gates.
oMedium‐scale integration (MSI) 10 <gates < 1000.
oLarge‐scale integration (LSI), processors, memory chips, and programmable
logic devices.
oVery large‐scale integration (VLSI), contain millions of gates, Examples are
large memory arrays and complex microcomputer chips

Digital Circuits Design Slide 58


Digital Logic Families
Many different logic families of digital integrated circuits have been
introduced commercially. The following are the most popular:
oTTL transistor–transistor logic;
oECL emitter‐coupled logic;
oMOS metal‐oxide semiconductor;
oCMOS complementary metal‐oxide semiconductor.

Digital Circuits Design Slide 59


Thanks and Feedback

Digital Circuits Design Slide 60

You might also like