Sunteți pe pagina 1din 15

TwoTwo-Level Logic Synthesis

-- Quine-McCluskey Method Quine-

TwoTwo-Level Logic
What is Two-Level Logic? TwoWhy Two Levels?
Universal Speed Simplicity

Typical Two Level Circuits:


ANDAND-OR, OR-AND, NAND-NAND, NOR-NOR ORNANDNOR-

Cost Functions in Two-Level Circuits TwoNumber of gates Number of fanin (gate inputs)
ENEE 644 2

Quines PI Theorem
Review: Implicants and PIs:
Let f: BnpB A minterm is an implicant in which all literals appear exclusively An implicant with k literals has 2n-k such minterms, who share these k literals. An implicant l1lk is prime iff l1lj-1lj+1lk is not an implicant for all 1ejek. In the cubical representation, for an implicant with k literals, k = n: a vertex (minterm) n: k = n-1: an edge nz xyz yz xyz k = k: an (n-k)-dimension face (plane) k: (n

consist of a sum of prime implicants. Minimal in terms of number of literals


ENEE 644

xyz (Quines Theorem [1952]) A minimal SOP must always y x xyz xyz x

Computing PIs: Tabular Method


f(w,x,y,z) = xy + wxy + xyz + wyz 1. Rewrite in minterm canonical form;
f(w,x,y,z) = (wxyz+wxyz+wxyz+wxyz)+ (wxyz+wxyz)+(wxyz+wxyz)+(wxyz+wxyz)

2. Group by number of complement literals; 3. Merge terms in adjacent groups; Xy + Xy = X -- distance-1 merging distance4. Repeat step 3. until no new term is created.
ENEE 644 4

f(w,x,y,z) = (wxyz+wxyz+wxyz+wxyz)+ (wxyz+wxyz)+(wxyz+wxyz)+(wxyz)


wxyz wxyz wxyz wxyz wxyz
x

wxy wxz wyz wyz wxy xyz wxz xyz


x x x x x x x xy xz

Check for: Xy + Xy = X All prime implicants: wxy, wxz, wyz, wyz, xy, xz More on Quines Method: o Easy to implement o Can handle dont cares q inefficient
ENEE 644 5

x x x x

wxyz wxyz wxyz wxyz

x x x x

xyz wxy wxz

Computing PIs: Iterated Consensus Method


Start with: SOP standard form (as compared to the canonical form in Tabular Method) Goal: sum of all PIs -- complete sum Basic idea: xY + xZ = xY + xZ + YZ -- consensus law Theorem: A SOP formula is a complete sum iff
No term includes any other term; The consensus of any two terms either does not exist or is contained in some term.

ENEE 644

Example: Iterated Consensus Method


f(w,x,y,z) = wx + xy + xyz xY + xZ = = wx + xy + xyz + wy xY + xZ + YZ = wx + xy + xyz + wy = wx + xy + xyz + wy + yz = wx + xy + wy + yz

o Start with any SOP form q Need to compare every pair of terms Do they have consensus? Does one contain the other?
ENEE 644 7

Computing PIs: Recursive Method


Basic idea: if F1 and F2 are complete sums, the complete sum of F1F2 can be obtained by:
Expanding F1 and F2 to POS (Booles Expansion) Multiplying out F1 and F2 by distributive law Applying x x=x and x x=0 Eliminating all terms that are contained in others

Example: f(w,x,y,z) = (w+x)(x+y)(y+z)


= (wx+wy+xx+xy)(y+z) = wxy+wxz+wyy+wyz+xyy+xyz = wy+xy+wxy+wxz+wyz+xyz wy+xy+wxy+wxz+wyz+ = wy+xy+wxz
ENEE 644 8

Computing the PIs: Recursive Method


Given f(x,y,z.)= (x + f(1,y,z..))(x + f(0,y,z)) (Boolean Expansion) C-S(f) = ABSORB((x +C-S(f(1,y,z..))(x + C+CCS(f(0,y,z))) Essentially a recursive procedure. ABSORB is a manifestation of the result outlined in the previous slide.

ENEE 644

Compute Complete Sum by Recursion Tree


f(w,x,y,z)=wyz+xyz+wyz+wxy
f(0,x,y,z)=yz+xyz = (y+z)(y+xz) = yz+xz 0 w 1 f(0,x,0,z) = z f(0,x,1,z) = xz = (x+0)(x+z) = xz y y 1 0 1 0 f(0,0,1,z)=0 f(0,1,1,z)=z x z z x f(1,x,y,z)= xyz+yz+xy =(y+x)(y+x+z) 1 0 1 0 =xy+yz+xy+xz 1 x 0 z f(1,x,0,z) = x f(1,x,1,z) = xz+z = (z+1)(z+x) = x+z f(w,x,y,z) f(1,x,1,0) =1 f(x)= (x + f(0)) = (w+yz+xz)(w+xy+yz+xy+xz) f(1,x,1,1) = x (x+f(1)) = wxy+wyz+wxy+wxz+wyz+xyz+wxz+xyz
ENEE 644 10

QuineQuine-McCluskey Method
Problem: Given a Boolean function f (may be incomplete), find a minimum cost SOP formula.
# of literals

Q-M Procedure:
1. Generate all the PIs of f, {Pj} 2. Generate all the minterms of f, {mi} 3. Build the Boolean constraint matrix B, where Bij is 1 if mi Pj and is 0 otherwise 4. Solve the minimum column covering problem for B

ENEE 644

11

Example: Quine-McCluskey Method Quinef(w,x,y,z) = xy + wxy + xyz + wyz


wxy wxyz wxyz wxyz wxyz wxyz wxyz wxyz wxyz wxyz 1 1 1
ENEE 644

wxz wyz wyz

xy 1 1 1

xz 1

minimum cover(s):
1

1 1

1 1 1 1 1 1

{xy, xz,wxy, wxz}, {xy, xz,wxy, wyz}, {xy, xz,wxz, wyz}.

12

More on Quine-McCluskey Method QuineGoal: find a minimum SOP form Why We Need to Find all PIs? f(w,x,y,z) = xy +wxy+xyz+wyz
= xy+xz+wxy+wyz = xy+xz+wxy+wxz = xy+xz+wxz+wyz
1. Are all terms PIs? 2. Is the form optimal? 3. Is the form unique?

How We Find Them?


Quines tabular: start with minterm, the smallest I Iterated consensus: complete sum theorem Recursive: complete sum theorem

ENEE 644

13

Quines PI Theorem
Review: Implicants and PIs:

xyz yz xyz xyz y x xyz

Let f: BnpB xyz x A minterm is an implicant if the corresponding discriminant is 1. An implicant with k literals has 2n-k such minterms, who share these k literals. An implicant l1lk is prime iff l1lj-1lj+1lk is not an implicant for all 1ejek. In the cubical representation, for an implicant with k literals, k = n: a vertex (minterm) n: k = n-1: an edge n k = k: an (n-k)-dimension face (plane) k: (n

(Quines Theorem [1952]) A minimal SOP must always consist of a sum of prime implicants.
ENEE 644 14

Testability
Stuck-at- 0? Stuck-at-0? Stuck-atStuck-at-

Testability Stuck-atStuck-at-0/1 Fault Model Redundant Gate Untestable Fault


A3=1: y=1, z=1 A1=0: x=0 A2=xz=1

0 0 x y A1

y z A3

? 1 x z A2

An area-optimal circuit must be fully testable for areastuckstuck-at faults.


ENEE 644 15

S-ar putea să vă placă și