15.08.2013 Views

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Definition 253 The disjunctive normal form (DNF) of f is <br />

c∈f −1 (1) Mc<br />

(also called the canonical sum (written as DNF(f)))<br />

Definition 254 The conjunctive normal form (CNF) of f is <br />

c∈f −1 (0) Sc<br />

(also called the canonical product (written as CNF(f)))<br />

x1 x2 x3 f monomials clauses<br />

0 0 0 1 x 0 1 x0 2 x0 3<br />

0 0 1 1 x 0 1 x0 2 x1 3<br />

0 1 0 0 x 1 1 + x0 2 + x1 3<br />

0 1 1 0 x 1 1 + x0 2 + x0 3<br />

1 0 0 1 x 1 1 x0 2 x0 3<br />

1 0 1 1 x 1 1 x0 2 x1 3<br />

1 1 0 0 x 0 1 + x0 2 + x1 3<br />

1 1 1 1 x 1 1 x1 2 x1 3<br />

DNF of f: x1 x2 x3 + x1 x2 x3 + x1 x2 x3 + x1 x2 x3 + x1 x2 x3<br />

CNF of f: (x1 + x2 + x3) (x1 + x2 + x3) (x1 + x2 + x3)<br />

c○: Michael Kohlhase 143<br />

In the light of the argument of understanding Boolean expressions as implementations of Boolean<br />

functions, the process becomes interesting while realizing specifications of chips. In particular it<br />

also becomes interesting, which of the possible Boolean expressions we choose for realizing a given<br />

Boolean function. We will analyze the choice in terms of the “cost” of a Boolean expression.<br />

Costs of Boolean Expressions<br />

Idea: Complexity Analysis is about the estimation of resource needs<br />

if we have two expressions for a Boolean function, which one to choose?<br />

Idea: Let us just measure the size of the expression (after all it needs to be written down)<br />

Better Idea: count the number of operators (computation elements)<br />

Definition 255 The cost C(e) of e ∈ Ebool is the number of operators in e.<br />

Example 256 C(x1 + x3) = 2, C(x1 ∗ x2 + x3 ∗ x4) = 4,<br />

C((x1 + x2) + (x1 ∗ x2 + x3 ∗ x4)) = 7<br />

Definition 257 Let f : B n → B be a Boolean function, then C(f) :=<br />

min({C(e) | f = fe}) is the cost of f.<br />

Note: We can find expressions of arbitrarily high cost for a given Boolean function.(e ≡ e ∗ 1)<br />

but how to find such an e with minimal cost for f?<br />

c○: Michael Kohlhase 144<br />

2.5.3 Complexity Analysis for Boolean Expressions<br />

The Landau Notations (aka. “big-O” Notation)<br />

Definition 258 Let f, g : N → N, we say that f is asymptotically bounded by g, written as<br />

77

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!