1 / 71

ENGG3190 Logic Synthesis “Positional Cube Notation (PCN)” (Operations on Cube Lists)

ENGG3190 Logic Synthesis “Positional Cube Notation (PCN)” (Operations on Cube Lists). Winter 2014 S. Areibi School of Engineering University of Guelph. Outline. Canonical Forms Cubes Positional Cube Notation Operations on Cubes. Review: Relationship Among Representations.

nansen
Télécharger la présentation

ENGG3190 Logic Synthesis “Positional Cube Notation (PCN)” (Operations on Cube Lists)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ENGG3190Logic Synthesis“Positional Cube Notation (PCN)”(Operations on Cube Lists) Winter 2014 S. Areibi School of Engineering University of Guelph

  2. Outline • Canonical Forms • Cubes • Positional Cube Notation • Operations on Cubes

  3. Review: Relationship Among Representations • Theorem: Any Boolean function that can be expressed as a truth table can be written as an expression in Boolean Algebra using AND, OR, NOT. How do we convert from one to the other? Optimizations?

  4. Review: Canonical Forms • Standard form for a Boolean expression - unique algebraic expression directly from a true table (TT) description. • Two Types: • Sum of Products (SOP) • Product of Sums (POS) • Sum of Products • disjunctive normal form (DNF)), • minterm expansion. • Product of Sums : • (conjunctive normal form (CNF)), • maxterm expansion.

  5. Representation of Boolean Functions • Sum of Products: • A function can be represented by a sum of cubes (products): f = ab + ac + bc Since each cube is a product of literals, this is a “sum of products” (SOP) representation • A SOP can be thought of as a set of cubes F F = {ab, ac, bc} • A set of cubes that represents f is called a cover of f. F1={ab, ac, bc} and F2={abc,abc,abc,abc,bc} are covers of f = ab + ac + bc.

  6. B has the same value in both on-set rows– B remains A has a different value in the two rows– A is eliminated The Uniting Theorem • Key tool to simplification: A (B' + B) = A • Essence of simplification of two-level logic • Find two element subsets of the ON-set where only one variable changes its value – this single varying variable can be eliminated and a single product term used to represent both elements F = A'B'+AB' = (A'+A)B' = B' A B F 0 0 1 0 1 0 1 0 1 1 1 0

  7. Basic Definitions • Specification of a function f • On-set fon: set of input combinations for which f evaluates to 1 • Off-set foff: set of input combinations for which f evaluates to 0 • Don’t care set fdc: set of input combinations over which function is unspecified • Cubes • Can represent a function of k variables over a k-dimensional space • Example: f(x1,x2,x3) =  m(0,3,5,6) + d(7) fon = {0,3,5,6}; fdc = {7}; foff = {1,2,4} • Graphically: 011 x3 111 101 001 x2 110 010 x1 000 100

  8. k-cube: k-dim. subset of fon 0-cube = vertex in fon k-cube = a pair of (k-1) cubes with a Hamming distance of 1 Examples A 0-cube is a vertex A 1-cube is an edge A 2-cube is a face A 3-cube is a 3D cube A 4-cube is harder to visualize but can be shown as k-cubes

  9. Logic functions • There are 2n vertices in input space Bn • There are 22n distinct logic functions. • Each subset of vertices is a distinct logic function: fBn 111 000 1 001 0 010 1 011 0 100  1 101 0 110 1 111 0 x3 “truth table” x2 000 x1

  10. Cubes • The AND of a set of literal functions (“conjunction” of literals) is a cube C = xy is a cube C = (x=1)(y=0) z y x xy x =1 y =0

  11. two faces of size 0 (nodes) combine into a face of size 1(line) A varies within face, B does notthis face represents the literal B' 11 01 B 10 00 A Mapping truth tables onto Boolean cubes • Uniting theorem combines two "faces" of a cube into a larger "face" • Example: F A B F 0 0 1 0 1 0 1 0 1 1 1 0 ON-set = solid nodesOFF-set = empty nodesDC-set = 'd nodes

  12. Cubes • A cube is defined as the AND of a set of literal functions (“conjunction” of literals). Example: C = x1x2x3 represents the following function f = (x1=1)(x2=0)(x3=1) c = x1 f = x1x2 f = x1x2x3 x3 x3 x3 x2 x2 x2 x1 x1 x1

  13. SOP • Covers (SOP’s) can efficiently represent many practical logic functions (i.e. for many, there exist small covers). • Two-level minimization seeks the minimum size cover (least number of cubes) ac bc = onset minterm Note that each onset minterm is “covered” by at least one of the cubes! None of the offset minterms is covered ab c b a

  14. Irredundant Cubes • Let F = {c1, c2, …, ck} be a cover for f, i.e. f = ik=1ci A cube ci F is irredundant if F\{ci}  f Example: f = ab + ac + bc ac bc bc Not covered ab ac c b F\{ab}  f a

  15. Prime Cubes • A literal j of cube ci F ( =f ) is prime if (F \ {ci })  {c’i }  f where c’i is ci with literal j of ci deleted. • A cube of F is prime if all its literals are prime. Example f = ab + ac + bc ci = ab; c’i = a (literal b deleted) F \ {ci }  {c’i } = a + ac + bc F=ac + bc + a = F \{ci }  {c’i } bc a ac c b Not equal to f since offset vertex is covered a

  16. Redundant Prime Implicant (RPI) • If each minterm subsuming a prime implicant (PI) is also covered by other essential prime implicants, then that PI is called a redundant prime implicant (RPI). • Also called redundant prime cube (RPC). A EPI C RPI B

  17. Prime and Irredundant Covers • Definition 1A cover is prime (irredundant) if all its cubes are prime (irredundant). • Definition 2A prime of f is essential (essential prime) if there is a minterm (essential vertex) in that prime that is in no other prime. • Definition 3 Two cubes are orthogonal if they do not have any minterm in common • E.g. c1= ab c2 = bc are orthogonal c1= ab c2 = bc are not orthogonal

  18. Definitions … • A cover of a Boolean function is a set of implicants that covers its minterms. • Minimum cover • Cover of the function with minimum number of implicants. • Global optimum. • Minimal cover or irredundant cover • Cover of the function that is not a proper superset of another cover. • No implicant can be dropped. • Local optimum. • Minimal cover w.r.t. 1-implicant containment • No implicant is contained by another one. • Weak local optimum.

  19. Programmable Logic Array (PLA) Like programmable inverter Tied to 0 F1 not inverted Tied to 1 F1 is inverted ENG6530 RCS

  20. … Definitions … f1 = a’b’c’+a’b’c+ab’c +abc+abc’ f2 = a’b’c+ab’c • (a) cover is minimum. • (b) cover is minimal. • (c) cover is minimal w.r.t. • 1-implicant containment.

  21. The Positional Cube Notation • Encoding scheme • One column for each variable. • Each column has 2 bits. • Example: f = a’d’ + a’b+ ab’ + ac’d • Operations? a’d’ a’b ab’ ac’d

  22. Operations on Logic Covers • The distance between two implicants. • The intersection of two implicants (bitwise AND) • The supercube of two implicants (bitwise OR) • The Sharp and Disjoint Sharp Operations. • The Consensus of Cubes. • The Containment of Cubes. • Recursive paradigm • Expand about a variable. • Apply operation to cofactors. • Merge results. • Unate heuristics • Operations on unate functions are simpler. • Select variables so that cofactors become unate functions.

  23. The Distance between Cubes • Given two products (cubes) p1 and p2, the cubes differ in a variable x if p1 has literal x and p2 has literal x’. • If both products have literal x, or both have literal x’, or if variable x does not appear in at least one of the products, then the two products do not differ in variable x • For Example • If p1 = abc’ and p2 = acd’ then • The two products differ in variable c, • The two products do not differ in variables a, b and d.

  24. The Distance between Cubes • The distance between two products is the number of inputs where they differ. • The distance between two products indicates how far apart they are in the hypercube. • Example #1: • Assume p1 = abc’ and p2 = acd’ then these two cubes differ in one variable ‘c’, so they have a distance of 1 • Example #2: • If p1 = ab’c and p2 = a’b’c’d then the two cubes differ in two variables (a and c) so their distance is 2.

  25. Intersection of Cubes • If two products have distance 0, then they intersect. • If two product terms (cubes) have a distance of 1 or greater, then they do not intersect i.e., they have an empty intersection. • The intersection cube, q, is formed in the usual way: • If literal x appears in either p1 or p2, then x appears in q. • If literal x’ appears in either p1 or p2, then x’ appears in q. • If neither x nor x’ appears in either of the products, then it does not appear in q, either. • Example #1: • Cubes abc’ and acd’ have distance of 1  do not intersect • Example #2: • Cubes abc’ and bdhave distance of 0  intersectand create abc’d

  26. Intersection of Cubes: Example • Cubes abc’ and acd’ do not intersect • Cubes abc’ and bdintersect and create? • Cube-0: abc’d cd ab 00 01 11 10 00 bd 01 abc’ 11 acd’ 10

  27. Operations: AND on Cubes • AND operation: • take two lists of cubes • computes pair-wise AND between individual cubes and put result on new list • represent cubes as pairs of computer words • set operations are implemented as bit-vector operations Algorithm AND(List_of_Cubes C1,List_of_Cubes C2) { C = Æ foreach c1Î C1 { foreach c2Î C2 { c = c1 Ç c2 C = C È c } } return C } RETURNS THE MIN TERM (S) THAT ARE COMMON BETWEEN THE CUBES (INTERSECTION)

  28. Intersection (And Operation) • Performing Intersection between P1 (0 0 -) and P2 ( 0 – 1): • 0 0 -  1 0 1 0 1 1 (PCN) • 0 - 1  1 0 1 1 0 1 • 1 0 1 0 0 1  0 0 1 (minterm) z 011 001 y x 000

  29. Operations: OR on Cubes • OR operation: • take two lists of cubes • computes union of both lists • Naive implementation: Algorithm OR(List_of_Cubes C1, List_of_Cubes C2) { return C1È C2 }

  30. Supercube (OR Operation) • The supercube of two implicants is the smallest cube containing both. • Performing Oring between m0 (0 0 0) and m1 ( 0 0 1) (i.e., 0-cubes): • 0 0 0  1 0 1 0 1 0 (PCN) • 0 0 1  1 0 1 0 0 1 • 1 0 1 0 1 1  0 0 - (1-cube) z 011 001 y x 000

  31. Supercube (OR Operation) • Creating Supercubes is allowed only when the distance between implicants is 1. • 0 0 - 1 0 1 0 1 1 (PCN) • 0 1 -  1 0 0 1 1 1 • 1 0 1 1 1 1  0 - - (implicant) x’ x’y 011 z z 001 y y 010 x x 000 x’y’

  32. a1.b’1 a2 … an a1 a2.b’2 … an ……………… a1 a2 … an.b’n  # = The Sharp Operation # • The sharp operation  # returns the sets of implicants covering all minterms covered by  and not by . • Let =a1a2…an and  =b1b2…bn • Example: compute complement of cube ab • 11 11 # 01 01 = {10 11; • 11 10}  a’+b’

  33. 11 01 B 10 00 A The Sharp Operation #: Example minterms covered by  and not by . • Example: • 11 11 # 01 01 = {10 11; • 11 10}  a’+b’ 11 01 11 01 B  B # 10 00 10 00 A A • 11 11 • 10 11  a’ • 11 10  b’ • a’ + b’ • 01 01  ab ON-set = solid nodesOFF-set = empty nodesDC-set = 'd nodes

  34. a1.b’1 a2 … an a1.b1 a2.b’2 … an ……………… a1.b1 a2.b2 … an.b’n  # = Disjoint Sharp Operation # • The disjoint sharp operation  # returns the sets of implicants covering all minterms covered by  and not by such that all implicants are disjoint. • Let =a1a2…an and  =b1b2…bn • Example: compute complement of cube ab • 11 11 # 01 01 = {10 11; • 0110}  a’+ab’

  35. 11 01 B 10 00 A Disjoint Sharp Operation # • Example: • 11 11 # 01 01 = {10 11; • 0110}  a’+ab’ implicants returned are disjoint 11 01 11 01 B  B # 10 00 10 00 A A • 11 11 • 10 11  a’ • 01 10  ab’ • a’ + ab’ • 01 01  ab ON-set = solid nodesOFF-set = empty nodesDC-set = 'd nodes

  36. a1+b1 a2.b2 … an.bn a1.b1 a2+b2 … an.bn ……………… a1.b1 a2.b2 … an+bn Consensus(,)= Consensus • Let =a1a2…an and =b1b2…bn • Consensus of two products will be defined if they do not intersect (distance of 1 or greater) • Consensus is void (00) when two implicants have distance larger than or equal to 2. • Consensus yields a single implicant when distance is 1. • Example: =01 10 01 (ab’c) and  =01 11 10 (ac’) • Consensus(,)= {01 10 00, 01 11 00, 01 10 11} = 01 10 11 = ab’ void

  37. Consensus(,): Example #1 • Example: =01 10 01 (ab’c) and  =01 11 10 (ac’) • Consensus(,) = {01 10 00, 01 11 00, 01 10 11}  01 10 11 = ab’ • Important: • Since ab’c and ac’ differ in one variable the distance is 1. • Therefore, their consensus is, informally the product which can be formed to “connect them”. ab’c   ab’ ac’ c b b   a a

  38. Consensus(,): Example #2 • Example: Suppose p1 = ab’c’ and p2 = bc’d’. Determine the result of the Consensus(p1,p2)? • The distance between p1 and p2is 1. • They do not intersect. • Delete the b variable from both to get ac’ and c’d’ • Intersect the two new cubes to get ac’d’. • Intuitively, cube ac’d’ “connects” p1 and p2, in the region where the two cubes are “adjacent” • Alternatively perform Operations on • P1 = ab’c’  [01 10 10 11] • P2 = bc’d’  [11 01 10 10] cd ab 00 01 11 10 00 01 bc’d’ 11 10 ac’d’ ab’c’

  39. Cofactor Computation (recall) c  1 a  1 abd  [11 01 11 01] (change 01 to 11)  Cube Vanishes!! bc’ • What PCN Operation will Compute the Cofactor?

  40. Cofactor Computation • Let =a1a2…an and  =b1b2…bn(i.e. n variables) • Cofactor of w.r. to  • Void when does not intersect  (i.e. distance is  1) • (a1 + b1’) + (a2 + b2’) . . . (an + bn’) • Cofactor of a set C = {i} w.r. to  • Set of cofactors of iw.r. to . • Example: f = a’b’+ab • a’b’ 10 10 • ab 01 01 • Cofactor w.r. to (a) 01 11 • First row: void (a’b’ does not intersect with a). • Second row: [01 + 10 01 + 00]  11 01  b. • So the Cofactor fa = b

  41. on off Don’t care Cofactor Computation: Example

  42. Containment • Theorem • A cover F contains an implicant  iff F is a tautology. • Consequence • Containment can be verified by the tautology algorithm. Example • f = ab+ac+ab’c’+a’ • Check covering of bc: C(bc) 11 01 01 • Take the cofactor (note bc, ab’c’ no intersection) • Variable ‘a’ appears in both polarities!! • Tautology; bcis contained by f b c a ab ac ab’c’ a

  43. a b c Unate Recursive Paradigm (URP) • Create cofactoring tree stopping at unate covers • choose, at each node, the “most binate” variable for splitting • recurse till no binate variable left (unate leaf) • “Operate” on the unate cover at each leaf to obtain the result for that leaf. Return the result • At each non-leaf node, merge (appropriately) the results of the two children. • Main Idea “Operation” on unate leaf is easy • Operations: complement, simplify,tautology,generate-primes,... merge

  44. Fast Prime Generation Algorithm • We now describe a fast Recursive Algorithm for prime generation based on consensus (based on simple idea!!) • Given a function f and a splitting variable x (True vs. False), each prime implicant of f falls into one of 3 categories: • It contains literal x • It contains literal x’ • It does not contain neither x nor x’ • Category (i) contains primes in one half of the hypercube • Category (ii) contains primes in the other half of hypercube • Category (iii) contains primes which span both halves of hypercube.

  45. Example: • Given the Boolena Function f with cover F = xyz’ + x’y’ + y’zand using x as the splitting variable: • xyz’ is in Category (i) • x’y’ is in Category (ii) • y’zis in Category (iii) (x does not appear in this prime) • Note: Category (i) and (ii) primes can be generated recursively, by finding the primes of two respective cofactors: Fx and Fx’ • The key interesting issue is how to find the remaining primes (Category (iii)), which span both halves of the hybercube!! • The Prime Consensus Theorem Provides the Answer!!

  46. The Prime Consensus Theorem • Let f be a Boolean function, with cover F (which covers the entire ON-set and DC-set). • Also, let x be any input variable. • Then the prime implicants of f can be partitioned into 3 SETS: • Set P1, which contains primes having literal x • Set P0, which contains primes having literal x’ • Set P-, which contains primes with no x or x’ • Each prime p in set P- is the consensus of two other primes, p0 and p1.  p0 from setP0 and p1 is from set P1. • That is p = consensus (p1,p0) for some prime p1 in P1and p0 in P0. • Thus if you already have Sets P1 and P0, all remaining primes (i.e., those in P-) can be simply generated.

  47. One Final Adjustment … • Although sets P1P0 contain all prime implicants of P-, • P1 ,P0 may also contain some smaller non-primes! • These non-primes must be deleted. To do this we introduce a new clean-up operator, which deletes smaller cubes. • Definition: Single-Cube Containment (SCC). • Given any two cubes c1 and c2, cube c2 is single-cube contained in c1, if c1 contains (covers) c2. • For example, if c1 = wy’ and c2 = wxy’z, then c2 is single-cube contained in c1 • Example: If C = {abc, ab’, bcd, ab’d, a’d, a’bcd}, then the single-cube containment of C (written SCC(C)), is the set {abc, ab’, bcd, a’d}. • Thus SCC is a clean-up operator, which takes a set of cubes and deletes each cube which is completely contained in another cube. P- = SCC(consensus(P1, P0))

  48. Recursive Prime Generation Theorem • Let f= x fx + x’ fx’ (Recall Shannon Expansion) • Generate all primes of the cofactor of cover F: Primes(Fx), then AND all primes with literal x (i.e., P1) • Generate all primes of the cofactor of cover F: Primes (FX’), then AND all primes with literal x’ (i.e., P0) • Generate primes of P- by using the CONSENSUS() operator • Remove all non-primes using SCC() • This key theorem formally summarizes how the primes of f can be generated recursively, and effectively is an outline of the algorithm. • The problem of finding primes of f is transformed into the problem of finding the primes of two simpler cofactors, Fx and Fx’.

  49. … Computation of all Prime Implicants • Example: f = ab + ac + a’ • Let us choose to split the binate variable a • Note that fa’ is tautology; P(fa’)=U; a’fa’ = C(a’)  P(fa’) =10 11 11 = P1 = {a’} • P(fa)= {11 01 11; 11 11 01} = b+c; afa = C(a)  P(fa) = {01 01 11; 01 11 01} = P2 = {ab, ac} • Consensus(P1,P2) = {11 01 11; 11 11 01} = {b, c} • P(F)=SCC{ 10 11 11; 01 01 11; 01 11 01; 11 01 11; 11 11 01} SCC{a’, ab, ac, b, c} = {10 11 11; 11 01 11; 11 11 01} = {a’, b, c}

More Related