(Usage hints for this presentation)
IT Systems, Summer Term 2024
Dr. Jens Lechtenbörger (License Information)
Nand
nowMathematical view on logic, going back to (Boole 1847)
Algebra \(B = \{0, 1\}\) with three operations for \(x, y \in B\):
Or: \(x \lor y = \max(x, y)\) (\(= x+y = \text{Or}(x, y)\))
And: \(x \land y = \min(x, y)\) (\(= x \cdot y = xy = \text{And}(x, y)\))
Not: \(\lnot x = 1-x\) (\(=\bar{x} = \text{Not}(x)\))
Precedence: Not binds strongest, then And, then Or
Lots of laws/equalities can be proven, see later slide
\(k\)-ary function \(f: B^k \to B\) for \(k \geq 0\)
E.g., \(k=3\): \(f_0(x_1, x_2, x_3) = x_1 x_2 + \bar{x_3}\)
Can use truth table with \(2^k\) rows and \(k+1\) columns to represent \(f\)
\(x_1\) | \(x_2\) | \(x_3\) | \(f_0(x_1, x_2, x_3)\) |
---|---|---|---|
0 | 0 | 0 | 1 |
0 | 0 | 1 | 0 |
0 | 1 | 0 | 1 |
0 | 1 | 1 | 0 |
1 | 0 | 0 | 1 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 1 |
1 | 1 | 1 | 1 |
Interpret argument in row as binary number, called index: \((x_1 x_2 \ldots k_k)_2\)
Index \(i\) with \(f(i) = 1\) is called positive index
Minterm: Product/And-operation, in which each variable occurs once, potentially negated
Every Boolean function \(f\) can be uniquely represented as sum of all minterms for its positive indices \(I\), i.e.: \(f = \sum_{i \in I} m_i\)
Minterm for index \(i\), denoted \(m_i\): Variable occurs negated if its value in row \(i\) is 0; otherwise, variable without negation
E.g., \(k=3\): \(m_0 = \bar{x_1} \bar{x_2} \bar{x_3}\), \(m_6 = x_1 x_2 \bar{x_3}\)
\(x_1\) | \(x_2\) | \(x_3\) | \(f_0(x_1, x_2, x_3)\) |
---|---|---|---|
0 | 0 | 0 | 1 |
0 | 0 | 1 | 0 |
0 | 1 | 0 | 1 |
0 | 1 | 1 | 0 |
1 | 0 | 0 | 1 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 1 |
1 | 1 | 1 | 1 |
\(f_0 = \bar{x_1} \bar{x_2} \bar{x_3} + \bar{x_1} {x_2} \bar{x_3} + {x_1} \bar{x_2} \bar{x_3} + {x_1} {x_2} \bar{x_3} + x_1 x_2 x_3\)
Such a sum (logical Or) of products (logical And) is also called Disjunctive Normal Form (DNF)
Not(x) = Nand(x, x)
, And(x, y) = ...
Proof for one of the De Morgan rules: \(\overline{xy} = \bar{x}+\bar{y}\)
Sub-expressions in truth table
\(x\) | \(y\) | \(xy\) | \(\boldsymbol{\overline{xy}}\) | \(\bar{x}\) | \(\bar{y}\) | \(\boldsymbol{\bar{x}+\bar{y}}\) | |
---|---|---|---|---|---|---|---|
0 | 0 | 0 | 1 | 1 | 1 | 1 | |
0 | 1 | 0 | 1 | 1 | 0 | 1 | |
1 | 0 | 0 | 1 | 0 | 1 | 1 | |
1 | 1 | 1 | 0 | 0 | 0 | 0 |
Thus, expressions are equal (as Boolean functions)
You can verify your answers in Learnweb.
Source files are available on GitLab (check out embedded submodules) under free licenses. Icons of custom controls are by @fontawesome, released under CC BY 4.0.
Except where otherwise noted, the work “Boolean Logic I”, © 2024 Jens Lechtenbörger, is published under the Creative Commons license CC BY-SA 4.0.