Lecture 9 - Boolean Functions and Reversible Logic Gates
Boolean Functions
Definition: A Boolean function is a function of the form .
Number of Functions: For a given n, the total number of possible Boolean functions is .
Example Calculations
For : There are functions:
For : There are functions.
Common functions include: AND, OR, NOT, XOR, NAND, NOR.
As increases, the number of Boolean functions grows super-exponentially.
Normal Forms
Conjunctive Normal Form (CNF): Every Boolean function can be expressed as a conjunction of disjunctions of literals.
Example: is in CNF.
Disjunctive Normal Form (DNF): Every Boolean function can also be represented as a disjunction of conjunctions of literals.
Example: is in DNF.
Algebraic Normal Form (ANF): Can express Boolean functions as a sum of products of elements of with variables.
Example: where denotes addition modulo 2.
Functional Completeness
A set is functionally complete if every Boolean function can be expressed in terms of functions from .
The commonly used functions for functional completeness are NOT, AND, and OR.
Post’s Criterion: A set is functionally complete if it includes functions not entirely contained within any of the categories: zero-preserving, one-preserving, monotone, linear, and self-dual functions.
Decision Trees and Neural Networks
Boolean functions can be visualized as decision trees.
The set of all possible inputs forms the vertices of an n-dimensional cube in .
Neural networks can be used to approximate or compute Boolean functions. Each Boolean function can be represented as a configuration of layers and neurons in a neural network.
Reversible Computing
Logical reversibility in computing suggests that the output can uniquely determine the input, thus avoiding information loss (e.g., NO bits erased).
Landauer's principle states that irreversible operations (like erasing bits) increase entropy and dissipate heat.
Example of reversible gates are:
CNOT Gate: Operates on two qubits and changes the second qubit based on the value of the first.
Toffoli Gate: A three-bit gate that flips one bit based on the values of the other two.
Logically reversible gates maintain a one-to-one relationship between inputs and outputs.
Summary
Covered key concepts of Boolean functions, CNFs, DNFs, ANFs, functional completeness, the relation between Boolean functions, decision trees, neural networks, and reversible computing, as well as practical implications and examples related to logic gates.