This chapter studies Boolean expressions as functions: how to represent them, prove identities, and simplify implementations. The two-element algebra connects propositional truth tables with digital logic. Basic propositions and quantifiers are introduced in Mathematical Foundations; formal derivations and inference algorithms have their own chapters below.
Our main example is the two-element Boolean algebra, rather than a general classification of abstract Boolean algebras. Its core operations are conjunction, disjunction, and complement; XOR is a derived operation. Truth-table review here supports algebraic equivalence and function representation, rather than repeating the foundations' proof-method lessons.
Boolean Expression and Truth Table
We call Boolean Algebra "Algebra" of course, because it possesses property of Algebra. We will start with basic algebra operation and thus, proceed to get the rule of Boolean operation, which we call the "Truth Table".
Property of Algebra Operation
For normal algebra operation of numbers, we have the following general law by representing the number in , , and .
| Law | Addition expression | Multiplication expression |
|---|---|---|
| Identity | ||
| Property of zero | ||
| Inverse | , for | |
| Commutative | ||
| Associative | ||
| Distributive |
Common Algebraic Laws
In this case, we call , , and variables as in programming. For all possible values of these variables, these laws hold. These laws justify transformations in the chosen algebraic structure; they do not imply that every true mathematical equality follows from this short list alone. We take as an example. One may say without a second thought that the answer is 1. But why? Can we prove it? Now we try to prove it using the common algebraic laws.
Prove that
Remark: Some people may not understand why we have to write into . This is because Addition Identity is only defined in the table as , so we need to apply Commutative law of addition to fit it into the known conclusion.
After seeing this, you may think, do we really have to know this to make sure that ? Of course not, but keep in mind that Every mathematical conclusion cannot be simply referred as rules such as "a negative times negative give you a positive number", but by meticulous, reasonable, and replicable proof.
Boolean Expression and Truth Table
Hold on a second, isn't this chapter on Boolean Algebra? Why we still need to go over these old knowledge from primary school? Well, this is because we will prove Boolean expression in the same way. Before that, we introduce Boolean value and operations.
In mathematics and computer science, a Boolean value is defined as an element of the Boolean domain , which can be mathematically represented as:
where:
-
typically represents false
-
typically represents true
Some may be confused by true and false here. Just recall what we have done to propositions in the first chapter in this book. When a statement holds for given condition, we take it as correct, while incorrect when it does not hold. A Boolean expression evaluates to a Boolean value after its variables receive values. Before an assignment is supplied, it generally represents a function, not a constant.
Boolean algebra involves operations such as AND, OR, NOT, XOR, which operate on these Boolean values. These operations are defined as follows:
-
AND (): An operation on two Boolean values that returns true if both operands are true, otherwise returns false.
-
OR (): An operation on two Boolean values that returns true if at least one of the operands is true, otherwise returns false.
-
NOT (): A unary operation that returns true if the operand is false and vice versa.
-
XOR (): An operation on two Boolean values that returns true if the operands are different, otherwise returns false.
Remark: There are more Boolean operators to be discussed later.
In computer science, Boolean values are fundamental in conditional statements and loops, where they determine the flow of control in algorithms and programs. They are also essential in the design of electronic circuits and digital computing. The following table shows the truth table of these basic Boolean operations. the first column shows the combination of inputs for the specific operator, and the second column shows the result of operation.
| A | |
|---|---|
| F | T |
| T | F |
Common Boolean Operators Truth Tables
| A | B | |
|---|---|---|
| F | F | F |
| F | T | F |
| T | F | F |
| T | T | T |
Common Boolean Operators Truth Tables
| A | B | |
|---|---|---|
| F | F | F |
| F | T | T |
| T | F | T |
| T | T | T |
Common Boolean Operators Truth Tables
| A | B | |
|---|---|---|
| F | F | F |
| F | T | T |
| T | F | T |
| T | T | F |
Common Boolean Operators Truth Tables
It's noticeable that different Boolean operators may differ in the number of input. operator takes only one Boolean variable (input) to get an output by negating the input, however the rest take two inputs and produce one output.
We defined the Boolean space as . This choice reflects the two truth values used by Boolean algebra. Among the four familiar arithmetic operations, Boolean expressions are generated from a small basis such as , , and ; other operators can be expressed in terms of these. For example,
The addition and multiplication tables for and illustrate the analogy with ordinary algebra.
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Addition and Multiplication Rule of 0 and 1
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
Addition and Multiplication Rule of 0 and 1
Now you may have realized that this is exactly the truth table for and , shown in Table 1.5.
Boolean Identities
Now recall that . In this expression, we cannot get a direct answer from the RHS by using the truth table of . So, we need to try harder to get the truth table for the expression as shown in the table below.
| F | F | T | F | T | F | F |
| F | T | F | F | T | T | T |
| T | F | T | T | F | F | T |
| T | T | F | F | F | F | F |
Truth table for
With this method, we can find truth table for more complex expressions, and some of them are categorized as Basic Boolean Identities. The LHS and RHS are could be proven qaual by listing truth table respectively.
| Identity | AND form | OR form |
|---|---|---|
| Idempotent law | ||
| Identity law | ||
| Domination law | ||
| Complement law | ||
| Double negation law | ||
| Commutative law | ||
| Associative law | ||
| Distributive law | ||
| De Morgan's law | ||
| Absorption law |
Basic Boolean Identities
If you are confused by the algebra form of Boolean identities, just take , , as , , and ; take 0/1 as F/T; take + as , and as .
It is quite important to be familiar with these rules, as they are just as essential as the normal algebra laws we've learned before, since we may simplify complex Boolean expressions using these rules. Also, the proof of some of these identities using truth table will be added to the problem set for this section. If you remain any doubt or confusion about any laws given, just try to get the truth table for the LHS and RHS of the identity, simple as that.
This is actually not yet a complete table of Boolean Identities, two laws are still missing from the table, because they are relevant to secondary operator, one of which is already mentioned().
With these basic Boolean laws, we can derive more interesting and useful theorems. A commonly used theorem when simplifying Boolean expressions is the consensus theorem, also called the redundancy theorem.
The consensus theorem helps simplify Boolean expressions by eliminating a redundant term. Like the other identities, it has both an OR form and an AND form. For Boolean variables , , and ,
which is equivalent to
The OR form follows from the following calculation:
In additive notation, the same identity is
Secondary Boolean Operators
Secondary operators are derived from basic operators:
-
Material conditional:
-
Material biconditional:
-
Exclusive OR (XOR):
Their truth tables for the secondary operation are below:
| 0 | 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 0 | 1 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 |
Truth values of material conditional, biconditional, and XOR for all possible inputs.
The operation holds that . This expression means that when , then must be true. The complete form of secondary operators and the implication identity will be the last Boolean identity to be covered in this chapter.
-
Material Conditional (): The material conditional is read as "if then " or " implies ". It represents the logical implication. The truth value of is false only when is true and is false; in all other cases, it is true. This is a bit counter-intuitive when is false because the implication will be true regardless of the value of . It can be expressed using basic operations as .
-
Material Biconditional (): The material biconditional , also known as logical equivalence, is the operation that is true when and have the same truth values, and false otherwise. It's often read as " if and only if ". It can be formulated as , meaning both and are true, or both are false.
-
Exclusive OR (XOR): The exclusive OR is true when and have different truth values, that is, one is true and the other is false. It differs from the regular OR operation in that is false when both and are true. It can be represented as .
With these basic identities and operators, we can prove more interesting Boolean theorems. Below are more theorems to be proved as example. Maybe you are ready to draw a truth table to prove them. However, with these basic Boolean Laws, we actually don't have to do that, but prove it by using Algebra techniques.
Prove the following identities using the table given earlier.
| Expression | Name |
|---|---|
| as | |
| Contrapositive | |
| Implication | |
| Absurdity | |
| Contradiction |
To prove as , we just need to use the definition of .
The contrapositive identity states that is logically equivalent to .
Remark: This proof shows why proof by contrapositive (mentioned in chapter1) is correct.
The implication identity can be proved by showing that is equivalent to .
The absurdity identity states that is equivalent to .
The contradiction identity states that is equivalent to .
Some may feel confused by the notation of Boolean expression we use in this chapter. Sometimes we use logic notation, while sometimes use algebra operation. Both are ok, it's really up to your preference.
When you look through the whole process, you'll find that we are actually doing the same thing as simplifying Boolean expressions, where all the laws could be used so that we don't need to draw truth table again and again.
Exercises
Use Table 1.1 and to show that .
Show that using the table.
Show that , you may use the conclusion of previous exercise.
To make it clear, we use square and curly bracket for different layers of parenthesis.
Use truth table to show that De Morgan's Law is correct.
De Morgan's First Law:
| 0 | 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 1 | 1 | 0 | 0 |
De Morgan's Second Law:
| 0 | 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 |
| 1 | 1 | 1 | 0 | 0 |
Use truth table to show that Absorption Law is correct.
| T | T | T | T |
| T | F | T | T |
| F | T | F | F |
| F | F | F | F |
| T | T | T | T |
| T | F | F | T |
| F | T | F | F |
| F | F | F | F |
Show the truth table of .
Hint: For Boolean expression of 3 variable, there will be more combinations.
Solution:
| 0 | 0 | 0 | 1 | 1 | 1 | 1 |
| 0 | 0 | 1 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 | 0 | 1 |
| 1 | 1 | 1 | 0 | 0 | 0 | 1 |
Truth table for the expression
Given the expressions:
Show that they are equivalent and find the common (simplified) form of the four expression
These expressions could be simplified to , or , which can also be understood as and cannot be true of false in the same time.
Show that the two forms of the consensus theorem are equivalent.
and
are equivalent.
Solution: We can simplify the product form to the standard form easily.
Boolean Function
This section will bring you some further ideas of Boolean operation. Just like we can take a normal algebra expression, such as , as a function ; we can define Boolean Function with Boolean operation.
A Boolean function is a function that returns a Boolean value (true or false) for each possible combination of Boolean inputs. is a function from the set of -tuples of Boolean values to the set of Boolean values, where .
For example, we can write the basic operations we just went over in Boolean Functions:
-
Algebraic notation:
-
AND: or
-
OR:
-
NOT: or
-
-
Logical notation:
-
AND:
-
OR:
-
NOT:
-
We have actually learned about this earlier in the chapter. Think about what we have done using truth tables. Just like what you have done at the beginning of learning functions, you were making tables to show all results of each input with their output. For Preliminary functions, we always have , which makes the mapping hard to make table, because there are infinite many real numbers. But things is much easier for Boolean function, because we have known in the definition that each function generate only one single output, and the most important part is that we always have limited inputs. Since for the Boolean Domain, so each input gives us 2 choices only, and therefore when we have inputs, we have cases only. seems huge, but in most cases we have less than 5 inputs in a Boolean function, so the size of the table is still manageable.
Representation of Boolean Function
In most cases, we construct a Boolean Function from a given truth table. All Boolean functions could be represented in both Disjunctive Normal Form (also known as sum of product;SOP form) and Conjunctive Normal Form (also known as Product of Sum;POS form).
The Sum of Products (SOP) form, also known as the Disjunctive Normal Form (DNF), is a way to represent a Boolean function as a sum (logical OR) of product (logical AND) terms. Each product term consists of literals (variables or their complements) that correspond to the function's minterms, which are the input combinations that result in a function value of 1. The general form of an SOP expression is:
where is the number of minterms, is the number of variables, and is either or (complement of ) depending on the value of in the -th minterm.
The Product of Sums (POS) form, also known as the Conjunctive Normal Form (CNF), is a way to represent a Boolean function as a product (logical AND) of sum (logical OR) terms. Each sum term consists of literals (variables or their complements) that correspond to the function's maxterms, which are the input combinations that result in a function value of 0. The general form of a POS expression is:
where is the number of maxterms, is the number of variables, and is either or (complement of ) depending on the value of in the -th maxterm.
Minterms and maxterms are fundamental building blocks for representing Boolean functions, corresponding to the input combinations that result in function values of 1 and 0, respectively.
But why we are so obsessed with whether the output for one single row is 1(T) or 0 (F)? This is because, when we are constructing a Boolean function, we are trying to make the mapping from to , while . Hence, we could conclude that the result of boolean function is actually binary, meaning only two cases for the output(we will talk about it later in the chapter). So, we only need to figure out either of all the cases where the output is 0, or all the cases where the output is 1. This actually explains what are stated in the Canonical Form Theorem.
Any Boolean function can be expressed in either of two canonical forms:
-
Sum of Products (SOP) form, also known as the Disjunctive Normal Form (DNF): Any Boolean function can be represented as a disjunction (OR) of one or more minterms, where a minterm is a product (AND) of literals corresponding to the rows in the truth table where the function value is 1.
-
Product of Sums (POS) form, also known as the Conjunctive Normal Form (CNF): Any Boolean function can be represented as a conjunction (AND) of one or more maxterms, where a maxterm is a sum (OR) of literals corresponding to the rows in the truth table where the function value is 0.
To prove the Canonical Form Theorem, we will consider an arbitrary Boolean function and show that it can be expressed in both SOP and POS forms.
Proof of SOP form (DNF):
-
For each row in the truth table where the function value is 1, create a minterm by taking the conjunction (AND) of the literals corresponding to the input values in that row. If the input variable is 1, use the original variable; if the input variable is 0, use the complement of the variable.
-
Take the disjunction (OR) of all the minterms obtained in step 1. This resulting expression is the SOP form of the Boolean function.
Since every row where the function value is 1 is represented by a minterm, and the disjunction of these minterms covers all the cases where the function is 1, the resulting SOP form is equivalent to the original Boolean function.
Proof of POS form (CNF):
-
For each row in the truth table where the function value is 0, create a maxterm by taking the disjunction (OR) of the literals corresponding to the input values in that row. If the input variable is 0, use the original variable; if the input variable is 1, use the complement of the variable.
-
Take the conjunction (AND) of all the maxterms obtained in step 1. This resulting expression is the POS form of the Boolean function.
Since every row where the function value is 0 is represented by a maxterm, and the conjunction of these maxterms covers all the cases where the function is 0, the resulting POS form is equivalent to the original Boolean function.
Therefore, any Boolean function can be expressed in either SOP or POS form, proving the Canonical Form Theorem.
Considering
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
.If you are familiar with the Boolean operations, you may have realized this is actually a XNOR operation, which negates XOR. We will try to get the Algebra expression of this function in both POS and SOP.
For the SOP form:
-
Function value is 1 for the corresponding input combinations.
-
Smallest terms: , .
-
SOP form of the Boolean function: .
For the POS form:
-
Function value is 0 for the corresponding input combinations.
-
Largest terms: , .
-
POS form of the Boolean function: .
These two forms can be converted to each other based on the truth table of a Boolean function.
This method also works for Boolean functions with more variables, and the only difference is that it may take a little more time. You may check more relevant problems in the exercises.
Properties of Boolean Function
In this part of the chapter, we will look into further details of Boolean Expression, specifically, Boolean Function. As an intro, we start with completeness and duality of Boolean Function. After this, we will introduce the Fundamental Theorem of Boolean Algebra, also known as Boole's expansion theorem (or Shannon expansion), which in the foundation of logic circuit design and implementation.
A set of Boolean operators is said to be functionally complete if every Boolean function can be expressed using only those operators. The following sets are known to be functionally complete:
-
The set {AND, OR, NOT}, also known as the standard or canonical basis.
-
The set {NAND}, known as the NAND-only implementation.
-
The set {NOR}, known as the NOR-only implementation.
The completeness property is important in digital logic design, as it allows designers to create any desired Boolean function using a minimal set of logic gates.
For each input row where , form the conjunction that uses when that row has bit one and when it has bit zero. This conjunction is true on exactly that row. Their disjunction therefore agrees with on every row. If no row is true, use the constant zero, or when an input is available. Thus every finite Boolean function has a representation in this basis. The constructions below then implement this basis using NAND alone or NOR alone; for zero-input functions constants must be available explicitly.
If you are getting confused by the word "Logic Gate", just take it as another way we call Boolean or Logic Operators. Logic gates are what electric engineers use to construct Boolean circuits, which is not discussed in details in this book, since we only discuss the mathematical aspect of this practice. You may refer to this link if you want to get more details.
To further illustrate, we could say that all Boolean Functions, or Boolean expressions can be expressed by either combinations of {AND, OR, NOT}, or NAND gates(s), or NOR gate(s). The first point is already quite clear, we have shown that all secondary operators can be written equivalently in basic operators, {AND, OR, NOT}. While NAND and NOR are general logic gates that could construct any logic gates. Below is a simplified proof.
We start the proof with the fact that all Boolean operations can be written by operators. To show that all Boolean operations could be implemented by NAND and NOR gate, we only need to show that {AND, OR, NOT} can be expressed by both NAND and NOR operator.
- Using NAND gates:
-
NOT gate: A NAND gate with its inputs connected together acts as a NOT gate.
-
AND gate: A NAND gate with its output inverted by a NOT gate (another NAND gate) acts as an AND gate.
-
OR gate: An OR gate can be constructed using NAND gates and De Morgan's Law: .
- Using NOR gates:
-
NOT gate: A NOR gate with its inputs connected together acts as a NOT gate.
-
OR gate: A NOR gate with its output inverted by a NOT gate (another NOR gate) acts as an OR gate.
-
AND gate: An AND gate can be constructed using NOR gates and De Morgan's Law: .
Now, we have shown that all the three basic logic gates could be expressed by only NAND and NOR gate(s), which completes the proof.
You can get more details of the logic gates here. This fact is more used in engineering practice but not in mathematics. So you just need to know the basic idea (in this book).
For an expression built from AND, OR, NOT, and constants, form its dual by swapping AND with OR and zero with one, while leaving variables and NOT operations unchanged. The resulting function satisfies
Consequently the dual is independent of the chosen expression, , and every valid identity remains valid after taking duals on both sides.
Use structural induction on the expression. For a variable, the right side is , so , not . Constants zero and one are interchanged. Assume the formula holds for . De Morgan's laws give
and the analogous formula with AND/OR exchanged. For a NOT node, , so the induction also covers negation. This exhausts the constructors. The formula depends only on the function values, hence is representation-independent. Applying it twice cancels both input and output negations, proving double duality. Equal functions remain equal after the same input substitution and output negation, proving the identity principle.
For example, and . NAND and NOR are dual. The dual of implication is , not converse implication. Duality changes connective structure; it does not separately complement every literal.
The next result decomposes a function by the value of one variable.
Boole's expansion theorem, often referred to as the Shannon expansion or decomposition, is the identity: ,where is any Boolean function, is a variable, is the complement of , and and are with the argument set equal to 1 and to 0 respectively. The terms and are sometimes called the positive and negative Shannon cofactors, respectively, of with respect to . These are functions, computed by restrict operator, restrict and restrict. The former represents the function where the variable is set to 0, and the latter represents the restriction of the function where the variable is set to 1.
Proof of Shannon's Expansion Theorem. Let be a Boolean function of variables, and let be a selected variable. We want to express in terms of two subfunctions: one where is true and the other where is false.
First, we define two subfunctions:
Now, consider the following expression:
We need to prove that this expression is equal to the original function . For any combination of input values , either is true or is true (but not both).
Therefore, one of the two product terms in the expression will be zero, and the other will be equal to the value of for that input combination.
If is true, then and , so the expression evaluates to , which is the correct value of when is true.
If is false, then and , so the expression evaluates to , which is the correct value of when is false.
Therefore, the expression correctly represents the Boolean function for all possible input combinations, proving Shannon's expansion theorem.
Write for the restrictions at , with duals taken only in the remaining variables. Taking the dual of Shannon's expression gives
At this is ; at it is . Thus the equivalent sum form is
The branch values swap because the semantic formula negates the input before evaluating .
Simplification of Boolean Function
Simplifying boolean functions is a crucial step in digital logic design. It involves reducing the complexity of a boolean expression without changing its truth table or output behavior. The method of simplification is manifold. This chapter shows several most commonly used ways.
Simplification by Boolean Laws (Algebra)
In the previous chapter, we discussed Boolean laws and identities. They can simplify expressions, but a truth table becomes unwieldy as the number of variables grows. Four inputs already give rows, and a sum-of-products or product-of-sums expression may contain many terms. For larger expressions, a Karnaugh map or an algorithmic minimizer is usually more practical.
Simplification by Karnaugh Maps
Karnaugh Maps (K-maps) are visual tools for simplifying boolean functions of up to six variables. They reduce the need for extensive calculations by taking advantage of human pattern recognition.
The K-map is essentially a truth table arranged in a grid that helps in the identification of common patterns and the elimination of redundant terms. Each cell in a K-map represents a possible input configuration of the variables, and the cells are arranged such that only one variable changes between adjacent cells. This adjacency allows for the visual grouping of terms, which corresponds to combining terms in the Boolean function that differ by only a single variable. As a result, K-maps make it easy to apply the combining rule: when two terms differ by only a single variable, that variable can be eliminated from the combined term.
Considering this truth table.
| 0 | 0 | 0 | 0 | 1 |
| 0 | 0 | 0 | 1 | 1 |
| 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 1 | 1 | 1 |
| 0 | 1 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 0 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 0 | 1 | 1 | 0 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 | 0 |
By finding the minterms, we have a four variable SOP function.
Of course we don't want to simplify such thing using Boolean Laws, which is definitely time-consuming. What we do here is to make a K-map for the graph. Notice that the sequence of the combination for the variables must follow Gray code sequence. In brief, change one bit at one time. Such as 01, 10, 11, 10 for combination of two variables. On the left we can see the K-map. To find the expression (here we try to get the SOP form), we need to group all 1s by the following pattern.
Grouping in Karnaugh Maps follows specific rules to ensure the correct simplification of a Boolean function. These rules are rooted in the principles of Boolean algebra and help to minimize the number of logical terms. Here are the key rules for grouping in K-maps:
-
Power of Two: Groups must contain either 1, 2, 4, 8, ... (powers of two) cells. This is to ensure that each group can be represented by a simplified product term.
-
Maximize Group Size: Groups should be as large as possible to maximize simplification. Larger groups result in fewer variables in the corresponding product term.
-
Overlap Allowed: Groups may overlap if doing so allows for larger groups to be formed, further simplifying the expression.
-
Wrap Around: Groups can wrap around the edges of the K-map, thanks to the toroidal topology of K-maps. This means that cells on the top edge are considered adjacent to those on the bottom edge, and similarly, the left edge is adjacent to the right edge.
-
Include All Ones: Each '1' in the K-map must be included in at least one group. The aim is to cover all minterms represented by the '1's.
-
Unused Cells: Cells with '0' values are not included in the groups unless they contribute to making a larger group with '1's.
-
Essential Prime Implicants: After grouping, any group that covers a minterm not covered by any other group represents an essential prime implicant and must be included in the final expression.
Applying these rules gives us the grouped graph on the right-hand-side. Now we only need to analyze group by group to rule out inconsistent variables among the group. Below are the breakdowns.
-
The first group (green) gives and , which rules out the term, so we have in the expression.
-
The second group (red) gives and , which rules out the term, so we have in the expression.
-
The third group (blue) gives and , so we can rule out terms, so we have in the expression.
-
The fourth group (purple) gives and , which rules out terms, so we have in the expression.
-
The fifth group (yellow) gives and , which rules out terms, so we have in the expression.
-
The last group (pink) is a single block, so we must also include in the expression.
Each term we have found will be joined by + sign. Hence, we get the simplified SOP form for .
Don't you think it's like magic? We have reduced this to a sum of six terms from ten terms. Does this method can help us to solve all the problems? Sadly no, because when we have seven or more variables in the k-map, something unexpected will happen.
We obtained the SOP form in this method, is it possible to get the POS form of the expression? Yes it is. All we need to do is repeating this process to 0s in the graph and apply same grouping rules. In the end, we rule out inconsistent variables for each turn and write them in a product of sum.
While Karnaugh Maps are powerful tools for simplifying Boolean expressions, they are commonly only used for functions with up to four to six variables due to several practical limitations:
-
Visualization Complexity: K-maps rely on spatial arrangements that allow the human eye to detect patterns and groupings. As the number of variables increases beyond six, the map becomes excessively complex, making it challenging to discern such patterns effectively.
-
Cognitive Load: The human brain has a limited capacity for processing complex information visually. The cognitive load increases significantly with each additional variable, making it difficult to perform the simplification accurately.
-
Physical Representation: A K-map's size doubles with each additional variable, leading to an exponential growth in the number of cells. A 6-variable K-map already has 64 cells, and a 7-variable map would have 128 cells, which becomes unwieldy for manual simplification.
-
Efficiency and Errors: With a large number of variables, the probability of making errors in grouping increases. It also becomes less efficient compared to computerized methods, such as the Quine-McCluskey algorithm (to be discussed later) or Binary Decision Diagrams (BDDs), which can handle a large number of variables systematically.
For these reasons, while theoretically possible, using K-maps for more than six variables is not practical, and alternative methods are preferred for simplifying larger Boolean functions.
To give a clearer idea on the nature of it and why it works, we can explain this mechanism by set theory. Each cell in a K-map corresponds to an element in the power set (the set of all subsets) of the Boolean variables' domain, reflecting a unique combination of variable values. Adjacent cells in the map are defined such that they only differ by one variable state, conforming to the principle of adjacency in set theory, where the intersection of sets differs by the least possible criteria.
Grouping cells in a K-map is akin to finding the union of subsets that share a common feature, thus simplifying the Boolean expression to include only the necessary variables. The simplified function represents the union of all such groups. The goal is to cover all the '1's in the K-map (the truth set of the function) with the fewest and largest possible groups of adjacent cells (subsets). These groups are then translated back into a minimized Boolean expression.
Simplification by Quine-McCluskey Method
Quine-McCluskey Method was developed in the 1950s by W. V. Quine and E. J. McCluskey, Jr. This method truly provides a mechanized way to simplify Boolean functions, which is more generalized.
The Quine--McCluskey algorithm, also known as the method of prime implicants, is a systematic technique used for minimizing Boolean functions. Similar to Karnaugh maps, the Quine--McCluskey algorithm finds the prime implicants of the function, which can then be used to extract the essential prime implicants, resulting in the simplified Boolean expression. However, unlike Karnaugh maps, the Quine--McCluskey algorithm does not rely on visual patterns and is therefore well-suited to computerization and can handle functions with many variables.
The algorithm consists of several steps:
-
List the minterms of the function in binary form.
-
Group the minterms based on the number of ones in their binary representation.
-
Compare each pair of minterms within adjacent groups to find pairs that differ by exactly one bit. Combine these pairs to form new terms, and mark the minterms that were combined.
-
Repeat the process until no further combinations are possible. The terms that remain are the prime implicants.
-
Use a prime implicant chart to identify essential prime implicants and select a minimal cover for the function.
In pseudo code it will be.
Algorithm 1 Quine-McCluskey Simplification
Require: Boolean function
Ensure: a simplified Boolean expression
1:Convert each term of into binary form to obtain the minterms.
2:Group the minterms by the number of ones in their binary representations.
3:while further combinations are possible do
4:Combine pairs from adjacent groups that differ in one bit.
5:Mark the minterms that were combined.
6:end while
7:Collect unmarked terms as prime implicants.
8:Build a prime-implicant chart and select a minimal cover.
9:return the simplified function
You may check one example here.
Exercises
Express XOR and implication in Boolean Function.
Use a table to express the values of each of these Boolean functions.
The third function simplifies to by absorption; the fourth to because .
| 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 1 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 0 | 0 |
| 1 | 0 | 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 1 | 1 | 1 | 0 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 |
Prove duality of Boolean Function in Algebra method.
The structural proof above covers variables, constants, both binary connectives, and negation. In particular for , both direct dualization and give .
Use K-map to simplify the Boolean Function from the following truth table.
| 0 | 0 | 0 | 0 | 1 |
| 0 | 0 | 0 | 1 | 1 |
| 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 1 | 1 | 1 |
| 0 | 1 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 0 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 0 | 1 | 1 | 0 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 | 0 |
The function is given by:
The K-map is as follows.
-
The first group (blue) gives and , which rules out terms, so we have in the expression.
-
The second group (yellow) gives and , which rules out terms, so we have in the expression.
-
The third group (red) has four blocks, so we can exclude two terms from it, and in this case we find that and terms differ, so we have in the expression.
-
The last group (green) is also four-block, in the same way we rule out and terms, and we have in the expression.
Hence we get the simplified SOP form for .
Express each of these Boolean functions using the operators (AND) and (NOT).
We need to use De Morgan's law to replace each occurrence of by , simplifying by use of the double complement law if possible.
-
In this case, we can just apply De Morgan's law directly, to obtain .
-
The second factor is changed in a manner similar to part (a). Thus, the answer is .
Find the sum-of-products expansion of the Boolean function
that has the value 1 if and only if three or more of the variables , and have the value 1.
We need to include all terms that have three or more of the variables in their uncomplemented form. This will give us a total of terms. The answer is:
How many different Boolean functions are there such that
for all values of the Boolean variables , and ?
Suppose that you specify . Then the equations determine and . It also therefore determines , but nothing else. If we now also specify (and there are no restrictions imposed so far), then the equations tell us, in a similar way, what , , and are. This completes the definition of . Since we had two choices in specifying and two choices in specifying , the answer is .
We discussed in part 1 of the book about visualization of Euclidean Space. Now, can you try to explain that how can we define 's visualization.
-
How can we visualize ? What kind of geometrical objects are they?
-
Can you try to explain how could be explained in terms of ?
The set represents the Boolean domain, which consists of two elements: 0 and 1. For higher dimensions:
-
can be visualized as a square on a binary (2D) grid, where each corner corresponds to a pair of Boolean values (00, 01, 10, 11).
-
extends this to a cube in a three-dimensional binary grid, with each corner representing a triplet of Boolean values (000, 001, 010, 011, 100, 101, 110, 111).
Visualizing is more abstract since we cannot directly perceive four dimensions. However, we can understand in terms of by considering a hypercube or tesseract, which is a theoretical shape in four-dimensional space. Each vertex of the tesseract corresponds to a unique 4-tuple of Boolean values (e.g., 0000, 0001, ..., 1111).
While we can't visualize four dimensions spatially, we can represent using a four-dimensional binary grid, where each point is uniquely identified by its four Boolean coordinates.
Below is the visualization of Boolean Domain in Euclidean Space as collection of points.
Predicates and Quantifiers
A Boolean function takes truth values as inputs. A predicate instead describes objects from a specified domain, and a quantifier ranges over that domain. For the working definitions and negation laws, see Propositions and Axiomatic Systems. For formal syntax, variable scope, substitutions, and quantifier inference rules, continue with Formal Logic and Natural Deduction.
Inference and Deduction
Algebraic simplification preserves a function; inference asks what follows from premises. A useful reading sequence is formal logic and natural deduction, propositional automated reasoning, then first-order resolution and theorem proving. The CNF representation developed here becomes input to resolution and SAT, while Karnaugh maps and Boolean minimization remain part of the algebraic route.
Comments