Lecture 2
Lecture 2
Lecture 2
COURSEOUTLINE
1. Introduction
2. Gate-Level Minimization
3. Combinational Logic
4. Synchronous Sequential Logic
5. Registers and Counters
6. Memories and Programmable Logic
BASICLOGICGATES
• We have defined three basic logic gates and operators
•We could build any digital circuit from those basic logic
gates
3
DERIVEDGATES
NAND NOR XOR XNOR
AND-Invert OR-Invert Odd Even
X Y Z X Y Z X Y Z X Y Z
0 0 1 0 0 1 0 0 0 0 0 1
0 1 1 0 1 0 0 1 1 0 1 0
1 0 1 1 0 0 1 0 1 1 0 0
1 1 0 1 1 0 1 1 0 1 1 1
4
PRACTICALEXAMPLESOFAND&ORGATES
A seat belt alarm system An intrusion detection system
5
PRACTICALICSFORLOGICGATES
6
PRACTICALICSFORLOGICGATES
7
MEASUREMENTDEVICES
How to practically monitor the output of a gate?
Oscilloscope
8
MEASUREMENTDEVICES
9
EXPRESSIONSANDLOGICCIRCUITS
•Any Boolean expression can be converted into a circuit by combining
basic gates in a relatively straightforward way
• The diagram below shows the inputs and outputs of each gate
•The precedenciesare explicit in a circuit. Clearly, we have to make
sure that the hardware doesthe operations in the right order!
10
SIMPLIFICATIONOFTHELOGIC
FUNCTION
F(A,B)=A’B’ + A’B + AB’
B B’ F
A A’
11
SIMPLIFICATIONOFTHE
LOGIC FUNCTION
F(A,B)=A’B’ + A’B + AB’
= A’ * (B’ + B) + A * B’ (Distributivity)
B
F = A’ * (B + B’) + A * B’ (Commutativity)
A
= A’ * 1 + A * B’ (x + x’ = 1)
= A’ + (A * B’) (x +x’y)=(x+x’)(x+y)(Distributivity)
B
F = (A’ + B’) (De Morgan’s)
A
= (A B)’ 1 GATE (NAND) ONLY
13
ALGEBRAICFORMSOF
REPRESENTING BOOLEANFUNCTIONS
• Sum of Products (SOP)
• Product of Sums (POS)
14
SUMOFPRODUCTS(SOP)
16
SUMOFPRODUCTS(SOP)
Product term (or minterm)
🢝 ANDed product – input combination for which output is true
🢝 Each variable appears exactly once, in true or inverted form (but not both)
Answer:
SOP AND/OR
Two-level Implementation
18
PRODUCTOFSUMS(POS)
Switching functions formed by taking the:
PRODUCT (ANDing) of SUM (ORed) terms.
Example: Literals
(Sum terms)
F A, B,C, D A B C B D A C D
Products
19
PRODUCTOFSUMS(POS)
Sum termsare known as Maxterms
F= 000 010 100
F = (A + B + C) (A + B' + C) (A' + B + C)
A B C F
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
20
PRODUCT-OF-SUMS (CONT’D)
Sum term (or maxterm)
🢝 ORed sumof literals – input combination for which output is false
🢝 each variable appears exactly once in a sumterm, in true or inverted form (but
not both)
F(A, B, C) = M(0,2,4)
A B C maxterms = M0 • M2 • M4
0 0 0 A+B+C M0 = (A + B + C) (A + B' + C) (A' + B + C)
0 0 1 A+B+C' M1
0 1 0 A+B'+C M2 This form is called the canonical form
0 1 1 A+B'+C' M3
1 0 0 A'+B+C M4
1 0 1 A'+B+C' M5 F(A, B, C) = (A + B + C) (A + B' + C) (A' + B + C)
1 1 0 A'+B'+C M6 = (A + C) (B + C) (remember: F=AB + C)
1 1 1 A'+B'+C' M7
This form is called the minimal form
Answer:
POS OR/AND
Two-level Implementation
22
SOPANDPOSREPRESENTTHESAMEFUNCTION
A B C F
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
F=m(1,3,5,6,7) F=M(0,2,4)
23
POSVERSUSSOP
24
MINIMIZATIONOFLOGICFUNCTIONS
We have chips with millions of gates
🢝Why care about minimizing a function?
🢝What do a few gates matter?
Basic logic functions are replicated thousands of times
🢝Saving one gate for a memory cell pays off
What is the criterion for minimization?
🢝Should we minimize the…
🢝Number of product terms?
🢝Number of logic operations?
🢝Number of variables (literals)?
🢝Number of wires?
🢝… ?
For implementation: minimize the number of gates!
25
HOWTOMINIMIZETHEGATECOUNT?
Example: F=A’BC’+AB’C’+AB’C+ABC’= Σm(2,4,5,6)
How many gates do we need for implementation?
🢝If AND gates have 3 inputsand OR gates have 4 inputs?
🢝If all gates are binary (2 inputs)?
x y minterm
0 0 m0
0 1 m1
1 0 m2
1 1 m3
27
2-VARIABLEK-MAP
y x
x 0 1 y 0 1
0 1 0 2
0 m0 m1 OR 0 m0 m2
2 3 1 3
1 m2 m3 1 m1 m3
x y f x y f
0 0 0 0 0 0
0 1 0 0 1 1
1 0 0 1 0 1
1 1 1 1 1 1
29
2-VARIABLEK-MAP
Any two adjacent cells in the map differ by ONLY one variable,
which appears complemented in one cell and uncomplemented in
the other
Example
32
3-VARIABLEMAP:EXAMPLEI
Simplify the Boolean expression: F 𝑥, 𝑦, 𝑧 = Σ(2,3,4,5)
F 𝑥, 𝑦, 𝑧 = 𝑥𝑦 ′ + 𝑥 ′ 𝑦
33
3-VARIABLEMAP:EXAMPLEII
Simplify the Boolean expression: F 𝑥, 𝑦, 𝑧 = Σ(3,4,6,7)
F 𝑥, 𝑦, 𝑧 = 𝑦𝑧 + 𝑥𝑧′
34
3-VARIABLEMAP:EXAMPLEIII
Simplify the Boolean expression: F 𝑥, 𝑦, 𝑧 = Σ(0,2,4,5,6)
F 𝑥, 𝑦, 𝑧 = 𝑧 ′ + 𝑥𝑦′
35
3-VARIABLEMAP:EXAMPLEIV
Let the Boolean function 𝐹(𝐴, 𝐵, 𝐶) = 𝐴′ 𝐶 + 𝐴′ 𝐵 + 𝐴𝐵′ 𝐶 + 𝐵𝐶
(a) Express this function as a sumof minterms
(b) Find the minimal SOP expression
𝐹 𝐴, 𝐵, 𝐶 = 𝛴(1,2,3,5,7) 𝐹 𝐴, 𝐵, 𝐶 = 𝐶 + 𝐴 ′ 𝐵
36
NOTESONA3-VARIABLEMAP
•The number of adjacent cells that may be combined must always
represent a number that is a power of two, such as 1, 2, 4 and 8
•As more adjacent cells are combined, we obtain a product term
with fewer literals
• One cell represents one minterm, giving a term with 3 literals
• Two adjacent cell represent a term with 2 literals
• Four adjacent cells represent a term with 1 literal
•Eight adjacent cells encompass the entire map and produce a
function that is always equal to logic 1
37