Download presentation
1
Gate-Level Minimization
Chapter 3 Gate-Level Minimization 授課教師: 張傳育 博士 (Chuan-Yu Chang Ph.D.) Tel: (05) ext. 4337 Office: EB212
2
3-1 Introduction Gate-level minimization refers to the design task of finding an optimal gate-level implementation of Boolean functions describing a digital circuit.
3
3-2 The Map Method The complexity of the digital logic gates
the complexity of the algebraic expression Logic minimization algebraic approaches: lack specific rules the Karnaugh map a simple straight forward procedure a pictorial form of a truth table applicable if the # of variables < 7 A diagram made up of squares each square represents one minterm
4
3-2 The Map Method (cont.) Boolean function sum of minterms
sum of products (or product of sum) in the simplest form The simplest algebraic expression is an algebraic expression with a minimum number of terms a minimum number of literals The expression produces a circuit diagram with A minimum number of gates and the minimum number of inputs to each gates The simplified expression may not be unique
5
Two-Variable Map A two-variable map four minterms
x' = row 0; x = row 1 y' = column 0; y = column 1 a truth table in square diagram xy x+y = Fig. 3.2 Representation of functions in the map
6
A three-variable map Eight minterms The Gray-code-like sequence
Any two adjacent squares in the map differ by only one variable primed in one square and unprimed in the other e.g., m5 and m7 can be simplified m5+ m7 = xy'z + xyz = xz (y'+y) = xz
7
A three-variable map (cont.)
Example 3-1 F(x,y,z) = S(2,3,4,5) F = x'y + xy'
8
A three-variable map (cont.)
m0 and m2 (m4 and m6) are adjacent m0+ m2 = x'y'z' + x'yz' = x'z' (y'+y) = x'z' m4+ m6 = xy'z' + xyz' = xz' (y'+y) = xz'
9
A three-variable map (cont.)
Example 3-2 F(x,y,z) = S(3,4,6,7) = yz+ xz'
10
Four adjacent squares 2, 4, 8 and 16 squares
m0+m2+m4+m6 = x'y'z'+x'yz'+xy'z'+xyz' = x'z'(y'+y) +xz'(y'+y) = x'z' + xz‘ = z' m1+m3+m5+m7 = x'y'z+x'yz+xy'z+xyz =x'z(y'+y) + xz(y'+y) =x'z + xz = z
11
Example 3-3 F(x,y,z) = S(0,2,4,5,6) F = z'+ xy'
12
Example 3-4 F = A'C + A'B + AB'C + BC express it in sum of minterms
find the minimal sum of products expression
13
3-3 Four-Variable Map The map 16 minterms
combinations of 2, 4, 8, and 16 adjacent squares
14
Example 3-5 F(w,x,y,z) = S(0,1,2,4,5,6,8,9,12,13,14) F = y'+w'z'+xz'
15
Example 3-6 Simplify the Boolean function
F = ABC + BCD + ABCD + ABC
16
卡諾圖化簡的規則 輸入端有N個變數時,則繪出2N個空格與其對應。 將真值表內輸入所對應的輸出依次填入空格內。 如果為布林代數式時:
當布林代數式為SOP型時,將1填入對應的方格內,其餘的部分則填0。 當布林代數式為POS型時,將0填入對應的方格內,其餘的部分則填1。 若沒有明確的輸出則填入×或(don’t care)。 圈選的相鄰項越大越好,其中,相鄰項的個數須符合2n。 n=0,20=1,當圈一格時無法消去任何變數。 n=1,21=2,當圈二格時可以消去1個變數。 n=2,22=4,當圈四格時可以消去2個變數。 n=3,23=8,當圈八格時可以消去3個變數。 n=4,24=16,當圈十六格時可以消去4個變數。 圈在一起的0或1必須滿足相鄰間僅有一個位元不同。 用最少的圈圈,把所有1的項圈起來。 圈過還可再圈。
17
Prime Implicants 意含項(implicant): 質含項(prime implicant):
任一個乘積項即為該函數的一個意含項(implicant),i.e,在卡諾圖內,由含有“1”之方格所組合的所有矩形均是implicant。 質含項(prime implicant): 某一implicant不再為另一個implicant的子集(subset)此種implicant稱為prime implicant。 必要項(essential prime implicant): 若函數的某個最小項(min term)僅包含在其中一個prime implicant時,則該prime implicant稱為必要項(essential prime implicant)
18
求下列卡諾圖之prime implicant, essential prime implicant。
由卡諾圖中可看出, prime implicants= essential prime implicants= X YZ 1 10 11 01 00
19
求F(A, B, C, D)=(0, 1, 2, 4, 5, 10, 11, 13, 15)之必要項及最簡的SOP。
由卡諾圖中可看出共有7個prime implicant,其中essential prime implicant只有1項 因此,化簡後 1 10 11 01 00 CD AB
20
Consider the simplified expression may not be unique
F = BD+B'D'+CD+AD = BD+B'D'+CD+AB = BD+B'D'+B'C+AD = BD+B'D'+B'C+AB'
21
3-4 Five-Variable Map Map for more than four variables becomes complicated five-variable map: two four-variable map (one on the top of the other)
22
Table 3.1 shows the relationship between the number of adjacent squares and the number of literals in the term.
23
Example 3-7 F = S(0,2,4,6,9,13,21,23,25,29,31) F = A'B'E'+BD'E+ACE
24
Another Map for Example 3-7
F = S(0,2,4,6,9,13,21,23,25,29,31) ABC DE 000 001 011 010 110 111 101 100 00 1 01 11 10
25
Another Map for Example 3-7
26
3-5 Product of Sums Simplification
Approach #1 Simplified F' in the form of sum of products Apply DeMorgan's theorem F = (F')' F': sum of products => F: product of sums Approach #2: duality 將基本定理之OR與AND運算互換 , 把0變成1 , 1變成0,即可得出對偶式(dual)。 combinations of maxterms (it was minterms) M0M1 = (A+B+C+D)(A+B+C+D') = (A+B+C)+(DD') = A+B+C
27
Example 3-8 F = S(0,1,2,5,8,9,10) F' = AB+CD+BD'
Apply DeMorgan's theorem; F=(A'+B')(C'+D')(B'+D) Or think in terms of maxterms
28
Gate implementation of the function of Example 3-8
29
Consider the function defined in Table 3.2.
In sum-of-minterm: In sum-of-maxterm: Taking the complement of F
30
Consider the function defined in Table 3.2.
Combine the 1’s: Combine the 0’s :
31
3-6 Don't-Care Conditions
The value of a function is not specified for certain combinations of variables BCD; : don't care The don't care conditions can be utilized in logic minimization can be implemented as 0 or 1 Example 3-9 F (w,x,y,z) = S(1,3,7,11,15) d(w,x,y,z) = S(0,2,5)
32
Also apply to products of sum
F = yz + w'x'; F = yz + w'z F = S(0,1,2,3,7,11,15) ; F = S(1,3,5,7,11,15) either expression is acceptable Also apply to products of sum
33
3-7 NAND and NOR Implementation
NAND gate is a universal gate can implement any digital system
34
NAND and NOR Implementation
Two graphic symbols for a NAND gate 對等邏輯 對等邏輯在邏輯電路的分析化簡上相當好用,它可以用來消去許多的迪莫根運算,
35
Two-level Implementation
The implementation of Boolean function with NAND gates requires that the functions be in sum of products Example: F = AB+CD F = ((AB)' (CD)' )' =AB+CD Fig Three ways to implement F = AB + CD
36
Two-level Implementation (cont.)
Example 3-10
37
Two-level Implementation (cont.)
The procedure Simplify the function and express it in sum of products form. Draw a NAND gate for each product term; the inputs to each NAND gate are the literals of the term Draw a single NAND gate / invert-OR gate for the second sum term. A term with a single literal requires an inverter in the first level. If the single literal is complemented, it can be connected directly to an input of the second-level NAND gate.
38
Multilevel NAND Circuits
AND-OR logic => NAND-NAND logic The general procedure for converting a multilevel AND-OR diagram into an all-NAND diagram Convert all AND gates to NAND gates with AND-inverter graphic symbols. Convert all OR gates to NAND gates with inverter-OR graphic symbols. Check all the bubbles in the diagram. For every bubble that is not compensated by another small circle along the same line, insert an invert or complement the input literal. (1)將邏輯函數化成積之和(SOP)最簡函數。 (2)將此SOP取兩次補數,再以迪莫根定理化簡,使其OR運算全部變成以” ∙”(AND)為連接的運算。
39
Multilevel NAND Circuits
Example: F = A(CD + B) + BC Fig. 3.22 Implementing F = A(CD + B) + BC
40
Multilevel NAND Circuits
Fig Implementing F = (AB +AB)(C+ D)
41
Example Problem 3.16 Simplify the following functions, and implement them with two-level NAND gate circuits: (a) F(A,B,C,D)=A’B’C+AC’+ACD+ACD’+A’B’D’ (b) F(A,B,C)=(A’+B’+C’)(A’+B’)(A’+C’)
42
Multilevel NAND Circuits
Simply the Multilevel NAND Circuits
43
NOR Implementation NOR function is the dual of NAND function
The NOR gate is also universal The function be simplified into product-of-sum form. The simplified POS express is obtained from the map by combing the 0’s and complementing. The transformation from the OR-AND diagram to a NOR diagram Changing the OR gates to NOR gates with OR-invert graphic symbols Changing the AND gate to a NOR gate with an invert-AND graphic symbol. A single literal term going into the second-level gate must be complemented. 方法: (1)將邏輯函數化成和之積(POS)最簡函數。 (2)將此POS取兩次補數,再以迪莫根定理化簡,使其AND運算全部變成以”+”(OR)為連接的運算。
44
NOR Implementation Logic operations with NOR gates
45
Two graphic symbols for a NOR gate
Example: F = (A + B)(C + D)E Fig. 3.26 Implementing F = (A + B)(C + D)E
46
NOR Implementation F=(AB+E)(C+D)
47
NOR Implementation Example: F = (AB +AB)(C + D) Fig. 3.27
Implementing F = (AB +AB)(C + D) with NOR gates
48
Example Problems 3.19 Simply the following functions, and implement them with two-level NOR gate circuit: (a) F=wx’+y’z’+w’yz’ (b) F(x,y,z)=[(x+y)(x’+z)]’
49
3-8 Other Two-level Implementations
Wired logic a wire connection between the outputs of two gates open-collector TTL NAND gates: wired-AND logic the NOR output of ECL gates: wired-OR logic AND-OR-INVERT function OR-AND-INVERT function
50
Nondegenerate Forms Consider four types of gates: AND, OR, NAND, and NOR. 16 possible combinations of two-level forms eight of them: degenerate forms = a single operation The eight nondegenerate forms AND-OR, OR-AND, NAND-NAND, NOR-NOR, NOR-OR, NAND-AND, OR-AND, AND-OR AND-OR and NAND-NAND = sum of products OR-AND and NOR-NOR = product of sums NOR-OR, NAND-AND, OR-AND, AND-OR = ?
51
AND-OR-Invert Implementation
AND-OR-INVERT (AOI) Implementation NAND-AND = AND-NOR = AOI F = (AB+CD+E)' F' = AB+CD+E (sum of products) simplify F' in sum of products
52
Other Two-level Implementations (cont.)
OR-AND-INVERT (OAI) Implementation OR-NAND = NOR-OR = OAI F = ((A+B)(C+D)E)' F' = (A+B)(C+D)E (product of sums) simplified F' in products of sum
53
Tabular Summary and Examples
F' = x'y+xy'+z (F': sum of products) F = (x'y+xy'+z)' (F: AOI implementation) F = x'y'z' + xyz‘ (F: sum of products) F' = (x+y+z)(x'+y'+z) (F': product of sums) F = ((x+y+z)(x'+y'+z))' (F: OAI)
54
Tabular Summary and Examples
56
3-9 Exclusive-OR Function
Exclusive-OR (XOR): XOR is equal to 1 if only x and y differ in value. xÅy = xy'+x'y Exclusive-NOR (XNOR): XNOR is equal to 1 if both x and y are equal. (xÅy)' = xy + x'y' Some identities xÅ0 = x xÅ1 = x' xÅx = 0 xÅx' = 1 xÅy' = (xÅy)' x'Åy = (xÅy)' Commutative and associative AÅB = BÅA (AÅB) ÅC = AÅ (BÅC) = AÅBÅC
57
Exclusive-OR Function (cont.)
Implementations (x'+y')x + (x'+y')y = xy'+x'y = xÅy
58
Exclusive-OR Function (cont.)
Odd function AÅBÅC = (AB'+A'B)C' +(AB+A'B')C = AB'C'+A'BC'+ABC+A'B'C = S(1,2,4,7) The three-variable exclusive-OR function is equal to 1 if only one variable is equal to 1, or if all three variables are equal to 1. For more variables, an odd number of variables be equal to 1.
59
Exclusive-OR Function (cont.)
The four minterms of the function are a unit distance apart from each other. The odd function is identified from the four minterms whose binary values have an odd number of 1’s. The complement of an odd function is an even function. The three-variable even function is equal to 1 when an even number of its variables is equal to 1. Logic diagram of odd and even functions
60
Exclusive-OR Function (cont.)
Four-variable Exclusive-OR function AÅBÅCÅD = (AB’+A’B)Å(CD’+C’D) = (AB’+A’B)(CD+C’D’)+(AB+A’B’)(CD’+C’D)
61
Exclusive-OR Function (cont.)
Parity Generation and Checking XOR functions are very useful in error detection and correction codes. Parity generator A circuit that generates the parity bit in the transmitter. a parity bit: P = xÅyÅz Parity checker A circuit that checks the parity bit in the receiver. parity check: C = xÅyÅzÅP C=1: an odd number of data bit error C=0: correct or an ever # of data bit error
62
Exclusive-OR Function (cont.)
63
Exclusive-OR Function (cont.)
64
3.10 Hardware Description Language (HDL)
HDL is a computer-based language that describe the design of digital systems in a textual form. Used for describing hardware structure and the function/behavior of logic circuits. HDL are used in several major steps in the design flow of an integrated circuit Design entry Functional simulation or verification Logic synthesis Timing verification Fault simulation
65
Hardware Description Language (HDL) (cont.)
Design entry Creates an HDL-based description of the functionality that is to be implemented in hardware. The description can be in a variety of forms: Boolean logic equation, truth tables, a netlist of interconnected gates, an abstract behavioroal model. Logic simulation Displays the behavior of a digital system through the use of a computer. A simulator interprets the HDL description and produces readable output. Logic synthesis The process of deriving a list of physical components and their interconnections from the model of a digital system described in an HDL. Logic synthesis is similar to compiling a program in a conventional high-level language. Logic synthesis produces a database describing the elements and structure of a circuit.
66
Hardware Description Language (HDL) (cont.)
Timing verification Confirms that the fabricated integrated circuit will operate at a specified speed. Propagation delays ultimately limit the speed at which a circuit can operate. Timing verification checks each signal path to verify that it is not compromised by propagation delay. Fault simulation Compares the behavior of an ideal circuit with the behavior of a circuit that contains a process-induced flaw. Fault simulation is used to identify input stimuli that can be used to reveal the difference between the faulty circuit and the fault-free circuit.
67
A Top-Down Design Flow 第三版內容,參考用! Specification RTL design and
Simulation Logic Synthesis Gate Level Simulation ASIC Layout FPGA Implementation
68
Module Declaration Examples of keywords: module, end-module, input, output, wire, and, or, and not. Any text between two forward slashes (//) and the end of the line is interpreted as a comment. Verilog is case sensitive. A module is the fundamental descriptive unit in the Verilog language Fig Circuit to demonstrate an HDL
69
HDL Example 3.1 HDL description for circuit shown in Fig. 3.37
70
Gate Displays Example: timescale directive ‘timescale 1 ns/100ps 30ns
71
HDL Example 3.2 Gate-level description with propagation delays for circuit shown in Fig. 3.37
72
HDL Example 3.3 Test bench for simulating the circuit with delay
73
Simulation output for HDL Example 3.3
74
Boolean Expression HDL Example 3.4
Boolean expression for the circuit of Fig. 3.37 Boolean expression: HDL Example 3.4
75
HDL Example 3.4
76
User-Defined Primitives
General rules: Declaration: Implementing the hardware in Fig. 3.39
77
HDL Example 3.5
78
HDL Example 3.5 (Continued)
79
Fig. 3.39 Schematic for circuit with_UDP_02467
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.