9 - 10 Logic Circuits
9 - 10 Logic Circuits
Lectures 9 and 10
Logic Gates and Digital Circuits
Prof. Mostafa I. Marei
1
Logic Gates
• Logic Gates are the building blocks of digital systems
• Logic Gates (AND, OR, NOT, NAND, NOR, XOR, ….) built from transistors
Text book:
M. Morris Mano and Michael D. Ciletti, “Digital Design”,
Pearson, 5th Ed., 2013. Chapter 2.
3
Binary numbers
• Digital signals consist of pulses or digits with discrete levels or values.
• Binary System manipulates discrete data represented in binary form.
• Described by a signal of two amplitude levels called 1 or 0, HIGH or LOW, TRUE
or FALSE, On or OFF.
4
Binary Logic & Basic Logic gates
• A logic gate is a simple electronic circuit that operates on one, two, or more
inputs to produce an output.
• Truth table shows the input-output relationship for all possible inputs.
AND OR
A, B, Z are bits
5
Binary Logic & Basic Logic gates
Inclusive
Exclusive 6
Binary Logic & Basic Logic gates
• The output from XOR gate is 1 when the inputs are not equivalent.
• XOR is also known as “non-Equivalent” gate.
• Any binary logic operation can be achieved using either NAND or NOR gates.
Example 1:
Using NAND gates only construct NOT, AND, OR gates.
NOT:
AND:
7
Binary Logic & Basic Logic gates
OR :
8
Binary Logic & Basic Logic gates
Example 2:
Using NOR gates only construct NOT, AND, OR gates.
NOT:
OR:
9
Binary Logic & Basic Logic gates
AND:
10
Digital Gates ICs
11
Boolean Algebra
• Boolean Algebra enables us to simplify logic expressions found in truth tables.
A.A=A
A+A=A
A+A=1
A.A=0
• Inverse law:
A=A
• Commutative Law:
A+ B = B + A
A.B=B.A
• Associative law:
A + (B + C) = (A + B) + C
A . (B . C) = (A . B) . C
• Distributive Law:
A . (B + C) = (A . B) + (A . C)
A + (B . C) = (A + B) . (A + C)
12
Boolean Algebra
• Identity law:
0.A=0
1.A=A
0+A=A
1+A=1
• Absorption law:
A + (A . B) = (A . 1) + (A . B) = A . (1 + B) = A . 1 = A
A . (A + B) = (A + 0) . (A + B) = A + (0 . B) = A + 0 = A
• De Morgans Law:
A +B=A. B
A .B = A + B
The proof is by using the truth table as done in the last example.
Notes:
14
Boolean Algebra
Example 3: Verify the absorption law using Truth table
A + (A . B) = A
A B A.B A + (A . B)
0 0 0 0
0 1 0 0
1 0 0 1
1 1 1 1
Example 4: Simplify y = A + B + A + B
15
Boolean Algebra
Example 5:
Simplify,
Simplify,
Very important !!
Simplify :
16
Boolean Algebra
Example 6:
17
Boolean Algebra
Example 7: Simplify 𝐴 = 𝑋 𝑌 𝑍 + 𝑋 𝑌 𝑍 + 𝑋 𝑌 𝑍 + 𝑋 𝑌𝑍
18
Boolean Algebra
Example 8: Simplify 𝑦 = 𝐴 . 𝐵 + 𝐴 . 𝐵 + 𝐴 . 𝐵
19
Boolean Algebra
Example 9: Using truth table, verify that 𝐴 𝐵 𝐶 + 𝐴 𝐵 𝐶 + 𝐴 𝐵 𝐶 + 𝐴 𝐵 𝐶 = 𝐵
20
Implementing functions
Example 10: Implement the logic circuits that do the following functions:
F1 = X + Y Z F2 = 𝑋 𝑌𝑍 + 𝑋 𝑌 𝑍 + 𝑋 𝑌
Solution:
F2 = 𝑋 𝑌𝑍 + 𝑋 𝑌 𝑍 + 𝑋 𝑌 = 𝑋 𝑍 𝑌 + 𝑌 + 𝑋 𝑌 = 𝑋 𝑍 + 𝑋 𝑌
21
Implementing functions: Canonical Forms
Minterms (Standard Product)
Binary variables combined with AND operation
All possible products of any n binary variables are called minterms or
standard product.
For 2 binary variables X and Y, Minterms are: 𝑋 𝑌, 𝑋 𝑌, 𝑋 𝑌, X Y
22
Implementing functions: Canonical Forms
Minterm and Maxterms for three Binary variables:
X Y Z Minterms Maxterms
Term symbol Term Symbol
0 0 0 𝑋 𝑌𝑍 m0 𝑋+𝑌+𝑍 M0
0 0 1 𝑋 𝑌𝑍 m1 𝑋+𝑌+𝑍 M1
0 1 0 𝑋 𝑌𝑍 m2 𝑋+𝑌+𝑍 M2
0 1 1 𝑋 𝑌𝑍 m3 𝑋+𝑌+𝑍 M3
1 0 0 𝑋 𝑌𝑍 m4 𝑋+𝑌+𝑍 M4
1 0 1 𝑋 𝑌𝑍 m5 𝑋+𝑌+𝑍 M5
1 1 0 𝑋 𝑌𝑍 m6 𝑋+𝑌+𝑍 M6
1 1 1 XYZ m7 𝑋+𝑌+𝑍 M7
24
Implementing functions: Canonical Forms
Solution: Construct the Minterm corresponding to terms where F= 1 and
Maxterms for F=0.
x y z F Minterms Maxterms
0 0 0 0 𝑋+𝑌+𝑍
0 0 1 1 𝑋 𝑌𝑍
0 1 0 0 𝑋+𝑌+𝑍
0 1 1 0 𝑋+𝑌+𝑍
1 0 0 1 𝑋 𝑌𝑍
1 0 1 0 𝑋+𝑌+𝑍
1 1 0 0 𝑋+𝑌+𝑍
1 1 1 1 XYZ
27
Implementing functions: Canonical Forms
Example 12: Design a logic circuit that satisfy the
operation of the given truth table.
Solution:
Step 1:
Step 2:
product terms.
28
Implementing functions: Canonical Forms
Step 3: Simplify the obtained expression,
29
Implementing functions: Canonical Forms
Example 13: Design a logic circuit that satisfy the
operation of the given truth table.
Solution:
Step 1: Construct the product terms
Note: we used only one gate for implementing this function. Without
simplifications (Step 3), we need many gates to implement the same function
which increase the cost and power consumption.
31