0% found this document useful (0 votes)
2 views43 pages

Intro To Electronics 1 - Lecture1 - Digital - Logics

The document outlines the first lecture of an electronics course focusing on digital logic, Boolean algebra, and Karnaugh Maps. It details the importance of understanding logic gates, their operations, and the application of Boolean algebra laws for simplifying expressions. The teaching strategy includes lectures, tutorials, and consultations, with an emphasis on critical thinking and problem-solving skills in assessments.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views43 pages

Intro To Electronics 1 - Lecture1 - Digital - Logics

The document outlines the first lecture of an electronics course focusing on digital logic, Boolean algebra, and Karnaugh Maps. It details the importance of understanding logic gates, their operations, and the application of Boolean algebra laws for simplifying expressions. The teaching strategy includes lectures, tutorials, and consultations, with an emphasis on critical thinking and problem-solving skills in assessments.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 43

Introduction to Electronics and Electrical

Power & Machines


ENG 60904

Lecture 1 (Week 1)
Digital logic, Boolean algebra, K-Map
April 2024

Prof Ir Datin Dr Wahidah Mansor


School of Computer Science and Engineering (SCE)
Faculty of Innovation and Technology
Topic 1:Digital Logic
LO1: Recognise digital logic, Boolean algebra, and digital
numbering used in digital computer systems.

WHY: Why this topic is important


◦ To give knowledge about logic gates like AND, OR, XOR, and etc., how they works,
their input/output, their circuit, and how they can do logical calculations.

HOW: Teaching and learning strategies


◦ The topic will be delivered through lectures and tutorials. During lecture sessions, the
topic will thoroughly be discussed. Multiple exercises will be solved in the tutorial to
guide the students the solving steps and different solving approaches. Additional
consultation session will be provided upon request.

WHAT: What is the expected result/impact?


◦ Students are expected to demonstrate critical thinking and problem-solving abilities
through solving tutorial questions, quizzes and active class participation. Students are
expected to pass the examinations (Test and Final exam).
Outline

1. Basic Logic Gates


NOT, AND, OR, etc..
2. Boolean Algebra
Laws and Theorems
Sum of Product (SOP) / Product of Sum (POS)
3. Simplifying Boolean Expression
Boolean laws
Karnaugh Map
Binary Logic
 Two voltage levels can be represented as the two digits 0 and 1
 Signals in digital electronics have two distinct voltage levels with built-in
tolerances for variations in the voltage
 A valid digital signal should be within either of the the two shaded areas

5
4 Logic 1
3
2
1 Logic 0
0
Logic Gate Operation
Inverter?
AND?
OR?
XOR ?
NAND?
NOR?
LOGIC GATES
INVERTER
• It performs NOT operation (complement)
• When the input is LOW, the output is HIGH; when the input is HIGH, the
output is LOW.
Logic Diagram Symbol
Boolean Expression
A X
X=A

Truth Table
Timing Diagram:
A X
0 1 A
1 0 X
LOGIC GATES
AND Gate
• It produces a HIGH output when all inputs are HIGH; otherwise, the output is LOW

Boolean Expression Logic Diagram Symbol


X=AꞏB A X
OR X = AB B

Truth Table Timing Diagram:


A B X
A
0 0 0
0 1 0 B
1 0 0
X
1 1 1
LOGIC GATES
OR Gate
• It produces a HIGH output if any input is HIGH; otherwise, the output is LOW

Boolean Expression Logic Diagram Symbol


X=A+B A X
B

Truth Table Timing Diagram:


A B X
A
0 0 0
0 1 1 B
1 0 1
X
1 1 1
LOGIC GATES
NAND Gate
• It produces a LOW output when all inputs are HIGH; otherwise, the output is HIGH

Boolean Expression Logic Diagram Symbol


X=Aꞏ B A X A X
¿ X = AB B B

Truth Table
Timing Diagram:
A B X
A
0 0 1
0 1 1 B
1 0 1
X
1 1 0
LOGIC GATES
NOR Gate
• It produces a LOW output if any input is HIGH; if all inputs are LOW, the output is
HIGH
Logic Diagram Symbol
Boolean Expression
A X A X
X = A +B
B B

Truth Table
Timing Diagram:
A B X
0 0 1 A
0 1 0
B
1 0 0
1 1 0 X
LOGIC GATES
XOR Gate
• It produces a HIGH output only when both inputs are at opposite logic levels

Boolean Expression Logic Diagram Symbol


𝑋= 𝐴 ⊕ 𝐵 A X
B+A B

Truth Table Timing Diagram:


A B X
A
0 0 0
0 1 1 B
1 0 1
1 1 0 X
LOGIC GATES
XNOR Gate
• It produces a HIGH output only when both inputs are at the same logic level

Logic Diagram Symbol


Boolean Expression
A X
X=A ⨁ B
X=A ⨀ B B

Truth Table
Timing Diagram:
A B X
0 0 1 A
0 1 0 B
1 0 0
1 1 1 X
LOGIC GATES
Dual Symbols
 The NAND gates can be drawn by either a NAND symbol
or the equivalent negative-OR symbol

AB +

 The NOR gate can be drawn by either a NOR symbol or the


equivalent negative-AND symbol
=

A+ B
BOOLEAN ALGEBRA

Boolean Addition
• In Boolean algebra, a variable is a symbol used to represent
an action, a condition, or data.
• A single variable can only have a value of 1 or 0.
• The complement represents the inverse of a variable. For
example, the complement of A is .
• Addition is equivalent to the OR operation.
• The sum term is 1 if one or more of the literals (a
variable or its complement) are 1.
• The sum term is zero only if each literal is 0.
BOOLEAN ALGEBRA
Boolean Addition
Example 1
Determine the values of A, B, and C that make the
sum term of the expression A + + = 0?

Solution
Each literal must = 0; therefore A = 1, B = 0 and
C = 1.
BOOLEAN ALGEBRA
Boolean Multiplication
• Multiplication is equivalent to the AND operation.
• The product of literals forms a product term.
• The product term will be 1 only if all literals are 1.

Example 2
Given that A. Determine the values of the A, B and C.

Solution
Each literal must = 1; therefore A = 1, B = 0 and C = 0.
BOOLEAN ALGEBRA

Commutative Laws

• For addition and multiplication, the commutative law states


that the order in which variables are ORed or ANDed
makes no difference in the results.

A+B= B+A

AB = BA
BOOLEAN ALGEBRA

Associative Laws
For addition and multiplication, the associative law states when
ORing or ANDing more than two variables, the result is the
same regardless of the grouping of the variables.

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

A(BC) = (AB)C
BOOLEAN ALGEBRA
Distributive Law
A common variable can be factored from an expression.

AB + AC = A(B+ C)

The equivalent circuits


A AB B B+C
B X
X C
A
A
C AC

AB + AC A(B+ C)
BOOLEAN ALGEBRA
Rules of Boolean Algebra
1. A+0 =A 8. A . = 0
2. A+1 = 1 ´ =𝐀
𝟗.𝐀
3. A. 0=0
10. A + B = A + B
4. A. 1=A
11. + AB = + B
5. A + A = A
6. A + = 1 12. A + AB = A
7. A . A = A 13. (A + B)(A + C) = A + BC
BOOLEAN ALGEBRA
DeMorgan’s Theorem
First Theorem
• The complement of a product of variables is equal
to the sum of the complemented variables.
𝑨𝑩= 𝑨+ 𝑩

Applying DeMorgan’s 1st theorem to gates:


Inputs Output
A
𝑨𝑩 A 𝑨+𝑩 A B AB A + B
B = B
0 0 1 1
0 1 1 1
1 0 1 1
1 1 0 0
NAND Negative-OR
BOOLEAN ALGEBRA
DeMorgan’s Theorem
Second Theorem
The complement of a sum of variables is equal to the
product of the complemented variables.

𝑨+ 𝑩= 𝑨 ⋅ 𝑩
Applying DeMorgan’s second theorem to gates:
Inputs Output
A
A 𝑨+𝑩 𝑨𝑩 A B A + B AB
B = B 0 0 1 1
0 1 0 0
1 0 0 0
NOR Negative-AND 1 1 0 0
BOOLEAN ALGEBRA
DeMorgan’s Theorem
Example 3
Apply DeMorgan’s theorem to remove the overbar covering
both terms from the expression

Solution
To apply DeMorgan’s theorem to the expression, break the overbar covering
both terms and change the sign between the terms.

Deleting the double bar gives


BOOLEAN ALGEBRA
Boolean Analysis of Logic Circuits
Combinational logic circuits can be analyzed by writing
the expression for each gate and combining the
expressions according to the rules for Boolean algebra.

Example 4
Apply Boolean algebra to derive the expression for X.

A
B
X
C
D
BOOLEAN ALGEBRA
Boolean Analysis of Logic Circuits

Solution to Example
4
Setp 1 - Write the expression for each gate:

A 𝑨+ 𝑩
C ()
B
C X = C ()+ D
D

Step 2 - Applying DeMorgan’s theorem and the distribution law:

X = C ()+ D
= C(
BOOLEAN ALGEBRA
Sum of Product and Product of Sum
Boolean expressions can be written in the sum-of-products form
(SOP) or in the product-of-sums form (POS) to simplify the
implementation of combinational logic, particularly with PLDs. In
both forms, an overbar cannot extend over more than one variable.
Examples of an expression in SOP form when two or more product
terms are summed:

Examples of an expression in POS form when two or more sum terms


are multiplied:
BOOLEAN ALGEBRA
Sum of Product form
In SOP standard form, every variable in the domain must
appear in each term. This form is useful for constructing truth
tables or for implementing logic in PLDs.
A nonstandard term can be expanded to standard form by multiplying
the term by a term consisting of the sum of the missing variable and its
complement.

Example 5 Convert X = + ABC to standard form.

Solution The first term does not include the variable C.


Therefore, multiply it by the (C + ), which = 1.

X = + ABC
= + + ABC
BOOLEAN ALGEBRA
Product of Sum form
In POS standard form, every variable in the domain must
appear in each sum term of the expression.
A nonstandard POS expression can be expanded to standard form by
adding the product of the missing variable and its complement and
applying rule 13, which states that A + BC = (A + B)(A + C) .

Example 5 Convert X =((A + B + C) to standard form.

Solution The first sum term does not include the variable C.
Therefore, add C and expand the result by rule 13.

X = ( + C)(A + B + C)
= ( + C )( + )(A + B + C)
SIMPLIFYING BOOLEAN EXPRESSION

Two ways to simplify Boolean Expression:


• Using laws of Boolean Algebra
• Or using Karnaugh Map (K-Map)
– K-Map provides a systematic method for simplifying
Boolean expressions
– Will produce the simplest SOP or POS expression possible
which is known as the minimum expression.
SIMPLIFYING BOOLEAN EXPRESSION

Karnaugh maps
• The Karnaugh map (K-map) is a tool for simplifying
combinational logic with 3 or 4 variables.
• For 3 variables, 8 cells are required (23).

The map shown is for three variables


ABC ABC
labeled A, B, and C.
• Each cell represents one possible product ABC ABC
term.
• Each cell differs from an adjacent cell by ABC ABC

only one variable.


ABC ABC
SIMPLIFYING BOOLEAN EXPRESSION

Karnaugh maps
Cells are usually labeled using 0’s and 1’s to represent the
variable and its complement.

C
AB 0 1 The numbers are entered in gray
00 code, to force adjacent cells to be
different by only one variable.
01
Gray
code 11 Ones are read as the true variable and
zeros are read as the complemented
10 variable.
SIMPLIFYING BOOLEAN EXPRESSION

Karnaugh maps
Alternatively, cells can be labeled with the variable
letters. This makes it simple to read, but it takes more
time preparing the map.
CC CC
Example 6 Read the terms for AB
AB ABC ABC
the yellow cells.
AB
AB ABC
ABC ABC

AB
AB ABC ABC
Solution
AB
The cells are and A AB ABC ABC
ABC
SIMPLIFYING BOOLEAN EXPRESSION

Karnaugh maps
K-maps can simplify combinational logic by grouping
cells and eliminating variables that change.
Example 7 Group the 1’s on the map and read the minimum logic.

CC 00 11 Solution
AAB
B
11 1. Group the 1’s into two overlapping
00
00
B changes groups as indicated.
across this 01
01 11 11 2. Read each group by eliminating any
boundary variable that changes across a
11
boundary.
10
10 C changes 3. The vertical group is read .
across this
boundary 4. The horizontal group is read B.

X = +B
SIMPLIFYING BOOLEAN EXPRESSION

Karnaugh maps
A 4-variable map has an adjacent cell on each of its four
boundaries as shown.
Each cell is different only by
CD CD CD CD
one variable from an adjacent
AB
cell.
AB Grouping follows the rules
AB
given in the text.
The following slide shows an
AB
example of reading a four
variable map using binary
numbers for the variables…
SIMPLIFYING BOOLEAN EXPRESSION

Karnaugh maps
Group the 1’s on the map and read the minimum logic.
C changes across
outer boundary
CD
AB
00 01 11 10 1. Group the 1’s into two separate
00 1 1 groups as indicated.
B changes 2. Read each group by eliminating
01 1 1 any variable that changes across a
11 1 1
boundary.
B changes 3. The upper (yellow) group is read as
10 1 1 AD.
C changes
4. The lower (green) group is read
as AD.
X
X = AD +AD
SIMPLIFYING BOOLEAN EXPRESSION
Karnaugh maps highlights
Rules of Grouping
• The objective is to maximize the size of the ‘1’s in groups and to
minimize the number of groups.
• A group must contain either 1, 2, 4, 8 or 16 squares.
– In the case of two-variable Karnaugh map, 4 squares is the
maximum group.
– For three-variable map, 8 squares are the maximum group.

Determining the minimum SOP Expression from the K- Map


• From the grouped ‘1’s, derive the minimum product terms from
the K-Map, then sum all the terms to form the minimum SOP
expression.
K-Map Grouping Example A group of 2 ‘1’s

𝐴𝐵
𝐴𝐶
𝐴𝐶
K-Map Grouping Example A group of 4 ‘1’s

𝑥= 𝐴 𝐶+ 𝐴𝐶
Not fully simplified Fully simplified

𝑩𝑫

𝑥= 𝐴 𝐵+ 𝐴𝐷 𝑥=𝐵 𝐷 𝑥=𝐵𝐷+ 𝐵 𝐷
K-Map Grouping Example

A group of 8 ‘1’s

𝐴 𝐷
Let’s Try an Example

𝐴𝐵𝐶
𝐴𝐵𝐶
𝐴𝐵𝐶
𝐴𝐵𝐶

𝐴𝐵 𝐶
Thank you for
your attention…
Universal Gates
NAND gates are sometimes called universal gates because
they can be used to produce the other basic Boolean
functions.

A A A AB
B
Inverter AND gate

A A
A+B A+B
B B

OR gate NOR gate


Universal Gates

NOR gates are also universal gates and can form all of
the basic gates.

A A A A+ B
B
Inverter OR gate

A A
AB AB
B B

AND gate NAND gate

You might also like