Lecture-4 –Logicsajid.buet.ac.bd/courses/EEE_303_2020/Lecture_4-6.pdf · EEE 303 -Digital...
Transcript of Lecture-4 –Logicsajid.buet.ac.bd/courses/EEE_303_2020/Lecture_4-6.pdf · EEE 303 -Digital...
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
1
Lecture-4 –Logic
Dr. Sajid Muhaimin ChoudhuryDept of EEE, BUET
EEE 303 – Digital Electronics
1
• If a given switch is controlled by an input variable x, then we will say that the switch is open if x = 0 and closed if x = 1. Such switches are implemented with transistors.
2
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
2
Variable and States• The output is defined as
the state (or condition) of the light L. If the light is on, we will say that L = 1. If the light is off, we will say that L = 0.
• Since L = 1 if x = 1 and L = 0 if x = 0, we can say that L(x) = x.We say that L(x) = x is a logic function and that x is an input variable.
3
Logical AND Operation
Symbol
Operation: A.B
4
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
3
AND operation
5
Application of AND logic
6
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
4
Logical OR Operation
Symbol
Operation: A+B
7
OR operation
8
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
5
Application of OR logic
9
Logical NOT Operation
Symbol
Operation: !A
10
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
6
Application of NOT logic
11
NAND Operation
NOR Operation
12
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
7
13
Example of NAND
14
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
8
Example of NOR
15
XORExclusive OR
XNOR
16
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
9
Application of XOR gate
17
Logic IC
18
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
10
AND ICs
19
NAND ICs
20
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
11
OR, NOR ICs
21
22
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
12
23
Programmable Logic Classification
24
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
13
SPLD (Simple Programmable Logic Device)
25
CPLD (Complex Programmable Logic Device)
26
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
14
FPGA (Field Programmable Gate Array)
27
Programming Gate Array
28
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
15
Fuse vs Antifuse
29
EPROM
30
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
16
SRAM
31
Lecture-5 –Boolean Algebra
Dr. Sajid Muhaimin ChoudhuryDept of EEE, BUET
EEE 303 – Digital Electronics
32
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
17
• Addition
• Multiplication
Boolean Operators
33
• Commutative Laws: A+B = B+AAB = BA
• Associative Laws: (AB)C = A(BC)A+(B+C)=(A+B)+C
• Distributive Law: A(B+C) = AB+AC
34
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
18
35
DeMorgan’s Theorem
36
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
19
Boolean Analysis
37
Boolean Expression of a Logic Circuit
38
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
20
39
40
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
21
Equivalent Circuit
41
Boolean Synthesis
42
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
22
Example
43
Standard forms of Boolean Expressions
• Sum of Products (SOP)• Minterm: a product term where each
variable or its complement appears once• SOP = Sum of Minterms
• Product of Sums (POS)• Maxterm: a sum term where each variable
or its complement appear once• POS = Product of Maxterms
44
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
23
Truth Table: Minterm and Maxterms
45
Example: Synthesize the Following Truth Table with a Logic Circuit
46
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
24
47
Analysis and Synthesis
1. For a given logic network, find a truth table to describes it2. For a given logic network, find a set of logical expressions that
describes its behavior. 3. Transform a logical expression into the equivalent truth table
representation. 4. Transform a truth table into an equivalent logical expression
representation. 5. Transform a logical expression into an equivalent (and possibly
simpler) logical expression. 6. Design a logic network to have the behavior specified by a
given set of logical expressions. 7. Design a logic network to have the behavior specified by a
given truth table.
48
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
25
Lecture-6 – Logic Circuit Simplification
Dr. Sajid Muhaimin ChoudhuryDept of EEE, BUET
EEE 303 – Digital Electronics
49
Logic Circuit Minimization
• Karnaugh Map• Quine-McCluskey Method • Espresso
50
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
26
Karnaugh map • Karnaugh map is an array of cells in which
each cell represents a binary value of the input variables.
• The cells are arranged in a way so that simplification of a given expression is simply a matter of properly grouping the cells.
• Similar to a truth table because it presents all of the possible values of input variables and the resulting output for each value.
51
3 Variable K-map
52
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
27
4 Variable K-map
53
Minimal Sum-Of-Products Expressions
• Ordering of Squares • The important feature of the ordering of squares is
that the squares are numbered so that the binary representations for the numbers of two adjacent squares differ in exactly one position.
• This is due to the use of a Gray code (one in which adjacent numbers differ in only one position) to label the edges of a type 2 map.
• The labels for the type 1 map must be chosen to guarantee this property.
• Note that squares at opposite ends of the same row or column also have this property (i.e., their associated numbers differ in exactly one position)
54
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
28
Merging Adjacent Product Terms
55
• For k-variable maps, this reduction technique can also be applied to groupings of 4,8,16,...,2k rectangles all of whose binary numbers agree in (k-2),(k-3),(k- 4),...,0 positions, respectively.
56
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
29
Basic Karnaugh Map Groupings for Three-Variable Maps.
57
Basic Karnaugh Map Groupings for Four-Variable Maps
58
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
30
59
Rules for Grouping: • The number of squares in a grouping is 2i for some i
such that 1 ≤ i ≤ k. • There are exactly k-i variables that have constant
value for all squares in the grouping. • Resulting Product Terms:
• If X is a variable that has value 0 in all of the squares in the • grouping, then the literal X' is in the product term. • If X is a variable that has value 1 in all of the squares in the
grouping, then the literal X is in the product term. • If X is a variable that has value 0 for some squares in the
grouping and value 1 for others, then neither X' nor X are in the product term.
60
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
31
Invalid Karnaugh Map Groupings
61
• In order to minimize the resulting logical expression, the groupings should be selected as follows:
• Identify those groupings that are maximal in the sense that they are not contained in any other possible grouping. The product terms obtained from such groupings are called prime implicants.
• A distinguished 1-cell is a cell that is covered by only one prime implicant.
• An essential prime implicant is one that covers a distiquished 1-cell.
• Use the fewest possible number of maximal groupings needed to cover all of the squares marked with a 1.
• Examples:
62
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
32
63
64
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
33
65
66
EEE 303 - Digital Electronics - Lecture 4-6 3/5/20
34
67
68