0% found this document useful (0 votes)
10 views11 pages

Boolean Algebra Fundamentals Guide

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views11 pages

Boolean Algebra Fundamentals Guide

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

National Higher School of Technology and Engineering Annaba

Department of preparatory classes Computer Science 1 Course


Chapitre 3 : Algèbre de Boole

Chapter 3: Boolean Algebra

Chapter Objective: This chapter presents the main techniques for understanding Boolean
algebra and the Karnaugh method.

Dr Lachtar 1
National Higher School of Technology and Engineering Annaba
Department of preparatory classes Computer Science 1 Course
Chapitre 3 : Algèbre de Boole

1. Introduction :

Boolean algebra, or Boolean calculus, is a branch of mathematics, logic, and electronics that deals with operations
and functions on logical variables. More specifically, Boolean algebra allows the use of algebraic techniques to
manipulate expressions with two truth values in propositional calculus. It was initiated by the British
mathematician George Boole (1815-1864) in the mid-19th century. Boolean algebra is an algebra that aims to
translate signals into mathematical expressions. To achieve this, each elementary signal is defined using logical
variables, and their manipulation is done through logical functions. Methods such as truth tables are used to define
the desired operations and to transcribe the result into an algebraic expression. By applying rules known as laws
of composition, these expressions can be simplified. This simplification allows for the representation of a logical
circuit using symbols, which means representing the arrangement of basic components at a logical level, without
concerning the physical realization using transistors. Today, Boolean algebra finds numerous applications in
computer science and in the design of electronic circuits. It was first used for switching circuits in telephony by
Claude Shannon. A processor is composed of transistors that perform functions on digital signals. These
transistors, when assembled, form components that can carry out very basic functions. By combining these
components, it becomes possible to create circuits that perform highly complex operations. Boolean algebra for
logical functions allows for modeling logical reasoning by expressing a "state" in terms of conditions.

2. Logical Variables and Functions


2.1. Logical Variable:
A computer operates with binary data, so a logical variable is referred to as binary data, meaning data that can
exist in two possible states: 0 (false) or 1 (true). Electronic signals can have a voltage value of approximately 5
Volts (as a general magnitude), which is represented as 1, or 0 Volts, represented as 0. Example 1: Consider two
logical variables: Transmitter: Active (on) = 1 (true) Inactive (off) = 0 (false) Receiver: Active (on) = 1 (true)
Inactive (off) = 0 (false).

A logical (Boolean) variable is a variable that can take on the values 0 or 1. Typically, it is represented by a single
uppercase alphabetical character (A, B, S, ...).

Logical Level: When studying a logical system, it is important to specify the level of work.

Level Positive Logic Negative Logic

High H 1 0

Low L 0 1

2.2. Logical Functions

A logical function is an entity that accepts multiple logical values as inputs and has one or more possible outputs,
each of which can be in one of two states: 0 or 1. In reality, these functions are electronic components that take
electrical signals as input and produce an output signal.

The basic logical functions are known as logic gates:

• The OR function sets its output to 1 if either of its inputs is 1.


• The AND function sets its output to 1 if both of its inputs are 1.
• The XOR (Exclusive OR) function sets its output to 1 if either of its inputs is 1, but not both
simultaneously.
• The NOT function (also called an inverter) sets its output to 1 if its input is 0, and vice versa.

Dr Lachtar 2
National Higher School of Technology and Engineering Annaba
Department of preparatory classes Computer Science 1 Course
Chapitre 3 : Algèbre de Boole
The NOR (NOT OR) and NAND (NOT AND) functions are generally defined as the respective compositions of
a NOT gate with an OR gate and an AND gate.

Example:

Communication = Transmitter AND Receiver (C = T AND R)

C = 1 (communication established) 0 (communication not established)

T = 1 (transmitter active) 0 (transmitter inactive)

R = 1 (receiver active) 0 (receiver inactive)

Communication is "TRUE" if both the Transmitter and Receiver are active (it is a logical function dependent on
the Transmitter and Receiver variables).

Pick up the phone = (Decision to answer AND Ringing) OR Decision to call (P = (A AND R) OR C)

Picking up the phone is "TRUE" if you hear the phone ringing and decide to answer it OR if you decide to make
a call.

Note: If a logical function has N logical variables, there are 2 N possible combinations, and the function has 2 N
values. These values can be represented by a Truth Table (TT).

2.3. Truth Table


A truth table is a table used to describe all possible output combinations based on input variables. Input variables
are placed in the left columns, varying them in a way that covers all possibilities. The right column (or columns,
if the function has multiple outputs) describes the output. Here are truth tables for some basic logic gates:
Gate Name Inputs Output
A B S
0 0 0
0 1 1
OR (OU)
1 0 1
1 1 1
0 0 0
0 1 0
AND (ET)
1 0 0
1 1 1
0 0 1
0 1 0
NOR (NON OU)
1 0 0
1 1 0
0 0 1
0 1 1
NAND( NON ET)
1 0 1
1 1 0
0 0 0
0 1 1
XOR
1 0 1
1 1 0
0 1
NOT (NON)
1 0

Dr Lachtar 3
National Higher School of Technology and Engineering Annaba
Department of preparatory classes Computer Science 1 Course
Chapitre 3 : Algèbre de Boole
Order of Operator Precedence (Operator Priority)
To evaluate a logical expression (logical function):
• Begin by evaluating sub-expressions inside parentheses.
• Then, evaluate the complement (NOT).
• Next, evaluate the logical product (AND).
• Finally, evaluate the logical sum (OR).

For example 2:
The truth table (TV) for the function P is as follows:

A R C P
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 0
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1

The algebraic expression associated with this truth table is

𝑃 = 𝐴. 𝑅. 𝐶. +𝐴. 𝑅. 𝐶̅ + 𝐴. 𝑅̅ . 𝐶 + 𝐴.
̅ 𝑅. 𝐶 + 𝐴̅. 𝑅̅ . 𝐶

2.4. Logical Circuits


2.4.1. Representation of Logic Gates

The conventional representation of logic gates is as follows:

Dr Lachtar 4
National Higher School of Technology and Engineering Annaba
Department of preparatory classes Computer Science 1 Course
Chapitre 3 : Algèbre de Boole
2.4.2. Creation of logic circuits (logic diagram)

A logical circuit (or combinational circuit) is a set of logic gates connected together to implement an algebraic
expression. It involves translating the simplified algebraic expression into an electrical diagram using the
representations mentioned above. For example, the algebraic expression:

S = (A + B) · (A + ¬C)

Will be schematically represented as follows:

2.5. Conclusion

Boolean algebra is a common field shared by three disciplines, which is why different notations are encountered
for denoting the same object. Boolean algebra is composed of:

1. A set E,
2. Two specific elements of E: 0 and 1 (corresponding to FALSE and TRUE, respectively),
3. Two binary operations on E: + (disjunction) and · (conjunction) (corresponding to logical OR and AND,
respectively),
4. A unary operation on E: ¬ (bar, corresponding to logical negation).

A logical function can be represented by an algebraic expression or by its truth table (mathematical modeling) or
by a logic circuit (electronic implementation).

3. Fundamental Laws of Boolean Algebra (Composition Laws)

Composition laws are logical rules that simplify the writing of algebraic expressions.
Associativity: (A · B) · C is equivalent to A · (B · C)
(A + B) + C is equivalent to A + (B + C)
Absorption: A · (A + B) is equivalent to A
A + A · B is equivalent to A

Commutativity: A · B is equivalent to B · A
A + B is equivalent to B + A

Distributivity: A + (B · C) is equivalent to (A + B) ·(A + C)


A · (B + C) is equivalent to A · B + A · C

Idempotence: A · A is equivalent to A A + A is equivalent to A

Identity: 1 · A is equivalent to A
0 + A is equivalent to A

Inversion: A · A̅ is equivalent to 0
A + A̅ is equivalent to 1

Dr Lachtar 5
National Higher School of Technology and Engineering Annaba
Department of preparatory classes Computer Science 1 Course
Chapitre 3 : Algèbre de Boole
Nullity: 0 · A is equivalent to 0
1 + A is equivalent to 1

De Morgan's Theorem:
• is equivalent to
• is equivalent to

Example of expression: simplification: Consider the following simplification:

̅ 𝑩𝑪 + 𝑨𝑩𝑪 + 𝑨𝑩
𝑨 ̅𝑪̅ + 𝑨𝑩
̅𝑪

̅ )(𝑩𝑪) + (𝑪 + 𝑪
(𝑨 + 𝑨 ̅ )(𝑨𝑩
̅)

̅
𝑩𝑪 + 𝑨𝑩

4. Properties of Logical Functions


4.1. Textual Definition of a Logical Function: This involves defining the mathematical model (the logical
function) based on a textual description corresponding to the system's operation.

For example:

Consider a high-security lock that opens based on three keys. The operation of the lock is defined as follows:
• The lock is opened if at least two keys are used.
• The lock remains closed in all other cases.
The system has three inputs, where each input represents a key. We will assign a logical variable to each key: Key
1 to A, Key 2 to B, and Key 3 to C.
• If Key 1 is used, then variable A = 1, otherwise A = 0.
• If Key 2 is used, then variable B = 1, otherwise B = 0.
• If Key 3 is used, then variable C = 1, otherwise C = 0.
The system has a single output, representing the state of the lock (open or closed). We will assign a variable S to
denote the output:
• S = 1 if the lock is open.
• S = 0 if the lock is closed.
The function can be expressed as: S = F(A, B, C) F(A, B, C) = 1 if at least two keys are used. F(A, B, C) = 0
otherwise.

Note: It is important to specify the logical level with which one is working (positive or negative logic).

4.2. Canonical Forms of Logical Functions: There is an equivalence/transition between a logical expression
and the truth table of the function. One can always determine one from the other. Two logical functions are
identical if it can be shown through the properties of Boolean algebra that their logical expressions are
identical or if their truth tables are identical.

Note 1: When referring to a logical function, it is often discussed in the context of the corresponding logical
expression. For a logical function with x variables:

• A minterm is a group of x variables linked by AND.


• A maxterm is a group of x variables linked by OR.

Canonical forms of a logical function: the most commonly used are:


1. First form (disjunctive form): union (OR) of minterms (sum of products). It is a disjunction of
conjunctions. Example: F(A, B, C) = A·B·C + A·B̅·C + A̅·B̅·C̅
Example :
F(A,B,C) = A.B.C + A.𝐵̅ .C +𝐴̿𝐵̅𝐶̅

Dr Lachtar 6
National Higher School of Technology and Engineering Annaba
Department of preparatory classes Computer Science 1 Course
Chapitre 3 : Algèbre de Boole
2. Second form (conjunctive form): intersection (AND) of maxterms (product of sums). It is a conjunction
of disjunctions.
Example: F(A, B, C) = (A+B+C)·(A+B̅+C)

Note 2: The first and second canonical forms are equivalent. Any logical function can be converted to one of the
canonical forms. This involves adding missing variables to terms that do not contain all the variables (non-
canonical terms). This can be done using the rules of Boolean algebra:
• Multiplying a term with an expression that equals 1.
• Adding to a term with an expression that equals 0.
• Then, distribute as necessary.

Example of Conversion to the First Canonical Form


Let's consider the function:
F(A,B,C)=A.B+𝐵̅ . 𝐶 + 𝐴. 𝐶̅

First minterm: A·B. The variable C is missing.


Transform A·B into A·B·(C + C̅) because C + C̅ = 1.
Do the same for the other two minterms:
F(A, B, C) = A·B·(C + C̅) + B̅·C·(A + A̅) + A·C̅·(B + B̅)
= A·B·C + A·B·C̅ + A·B̅·C + A̅·B̅·C + A·B·C̅ + A·B̅·C̅

Conversion from the Truth Table to the Logical Function


From the truth table, the function is under: First canonical form:
• For each value of F(X) equal to 1, define a minterm of all variables. If a variable Xi = 1, write Xi;
otherwise, write X̅i. The first canonical form of F(X) is the OR of these minterms.
Second canonical form:
• For each value of F(X) equal to 0, define a maxterm of all variables. If a variable Xi = 0, write Xi;
otherwise, write X̅i. The AND of these maxterms is F(X).

Example: F(A, B, C) = A·B + B̅·C + A·C̅


The truth table is as follows:

A B C 𝐵̅ 𝐶̅ AB 𝐵̅ 𝐶 𝐴𝐶̅ F
0 0 0 1 1 0 0 0 0
0 0 1 1 0 0 1 0 1
0 1 0 0 1 0 0 0 0
0 1 1 0 0 0 0 0 0
1 0 0 1 1 0 0 1 1
1 0 1 1 0 0 1 0 1
1 1 0 0 1 1 0 1 1
1 1 1 0 0 1 0 0 1

First Canonical Form: F(A, B, C) = 1 when:


• A = 0, B = 0, C = 1, leading to the minterm A̅B̅C
• A = 1, B = 0, C = 0, leading to the minterm AB̅C̅
• A = 1, B = 0, C = 1, leading to the minterm AB̅C
• A = 1, B = 1, C = 0, leading to the minterm ABC̅
• A = 1, B = 1, C = 1, leading to the minterm ABC
So, F(A, B, C) = A̅B̅C + AB̅C̅ + AB̅C + ABC̅ + ABC

Second Canonical Form: F(A, B, C) = 0 when:

• A = 0, B = 0, C = 0, leading to the maxterm A + B + C


• A = 0, B = 1, C = 0, leading to the maxterm A + B̅ + C
• A = 0, B = 1, C = 1, leading to the maxterm A + B̅ + C̅

Dr Lachtar 7
National Higher School of Technology and Engineering Annaba
Department of preparatory classes Computer Science 1 Course
Chapitre 3 : Algèbre de Boole
So, take the AND of these maxterms: (A + B + C)(A + B̅ + C)(A + B̅ + C̅).

F(A, B, C) = 0 when:
• A = 0, B = 0, C = 0, leading to the maxterm A + B + C
• A = 0, B = 1, C = 0, leading to the maxterm A + B̅ + C
• A = 0, B = 1, C = 1, leading to the maxterm A + B̅ + C̅
So, take the AND of these maxterms: (A + B + C)(A + B̅ + C)(A + B̅ + C̅).

Second Canonical Form: F(A, B, C) = 0 when:


• A = 0, B = 0, C = 0, leading to the maxterm A + B + C
• A = 0, B = 1, C = 0, leading to the maxterm A + B̅ + C
• A = 0, B = 1, C = 1, leading to the maxterm A + B̅ + C̅
So, take the AND of these maxterms: (A + B + C)(A + B̅ + C)(A + B̅ + C̅).

4.3. Simplification of Boolean Expressions

Canonical forms of a logical function provide a correct definition of the function, but they can be simplified,
meaning that the same function can be expressed with fewer and simpler terms (fewer logical variables). This
simplification is important for implementing the function with fewer electronic components (logic gates).

There are two methods for simplifying the expression of a logical function:

1. Using the properties of Boolean algebra (algebraic method).


2. Using the Karnaugh map method.

2.1.1. Algebraic Method

The principle is to apply the rules of Boolean algebra to eliminate variables or terms. However, there is no
specific step-by-step procedure. Here are some commonly used rules:

A.B+ A.B= B
A + A.B= A
A + A.B= A + B
( A + B) ( A + B) = A
A . ( A + B) = A
A . (A + B) = A . B
Term grouping
Example:

ABC + AB C + A BCD = AB (C + C) + A BCD


= AB + A BCD
= A ( B + B (CD))
= A ( B + CD)
= AB + ACD
Add an already existing term to an expression
Example :
A B C + ABC + A BC + ABC =
ABC + ABC + ABC + A BC + ABC + ABC =
BC + AC + AB
Dr Lachtar 8
National Higher School of Technology and Engineering Annaba
Department of preparatory classes Computer Science 1 Course
Chapitre 3 : Algèbre de Boole

It is possible to delete a superfluous term (an additional term), that is to say already included in the
combination of other terms
Example:
F(A, B, C) = A B + BC + AC = AB + BC + AC ( B + B)
= AB + BC + ACB + A BC
= AB ( 1 + C) + BC (1 + A)
= AB + BC

4.3.1. Karnaugh Table Method


The Karnaugh diagram is a graphical tool that allows you to simplify a logical equation.

General principles
• Representation in a particular form of the truth table of a logical function
• Determination of rectangular blocks of size 2 n(1, 2, 4, 8...) bits adjacent to 1
• Deduction of the simplified function associated with the truth table.

Two terms are said to be adjacent if they have the same variables, the only difference is the state of a variable
which changes.
Example: A.B +A.𝐵̅ . These two minterms are said to be adjacent, the simplification of the expression eliminates
the variable B (the one which changes state) to retain only A.

We represent a 2-dimensional array


• Each dimension concerns one or 2 variables.
• Moving from a column to an adjacent column or from a row to an adjacent row changes the value of a
single variable.
• The table closes on itself: the leftmost column is next to the rightmost column, the same goes for the top
and bottom rows.
• For the 2 extreme columns (2 rows), again, only one variable must change value between these 2 columns
(rows)
• A box in the table contains a Boolean value, determined from the truth table and the values of the variables

The transition from the truth table to the Karnaugh table is done as follows:
• For each combination which represents a mintermes there is a corresponding box in the table which must
be set to 1.
• For each combination which represents a maxterm there is a corresponding box in the table which must
be set to 0.
• When we fill in the table, we must either take the minterms or the maxterms

Principles of simplification:
• Grouping of adjacent 1 bits into rectangular blocks
• All 1 bits in the table must be encompassed in at least one block (a block with a size of 1, 2, 4, 8 ... bits)
• A bit at 1 can belong to several block
• We must create the largest blocks possible
• Each block corresponds to a term formed as follows:
o For the block, if a variable takes the value 0 and 1, we do not take it into accoun
o We only keep the variables which do not vary. If a variable A remains at 1: we note A, if it
remains at 0: we note 𝐴̅
• The logical term of the block corresponds to the AND of these variables which do not change
• The simplified logical function is the OR of all the terms of the blocks found

Example: table with two variables:

Dr Lachtar 9
National Higher School of Technology and Engineering Annaba
Department of preparatory classes Computer Science 1 Course
Chapitre 3 : Algèbre de Boole

We have 2 groups of two adjacent bits


For the vertical group (A does not change and always at 1) so we have the term A
For the horizontal group (B does not change and always at 1) so we have the term B
F= A+B

Example: table with 3 variables:

This simplification gives F =𝐴̅𝐵̅𝐶 + A

This simplification is not final because the table closes on itself

AB 00 01 11 10
C

0 0 0 11 11

1 1 0 11 11

𝐵̅𝐶 A
The final simplification gives F = A + 𝐵̅ 𝐶

Dr Lachtar 10
National Higher School of Technology and Engineering Annaba
Department of preparatory classes Computer Science 1 Course
Chapitre 3 : Algèbre de Boole
Example: table with 4 variables:

Case of a function not completely defined


Let's look at the following example:
A security lock opens using four keys A, B, C D. The operation of the lock is defined as follows
S(A,B,C,D)= 1 if at least two keys are used
S(A,B,C,D)= 0 Otherwise

Keys A and D cannot be used at the same time.


Note that if key A and D are used at the same time the state of the system is not determined.
These cases are called impossible or forbidden cases. How to represent these cases in the truth table?
For impossible or prohibited cases, you must put an X in the Truth Table and the Karnaugh table
The simplification rules for these cases are to use the X in groupings with 1 by taking them for 1 or in groupings
with 0 by taking them for 0 but you should not take groupings formed only of X.

The previous example gives us

Dr Lachtar 11

Common questions

Powered by AI

In Boolean functions, truth tables and algebraic expressions are equivalent representations. Truth tables list all possible combinations of input values and their corresponding outputs, while algebraic expressions use logical variables and operators to define the output for those combinations. A truth table can be translated into an algebraic expression by creating an OR of minterms corresponding to output values of 1. Conversely, an algebraic expression can be expanded into a truth table by defining outputs for all input combinations .

The Karnaugh map simplifies Boolean expressions by organizing truth table outputs in a grid format, allowing easy identification and grouping of adjacent bits set to 1. Simplification involves: 1) Arranging bits such that movement between adjacent squares alters only one variable; 2) Grouping all '1' bits into rectangular blocks containing 2^n bits, ensuring each bit is included in at least one group; 3) Formulating logical terms from these blocks by maintaining variables that remain constant. The final simplified function is the OR of these group terms .

Converting Boolean functions into canonical forms aids in systematic analysis and implementation by standardizing expressions. The primary benefits are: facilitation of direct comparison between different Boolean functions for equivalency, provision of a structured approach to simplify expressions, and enabling easy conversion between algebraic expressions and truth tables. Canonical forms, either as a disjunctive (sum of products) or conjunctive (product of sums), ease implementation by showing all potential logical states, thus aiding in error checking and simplifying circuit design .

The principles of associativity and absorption help reduce complexity by enabling expression reformation and term elimination. Associativity allows re-grouping parentheses in expressions to simplify calculations without changing their outcomes. Absorption removes redundant terms, significantly reducing the number of elements in an expression by collapsing functions; for example, A + A·B simplifies to just A. These tools streamline the process of simplifying logic in digital systems, minimizing the logic gates needed for circuit implementation and thus cutting costs and space requirements .

Logical circuits, particularly combinational circuits, serve as physical embodiments of Boolean algebra expressions. They translate algebraic expressions into tangible components by linking logic gates based on the expression's structure. Boolean algebra dictates the gates' arrangements and operations (AND, OR, NOT) that the circuit performs, directly reflecting the mathematical model in an executable format. This relationship underscores the operational equivalency where each logical expression is mapped to a circuit, ensuring a direct correlation between algebra and its electronic execution .

Boolean algebra models logical reasoning by representing truth values as binary states, allowing the combination of these values through logical operators to simulate reasoning processes. This modeling extends to creating structures that mimic conditions and conclusions in logical statements. Boolean logic can express simple 'if-then' scenarios, model decision-making trees, and simulate complex algorithms by defining conditions and operations through logical relationships. The algebra's capability to represent binary conditions aligns perfectly with computational processes, facilitating the design of both hardware and software logic .

Boolean algebra is crucial in digital circuit design because it allows for the mathematical representation and manipulation of logical signals. It simplifies the design of switching circuits, enabling efficient modeling through algebraic expressions, truth tables, and logic gates. Boolean algebra serves as the foundation for creating complex digital circuits by providing methods to manipulate binary values and logic operations such as AND, OR, and NOT .

Commutativity and distributivity laws assist in simplifying Boolean expressions by allowing terms to be rearranged and regrouped without altering the expression's value. Commutativity permits swapping operands in expressions, making it flexible for rearrangement. Distributivity enables factoring and expanding expressions, allowing for the reduction or expansion into simpler terms. These laws streamline circuit design by minimizing and optimizing the logic gate configuration needed to perform given functions, thus reducing the complexity and cost of hardware implementations .

De Morgan's Theorem is instrumental in simplifying Boolean expressions through its ability to transform AND operations to OR operations and vice versa, involving negations. According to this theorem, the complement of a conjunction is equivalent to the disjunction of the complements, and vice versa. This is particularly useful in optimizing logical circuits by simplifying complex logic expressions and aiding in the transformation of logic gates configurations to achieve the desired outcomes with minimal resources .

The levels of logical variables—positive and negative logic—affect electronic interpretation by defining voltage representations for binary states. In positive logic, a high voltage level represents logic '1' and a low level represents '0', while in negative logic, these associations are inverted. This distinction impacts how circuits are designed and signals interpreted, necessitating specific circuit configurations and logic gate orientations to match the intended logic level. Understanding these implications is crucial in ensuring correct functionality and interoperability of electronic components .

You might also like