basic definitions

32
Basic Definitions Let B = {0,1} Y = {0,1,2} A logic function f in n inputs x 1, x 2, ... x n and m outputs y 1 ,y 2 , ...y m is a function f : B n Y m h component f i , i = 1,2, ...,m, define the set of input values x such that f i ( :the set of input values x such that f the set of input values x such that f i ( Incompletely specified function : DC_SET ,for some f i => a single output function => a multiple output function m m n n Y y y y Y B x x x X ] ,..., , [ ] ,..., , [ 2 1 2 1 is the input is the output ely specified function : DC_SET = for

Upload: keilah

Post on 05-Feb-2016

23 views

Category:

Documents


0 download

DESCRIPTION

Basic Definitions. Let B = {0,1} Y = {0,1,2} A logic function f in n inputs x 1, x 2, ... x n and m outputs y 1 ,y 2 , ...y m is a function. f : B n. Y m. is the input is the output. For each component f i , i = 1,2, ...,m, define - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Basic Definitions

Basic Definitions

Let B = {0,1} Y = {0,1,2}

A logic function f in n inputs x1, x2, ...xn and

m outputs y1,y2, ...ym is a function

f : Bn Ym

For each component fi, i = 1,2, ...,m, define

ON_SET:the set of input values x such that fi(x) =1

OFF_SET:the set of input values x such that fi(x) = 0

DC_SET:the set of input values x such that fi(x) = 2

Incompletely specified function : DC_SET ,for some fi

m=1 => a single output function

m>1 => a multiple output function

m

m

n

n

YyyyY

BxxxX

],...,,[

],...,,[

21

21 is the inputis the output

Completely specified function : DC_SET = for fi

Page 2: Basic Definitions

Representations

1. Truth Table

full adder

X Y Cin Sum Cout

0 0 0 0 0

0 0 1 1 0

0 1 0 1 0

0 1 1 0 1

1 0 0 1 0

1 0 1 0 1

1 1 0 0 1

1 1 1 1 1• a multiple output function• Sum : on-set = {(0 0 1), (0 1 0), (1 0 0),

(1 1 1)}

off-set= {(0 0 0), (0 1 1), (1 0 1),

(1 1 0)}• a completely specified function

Page 3: Basic Definitions

Representations

2. Geometrical representation

1 variable

0 1

2 variables

00 01

10 11

3 variables

000 100

110

111011

001 101

010010

sum : on-set ={(0 0 1),(0 1 0),(1 0 0),(1 1 1)} off-set ={(0 1 1),(1 0 1),(1 1 0),(0 0 0)}

Page 4: Basic Definitions

Representations

3. Algebraic representations Canonical sum of product

Reduced sum of product

Cout = x’yCin + xy’Cin + xyCin’ + xyCin

Cout = yCin + xCin + xy = yCin + xCin + xyCin’

Multi-level representation Cout = Cin (x + y) + xy

Page 5: Basic Definitions

Representations

4. Reduced Ordered Binary Decision

Diagram (ROBDD)

Decision graph:

f = x1x2 + x3

0 1 0 1 0 1 1

0

0

0 10

1

1

0 1

Terminal node:

• attribute

value (v) = 0

value (v) = 1

Non-terminal node:

• index (v) = i

• two children

low (v)

high (v)

Evaluate an input vector

x1

x2 x2

x3 x3 x3 x3

1

1 0

10 1

Page 6: Basic Definitions

ROBDD

A BDD graph which has a vertex v as root

corresponds to the function Fv :

(1) If v is a terminal node:

a) if value (v) is 1, then Fv = 1

b) if value (v) is 0, then Fv = 0

(2) If F is a nonterminal node(with index(v) = i)

Fv(xi , ...xn) = xi’ Flow(v) (xi+1 , ...xn) +

xi Fhigh(v) (xi+1 , ...xn)

Page 7: Basic Definitions

ROBDD

Reduced BDD :

1. No distinct vertices v and v’ such that sub- graphs rooted by v and v’ are isomorphism.

2. No vertex v with low (v) = high (v)

Page 8: Basic Definitions

x1

x2

x3

0 1

x1

x2 x2

x3 x3 x3 x3

0 1 0 1 0 1 1 1

0 1

x1

x2 x2

x3 x3 x3 x3

x1

x2 x2

x3

0 1

0 1

0 1

0

0 0 0 0

01

1 1 1 1

1

0 1

0

0

0 0 0

01

1 1 11

1

0

0

01

1

1

01

11

0

0

F=x1x2+x1x3+x1x2x3

Page 9: Basic Definitions

ROBDD

• Ordered BDD: if x < y, then all nodes representing x precede all nodes representing y

• Given an ordering of variables, reduced OBDD is canonical

Page 10: Basic Definitions

Example

• The size of OBDD depends on the ordering of

variables

ex : x1x2 + x3x4

x1 < x2 < x3 < x4

x1

x2

x3

x4

0 1

01

01

01

0 1

Page 11: Basic Definitions

Example

x1

x3x3

x2

x4

0 1

0 1

0 1 0 1

0 1 0 1

0 1

x2

x1 < x3 < x2 < x4

• For a good ordering, the size of an OBDD remains reasonably small• Multiplier is an exception

Page 12: Basic Definitions

Operations on ROBDD

Apply f1 <op> f2

(f1, f2 must have the same ordering of variables,

then operations can be operated on f1, f2 )

0 10 1 1

x1 x1 x1

f1 f2

g1 g2 g3 g4 g1g3g2g4

f1 f2

• f1 f2 = (x1’g1 + x1g2)(x1’g3 + x1g4) = x1’g1g3 + x1g2g4

= x1’(g1g3) + x1(g2g4)

·

·

• f1 + f2

• f1 f2

• etc.

0

Page 13: Basic Definitions

ROBDD

• complement : f 1

• f1 f2 : f1’ + f1f2 (implication)

• time complexity Reduced O( G log G )

Apply O( G1 G2 )

Page 14: Basic Definitions

Property of ROBDD

(1) Commonly encountered functions have reasonable representations.(except multiplier)(2) Complementation will not blow up the representation.(3) Canonical form so that equivalence, satisfiability checking can be done easily.(4) Multi-level representation

Page 15: Basic Definitions

Representation

5. And-Inverter Graph (AIG)

– Simple structure

– And-Gates as nodes (shown as circles) with two inputs as edges (shown as arrows)

– Inverters edge marked with a dot

Page 16: Basic Definitions

Example

Ex: y = f( x1,x2,x3) =( (x1 x‧ 2 )’ (x‧ 2 x‧ 3)’)’ = ( x1 x‧ 2 ) + (x2 x‧ 3)

Page 17: Basic Definitions

AIG Construction

– Start from SOP representation

– Convert to AIG using DeMorgans law

x1 + x2 = ( x1 + x2) ’’= ( x1 ’ x‧ 2 ’) ’

2-input and 2-input nand 3-input and 2-input or

Page 18: Basic Definitions

AIG Attributes

• Size is the number of AND nodes in it• Logic level is the number of AND-gates on the

longest path from primary input to primary output – The inverters are ignored

6 nodes, 4 levels

Page 19: Basic Definitions

AIG Canonicity

• AIGs are not canonical– ROBDDs are canonical– Same function represented by two

functionally equivalent AIGs with different structures

– Different structures can still be optimal

6 nodes, 4 levels => area optimal

7 nodes, 3 levels => speed optimal

Page 20: Basic Definitions

Characteristic Function

Let E be a set and A E

The characteristic function A is the function

XA : E -> { 0,1 }

XA(x) = 1 if x A

XA(x) = 0 if x A

Ex:

E = { 1,2,3,4 }

A = { 1,2 }

XA(1) = 1

XA(3) = 0

A

E

Page 21: Basic Definitions

Characteristic Function

Given a Boolean function

f : Bn -> Bm ,

the mapping relation denoted as

is defined as

F B Bn m

F x y x y B B y f xn m( , ) {( , ) ( )}

The characteristic function of a function f is defined for (x,y) s.t. Xf(x,y) = 1 iff (x,y) F

Page 22: Basic Definitions

Characteristic Function Ex: y = f( x1,x2 ) = x1 + x2

x1 x2 y

0 0 0 0 1 1 1 0 1 1 1 1

Fy(x1,x2,y) =

x1 x2 y F

0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 1

Page 23: Basic Definitions

Operation on Logic Function

• Complement

• Intersection

• Union

• Difference

• XOR

• F is a tautology

• Cofactor

• Boolean difference

• Consensus operator

• Smoothing operator

Page 24: Basic Definitions

Cofactor

Cofactor operation ( restriction )

cofactor of f with respect to xi=0

cofactor of f with respect to xi=1

f fxi xi 0

f fxi xi 1

zyyf

zzyf

zxzyxyzyxf

Ex

xxxxff

xxxxff

x

x

nixi

nixi

1

0

211

210

),,(

:

),...,1,....,,(

),...,0,....,,(

Page 25: Basic Definitions

Cofator

Cofactor with respect to any cube

Ex:

f=f

w

),,,(

0=y1,=xyx

0,0

wz

wzff

xwwzxywzyxf

yxyx

Page 26: Basic Definitions

Shannon Expansion

)()(

),,,( :Ex

10

wwzxwzyxf

wwzf

wzyf

wxwzxywzyxf

fyxfyxfyxfyx

fxfxf

x

x

yxjiyxjiyxjiyxji

xx

jijijiji

Page 27: Basic Definitions

Boolean Difference

is called Boolean difference of f with respect to x

f is sensitive to the value of x when

Ex:

f

x

Deff

xf fx x:

f

x

zywyw

wzywwzff

wzywzyxf

wwzwzyxf

xwwzxywzyxf

xx

) () (

),,,1(f

),,,0(f

),,,(

x

x

Page 28: Basic Definitions

Consensus Operator

xx fffxDef )( :

evaluate f to be true for x=1 and x=0

)( fx

Ex:

ywwzfffx

xwwzxywzyxf

xx )(

),,,(

Page 29: Basic Definitions

Smoothing Operator

xx fffxDef )( :

evaluate f to be true for x=1 or x=0)( fx

Ex:

ywzwwzfffx

xwwzxywzyxf

xx

)(

),,,(

Page 30: Basic Definitions

Image Computation by Smoothing Operator

• Computation of reachable states of a sequential finite state machine

• Given f : Bn -> Bm and let

• Use F to obtain the image of a subset A of Bn by f– Compute the projection on Bm of the set

F∩(A× Bm)

• Smoothing operator and and are used

)}(),{(),( xfyBByxyxF mn

))(),(())(( xAyxFxyAf S

Page 31: Basic Definitions

Example for Image Computation Ex:

x1 x2 y z A= {(0, 0), (0, 1)}

0 0 0 0 0 1 1 0 1 0 1 1 1 1 1 1

F(x1, x2, y, z) =

x1 x2 y z F

0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 1 1 0 1 0 0 0 0 1 0 0 1 0 1 0 1 0 0 1 0 1 1 1 …….

Page 32: Basic Definitions

How to build characteristic functions?

Ex:

x1 x2 y z

0 0 0 0 0 1 1 0 1 0 1 1 1 1 1 1 y = x1+ x2 F1 =

z = x1 F2 =

F(x1, x2, y, z) =

Image computation:

S{x1, x2} (F(x1, x2, y, z) )1X