Today we continue with Mathematics, and more specifically the branch of "Discrete Mathematics", in order to get into Boolean Algebra.
This will be a small introduction to the topic. For more information I highly suggest checking out Logic Design in general.
So, without further ado, let's get straight into it!
Boolean Algebra
Boolean algebra is a branch of mathematics, which studies the algebra of 0 and 1, or false and true. It finds many applications in computer science, with logical circuits being the most direct application, but it's also useful in programming / coding in general.
Boolean Operations
The three main boolean operations are:
AND (conjunction)
OR (disjunction)
NOT (negation)
These are the same exact operations that were covered in the article about Propositional Logic.
Notation
In Boolean algebra the AND and OR operations are commonly symbolized using multiplication and addition respectively, meaning that AND uses "*" or even nothing, and OR uses "+". Using the symbols ∧ and ∨ is of course also valid. Lastly, negation is usually represented by an apostrophe (') or an overline (-) instead of an tilde (~) in front of the respective boolean variable.
Boolean Properties
Boolean operations satisfy the properties shown in the table below.
Boolean algebra is basically a complemented, distributive lattice, with boolean operations AND (∧ or *), OR (∨ or +) and a unique complement or unary operation defined for each element. The elements are only two: 0 and 1.
Boolean Expressions
Boolean expressions are expressions defined over boolean Algebra. Each element in such an expression is an boolean expression itself (i.e. 0 and 1 are boolean expressions on their own).
For example:
is a valid boolean expressions with boolean variables x and y.
Such expressions are evaluated by assigning either 0 or 1 to each boolean variable, yielding a final result of 0 or 1.
Equivalent Expressions
Of course, there can be multiple boolean expressions giving the same result for the same assignment of values. These so called equivalent expressions have the same truth table.
Canonical Forms
It's common to write boolean expressions in either disjunctive or conjunctive normal form, and so basically as a sum of products (SOP) or a product of sums (POS). In a SOP, the product terms are known as min-terms (resulting in 1), whilst in a POS the sum terms are called max-terms (resulting in 0).
Partial Order Relations and Sets → Partial Order Relations, POSET (Elements, Max-Min, Upper-Lower Bounds), Hasse Diagrams, Total Order Relations, Lattices