You are on page 1of 41

Universitat Politècnica de Catalunya

Departament d’Enginyeria Electrònica


Electronic Systems

Topic 6

INTRODUCTION TO DIGITAL ELECTRONICS

Lectures: 3 hours
Exercises: 2 hours
Introduction to digital electronics

1.Logic gates
 Basic logic gates
 Logic-circuit diagrams and digital timing diagrams
Contents

2. Boole algebra

3. Logic simplification

2
Electronic Systems. Topic 6
LOGIC GATES

Logic gate: Electronic device that implements a logic


function of one or more binary variables (inputs). The result
(output) is also binary.

• n inputs, only one output.


• Powered by a DC voltage source.
Logic gates

• Usually, the binary digit “0” (sometimes termed “logic zero” or


“logic 0”) corresponds to a low-level voltage and the binary
digit “1” (sometimes referred to as “logic one” or “logic 1”)
corresponds to a high-level voltage.
• The low voltage is usually labelled “GND” and represented by
any of the following symbols

• The high-level voltage is usually labelled VDD or VCC.


3
Electronic Systems. Topic 6
LOGIC GATES

• The logic operation performed by the gate is described


by means of a truth table or a logic (or Boolean)
expression.

• Each logic gate is assigned a symbol


Logic gates

A B Y
0 0
A
Y 0 1
B 1 0
1 1

4
Electronic Systems. Topic 6
BASIC LOGIC GATES

• NOT gate or Inverter: Output value is obtained


by inverting (complementing) the input value.

• Symbol: • Logic expression:


Logic gates

𝑋𝑋 = 𝐴𝐴̅

• Truth table:
A X
0 1

1 0

5
Electronic Systems. Topic 6
BASIC LOGIC GATES

• OR gate (logic addition): Output is equal to “0”


only if all the inputs are “0”.
• Symbol: • Logic expression:

𝑋𝑋 = 𝐴𝐴 + 𝐵𝐵
Logic gates

• Truth table:
A B X
0 0 0
0 1 1
1 0 1
1 1 1
6
Electronic Systems. Topic 6
BASIC LOGIC GATES

• AND gate (logic product): Output is equal to


“1” only if all inputs are “1”.
• Symbol: • Logical expression:

𝑋𝑋 = 𝐴𝐴 ∙ 𝐵𝐵
Logic gates

• Truth table:

A B X
0 0 0
0 1 0
1 0 0
1 1 1
7
Electronic Systems. Topic 6
BASIC LOGIC GATES

• NOR gate (NOT OR): Output is equal to “1” only


if all the inputs are “0”
• Symbol: • Logical expression:

𝑋𝑋 = 𝐴𝐴 + 𝐵𝐵
Logic gates

• Truth table:
A B X
0 0 1
0 1 0
1 0 0
1 1 0
8
Electronic Systems. Topic 6
BASIC LOGIC GATES

• NAND gate (NOT AND): Output is equal to “0”


only if all the inputs are “1”
• Symbol: • Logical expression:
2.Logic gates

𝑋𝑋 = 𝐴𝐴 ∙ 𝐵𝐵
Logic gates

Truth table:
A B X
0 0 1
0 1 1
1 0 1
1 1 0
9
Electronic Systems. Topic 6
BASIC LOGIC GATES

• XOR gate (exclusive OR): Output equals “1” if


the inputs take different values.
• Logical expression:

𝑋𝑋 = 𝐴𝐴⨁𝐵𝐵
Logic gates

• Truth table:
A B X
0 0 0
0 1 1
•For more than 2 inputs:
1 0 1 The output equals “1” if there is an
1 1 0 odd number of inputs equal to “1”.
10
Electronic Systems. Topic 6
BASIC LOGIC GATES

• XNOR gate (exclusive NOR): Output equals “1” if


both inputs take the same value.
• Logical expression:
• Symbol:
𝑋𝑋 = 𝐴𝐴⨁𝐵𝐵
Logic gates

• Truth table:
A B X
0 0 1 • For more than 2 inputs:
0 1 0
The output equals “1” if there is an
even number of inputs equal to “1”.
1 0 0
1 1 1
11
Electronic Systems. Topic 6
LOGIC CIRCUIT DIAGRAM AND TIMING DIAGRAM

• Logic gates can be combined to build logic circuits.

• Logic circuit diagram (or just logic diagram):


Graphical representation of a logic circuit showing the
wiring and connections of each of its gates.
Logic gates

A B C Y
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 0
1 1 1 1

12
Electronic Systems. Topic 6
LOGIC CIRCUIT AND TIMING DIAGRAM

Timing diagram: Graphical representation of how the signals of a


logic circuit change over time

Example: AND gate a


b Y
c
a b c Y
Logic gates

0 0 0 0
0 0 1 0 c
0 1 0 0
0 1 1 0 b
1 0 0 0
1 0 1 0 a
1 1 0 0
1 1 1 1 Y

13
Electronic Systems. Topic 6
LOGIC CIRCUIT AND TIMING DIAGRAM

• Find out Y(t):

A A

[1] Y
[2]
B Y
B [3]
[3]
C
Logic gates

C
[2]
[1]

A A

B B

C C

Y Y
14
Electronic Systems. Topic 6
BIBLIOGRAPHY

 Ch. 3 of DIGITAL FUNDAMENTALS, 11TH edition, Thomas L. Floyd.


Editorial Pearson. Capítol: 3

A digital copy of the book (in Spanish) is available through the library
website: link.
Logic gates

15
Electronic Systems. Topic 6
INTRODUCTION TO DIGITAL ELECTRONICS

1.Logic gates
 Basic logic gates
Contents

 Logic-circuit diagrams and digital timing diagrams

2. Boole algebra

3. Logic simplification

16
Electronic Systems. Topic 6
BOOLEAN ALGEBRA

• Algebra:
Boolean algebra and simplification

A branch of mathematics that includes a group of


elements and of operations that can be performed on
those elements.
• Boolean algebra:
Branch of algebra in which variables are binary (allowed
values are “0”, “1”), and the operations are the logical
product (𝑎𝑎 · 𝑏𝑏), the logical addition (𝑎𝑎 + 𝑏𝑏), and the logical
negation or logical complementation (𝑎𝑎�).

Developed by George Boole in 1854 and adapted by


Claude E. Shannon in the 1930s to analyse circuits.

17
Electronic Systems. Topic 6
BOOLEAN ALGEBRA

• Basic operations
Boolean algebra and simplification

 Logical product (AND).


AND: A·B =1 if A =1 & B=1

 Logical addition (OR)


OR: A + B = 1 if A=1 or B=1 or both A=B=1

 Logical negation or inversion (NOT).


NOT: A̅ = 1 if A=0

• In a logic diagram, those operations correspond


to the AND, OR, and NOT gates.

18
Electronic Systems. Topic 6
Boolean algebra and simplification BOOLEAN ALGEBRA

19
Electronic Systems. Topic 6
BOOLEAN ALGEBRA

• DeMorgan theorem
Boolean algebra and simplification

𝑋𝑋 + 𝑌𝑌 = 𝑋𝑋� ∙ 𝑌𝑌� 𝑋𝑋 ∙ 𝑌𝑌 = 𝑋𝑋� + 𝑌𝑌�

20
Electronic Systems. Topic 6
LOGIC FUNCTIONS

• Logic (or boolean) function: a function whose input


Boolean algebra and simplification

variables and output belong to the Boole algebra.

• There are several ways to express a logic function:

 With a logic expression.


There are many Boolean formulas that are equivalent to a
given one.

 With its truth table.


It is the canonical representation of the function.

 Logic diagram.
There are as many logic diagrams as boolean equivalent
expressions.

21
Electronic Systems. Topic 6
Boolean algebra and simplification LOGIC FUNCTIONS

22
Electronic Systems. Topic 6
LOGIC FUNCTIONS

• A logic function has only ONE truth table but can be


expressed by a huge variety of equivalent Boolean
Boolean algebra and simplification

formulas

A B C X
0 0 0 1 � + 𝐶𝐶)(A
𝑋𝑋 = (𝐴𝐴 + B �+B � + 𝐶𝐶)
0 0 1 1
0 1 0 0 �∙B
𝑋𝑋 = A �+A � ∙ 𝐶𝐶 + 𝐴𝐴 ∙ B
� + 𝐴𝐴 ∙ 𝐶𝐶
0 1 1 1
� + 𝐶𝐶
𝑋𝑋 = B
1 0 0 1
1 0 1 1
1 1 0 0
1 1 1 1

23
Electronic Systems. Topic 6
CANONICAL FORMS: minterms

• Minterm: Given an n-variable logic function, any logical


Boolean algebra and simplification

product including all the variables (complemented or


not) once.
• Each minterm is equal to “1” for only one specific input
combination
A B C m0 m1 m2 m3 m4 m5 m6 m7
0 0 0 1 0 0 0 0 0 0 0 𝑚𝑚0 = 𝐴𝐴̅ ∙ 𝐵𝐵� ∙ 𝐶𝐶̅
0 0 1 0 1 0 0 0 0 0 0 𝑚𝑚1 = 𝐴𝐴̅ ∙ 𝐵𝐵� ∙ 𝐶𝐶
0 1 0 0 0 1 0 0 0 0 0 𝑚𝑚2 = 𝐴𝐴̅ ∙ 𝐵𝐵 ∙ 𝐶𝐶̅
0 1 1 0 0 0 1 0 0 0 0 𝑚𝑚3 = 𝐴𝐴̅ ∙ 𝐵𝐵 ∙ 𝐶𝐶
1 0 0 0 0 0 0 1 0 0 0 𝑚𝑚4 = 𝐴𝐴 ∙ 𝐵𝐵� ∙ 𝐶𝐶̅
1 0 1 0 0 0 0 0 1 0 0 𝑚𝑚5 = 𝐴𝐴 ∙ 𝐵𝐵� ∙ 𝐶𝐶
1 1 0 0 0 0 0 0 0 1 0 𝑚𝑚6 = 𝐴𝐴 ∙ 𝐵𝐵 ∙ 𝐶𝐶̅
1 1 1 0 0 0 0 0 0 0 1 𝑚𝑚7 = 𝐴𝐴 ∙ 𝐵𝐵 ∙ 𝐶𝐶

24
Electronic Systems. Topic 6
CANONICAL FORMS: SOP expression

• Function expressed as Sum of products (SOP)


Boolean algebra and simplification

Boolean formula consisting of the logical addition of all the


minterms linked to the “1”s in the truth table of the function.

A B C F m0 m2 m5 m7
0 0 0 1 1 0 0 0 𝑚𝑚0 = 𝐴𝐴̅ ∙ 𝐵𝐵� ∙ 𝐶𝐶̅ A B C
0 0 1 0 0 0 0 0
0 1 0 1 0 1 0 0 𝑚𝑚2 = 𝐴𝐴̅ ∙ 𝐵𝐵 ∙ 𝐶𝐶̅
0 1 1 0 0 0 0 0
1 0 0 0 0 0 0 0
1 0 1 1 0 0 1 0 𝑚𝑚5 = 𝐴𝐴 ∙ 𝐵𝐵� ∙ 𝐶𝐶 F

1 1 0 0 0 0 0 0
1 1 1 1 0 0 0 1 𝑚𝑚7 = 𝐴𝐴 ∙ 𝐵𝐵 ∙ 𝐶𝐶
𝐹𝐹 = 𝑚𝑚0 + 𝑚𝑚2 + 𝑚𝑚5 + 𝑚𝑚7 = � 0,2,5,7 =
𝑚𝑚
𝐹𝐹 = 𝐴𝐴̅ ∙ 𝐵𝐵� ∙ 𝐶𝐶̅ +𝐴𝐴̅ ∙ 𝐵𝐵 ∙ 𝐶𝐶̅ +𝐴𝐴 ∙ 𝐵𝐵� ∙ 𝐶𝐶+𝐴𝐴 ∙ 𝐵𝐵 ∙ 𝐶𝐶 25
Electronic Systems. Topic 6
CANONICAL FORMS: Maxterms

• Maxterm: Given an n-variable logic function, any logical


Boolean algebra and simplification

addition including all the variables (complemented or


not) once.
• Each maxterm is equal to “0” for only one specific input
combination
A B C M0 M1 M2 M3 M4 M5 M6 M7
0 0 0 0 1 1 1 1 1 1 1 𝑀𝑀0 = 𝐴𝐴 + 𝐵𝐵 + 𝐶𝐶
0 0 1 1 0 1 1 1 1 1 1 𝑀𝑀1 = 𝐴𝐴 + 𝐵𝐵 + 𝐶𝐶̅
0 1 0 1 1 0 1 1 1 1 1 𝑀𝑀2 = 𝐴𝐴 + 𝐵𝐵� + 𝐶𝐶
0 1 1 1 1 1 0 1 1 1 1 𝑀𝑀3 = 𝐴𝐴 + 𝐵𝐵� + 𝐶𝐶̅
1 0 0 1 1 1 1 0 1 1 1 𝑀𝑀4 = 𝐴𝐴̅ + 𝐵𝐵 + 𝐶𝐶
1 0 1 1 1 1 1 1 0 1 1 𝑀𝑀5 = 𝐴𝐴̅ + 𝐵𝐵 + 𝐶𝐶̅
1 1 0 1 1 1 1 1 1 0 1 𝑀𝑀6 = 𝐴𝐴̅ + 𝐵𝐵� + 𝐶𝐶
1 1 1 1 1 1 1 1 1 1 0 𝑀𝑀7 = 𝐴𝐴̅ + 𝐵𝐵� + 𝐶𝐶̅

26
Electronic Systems. Topic 6
CANONICAL FORMS: Product of sums

• Function expressed as Product of sums (POS)


Boolean algebra and simplification

Boolean formula consisting of the logical product of all the


Maxterms linked to the “0”s in the truth table of the
function.
A B C F M1 M 3 M 4 M 6
0 0 0 1 1 1 1 1
0 0 1 0 0 1 1 1 𝑀𝑀1 = 𝐴𝐴 + 𝐵𝐵 + 𝐶𝐶̅ A B C

0 1 0 1 1 1 1 1
0 1 1 0 1 0 1 1 𝑀𝑀3 = 𝐴𝐴 + 𝐵𝐵� + 𝐶𝐶̅
1 0 0 0 1 1 0 1 𝑀𝑀4 = 𝐴𝐴̅ + 𝐵𝐵 + 𝐶𝐶 F
1 0 1 1 1 1 1 1
1 1 0 0 1 1 1 0 𝑀𝑀6 = 𝐴𝐴̅ + 𝐵𝐵� + 𝐶𝐶
1 1 1 1 1 1 1 1
𝐹𝐹 = 𝑀𝑀1 ∙ 𝑀𝑀3 ∙ 𝑀𝑀4 ∙ 𝑀𝑀6 = � 1,3,4,6 =
𝑚𝑚
𝐹𝐹 = 𝐴𝐴 + 𝐵𝐵 + 𝐶𝐶̅ 𝐴𝐴 + 𝐵𝐵� + 𝐶𝐶̅ 𝐴𝐴̅ + 𝐵𝐵 + 𝐶𝐶 𝐴𝐴̅ + 𝐵𝐵� + 𝐶𝐶 27
Electronic Systems. Topic 6
SIMPLIFICATION

• Canonical forms usually include lots of terms.


Boolean algebra and simplification

• Simplification: finding the simplest equivalent


expression or the expression that can be
implemented with the least number of gates

• Simplification methods:
• Applying algebra laws.
e.g., 𝑎𝑎 · 𝑏𝑏 + 𝑎𝑎 · 𝑏𝑏� = 𝑎𝑎 · 𝑏𝑏 + 𝑏𝑏� = 𝑎𝑎 · 1 = 𝑎𝑎.
 Karnaugh maps: graphical method useful for functions
of up to 4 input variables.
 Computational methods: Mc Cluskey, Espresso, etc.

28
Electronic Systems. Topic 6
KARNAUGH MAPS

• Graphical method to simplify logic functions of up to 4


Boolean algebra and simplification

variables.
• The truth table is somehow mapped into a cell array
where each cell contains the value of the function for a
particular variable combination.
• Adjacent cells differ only in the value of one variable.
• Every cell of the first row is considered adjacent to the
cell located on the same column of the last row.
Likewise, every cell of the last first column is considered
adjacent to the cell located on the same row of the last
column. (Think of it as a folded map)

29
Electronic Systems. Topic 6
KARNAUGH MAPS: THREE VARIABLES

• Three-variable Karnaugh map.


Boolean algebra and simplification

30
Electronic Systems. Topic 6
KARNAUGH MAPS: FOUR VARIABLES

• Karnaugh map for a four-variable function.


Boolean algebra and simplification

31
Electronic Systems. Topic 6
KARNAUGH MAPS: FOUR VARIABLES

• Adjacent cells in a four-variable Karnaugh map.


Boolean algebra and simplification

32
Electronic Systems. Topic 6
KARNAUGH MAPS

Reinforcement recordings (in Catalan).


Boolean algebra and simplification

How to use Karnaugh maps of up to 4 variables.

• Mapes de Karnaugh I (Funcions de 2 variables)


http://media.terrassa.upc.edu/110311-MontseCorbalan-1.html

• Mapes de Karnaugh II (Funcions de 3 i 4 variables)


http://media.terrassa.upc.edu/110721-MontseCorbalan-2.html

• Mapes de Karnaugh III (Simplificacions de 3 o més variables)


http://media.terrassa.upc.edu/110721-MontseCorbalan-3.html

33
Electronic Systems. Topic 6
KARNAUGH MAPS: GUIDELINES

• Logic function simplification (Karnaugh maps)


1. Choose the minimization criteria:
Boolean algebra and simplification

 Use 1’s in order to get a simplified Sum-of-Product (SoP) form.


 Use 0’s in order to get a simplified Product-of-Sum (PoS) form.
2. Form groups of 2n (i.e. 1, 2, 4, 8 …) adjacent cells containing
the chosen value (‘0’ or ‘1’).
3. Determine the smallest number of groups to ensure that all
required cells are included.
4. A) When operating with 1’s:
 Each group of cells generates a product term that includes the
variables that have the same value for all the cells.
 The final expression is the sum of such product terms.
4. B) When operating with 0’s:
 Each group of cells generates a sum term that includes the
variables that have the same value for all the cells.
 The final expression is the product of such sum terms.. 34
Electronic Systems. Topic 6
KARNAUGH MAPS: THREE VARIABLE EXAMPLE

• Let’s apply the rules:


Boolean algebra and simplification

 Those minterms which only differ in the state of one


variable (adjacent minterms) qualify for its simplification.

35
Electronic Systems. Topic 6
KARNAUGH MAPS: GROUPING EXAMPLES

• Grouping examples:
Boolean algebra and simplification

36
Electronic Systems. Topic 6
KARNAUGH MAPS: SoP FORM

• Example 1: Simplify the following logic function in a Sum of


Boolean algebra and simplification

Product (SoP) form:

37
Electronic Systems. Topic 6
KARNAUGH MAPS:PoS FORM

• Example 2: Simplify the following logic expression in a


Boolean algebra and simplification

Product of Sum (PoS) form:

Only for illustration purpose.


Not to be in the exam.

38
Electronic Systems. Topic 6
KARNAUGH MAPS

• Example 3: Find out a Sum-of-Product (SoP) simplified


Boolean algebra and simplification

diagram from the one in the figure below.

39
Electronic Systems. Topic 6
KARNAUGH MAPS: DON’T CARES

• Example 4: Don’t care combinations. Fill out the truth table of


Boolean algebra and simplification

a logic function whose output is 1when the BCD input code


corresponds to numbers 7, 8 or 9.

40
Electronic Systems. Topic 6
BIBLIOGRAPHY

 DIGITAL FUNDAMENTALS, 11TH edition, Thomas L. Floyd. Editorial


Boolean algebra and simplification

Pearson. Chapters: 4 and 5.


Fundamentos de sistemas digitales, 9ª edición, Thomas L. Floyd.
Editorial Pearson. Capítulos: 4 y 5.

41
Electronic Systems. Topic 6

You might also like