Chapter 3 LG & BA
Chapter 3 LG & BA
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 1 of 27
Chapter 3: Logic Gates and Boolean algebra
is concerned with the design of digital systems that are suited to the
algorithmic requirements of their particular range of applications.
Digital logic and arithmetic are critical building blocks in constructing
such systems.
An algorithm is a procedure for solving a problem through a series of
finite and specific steps. It can be represented as a set of
mathematical formulas, lists of sequential operations, or any
combination thereof. Each of these finite steps can be represented by
a Boolean logic equation. Boolean logic is a branch of mathematics that
was discovered in the nineteenth century by an English mathematician
named George Boole. The basic theory is that logical relationships can
be modeled by algebraic equations. Rather than using arithmetic
operations such as addition and subtraction, Boolean algebra employs
logical operations including AND, OR, and NOT. Boolean variables have
two enumerated values: true and false, represented numerically as 1
and 0, respectively. The AND operation is mathematically defined as
the product of two Boolean values, denoted A and B for reference.
Truth tables are often used to illustrate logical relationships as shown
for the AND operation in Table 3.1. A truth table provides a direct
mapping between the possible inputs and outputs. A basic AND
operation has two inputs with four possible combinations, because each
input can be 1 or 0 — true or false. Mathematical rules apply to Boolean
algebra, resulting in a non- zero product only when both inputs are 1.
There are three basic logic gates, namely the OR gate, the AND gate
and the NOT gate. Other logic gates that are derived from these
basic gates are the NAND gate, the NOR gate, the EXCLUSIVE- OR Fig. 3-1
gate and the EXCLUSIVE-NOR gate. Except for the exclusive-NOR Switching Circuits and Binary Signals
gate, are all others available in monolithic integrated circuit form. Logic The use of binary variables and the application of binary logic are
gates are the building blocks of digital electronics. Figure 3.0 provides demonstrated by the simple switching circuits of Fig. 3-1. Let the
a description of what each logic gate does and gives a switch and manual switches A and B represent two binary variables with values
transistor analogy for each gate. equal to 0 when the switch is open and 1 when the switch is closed.
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 2 of 27
Chapter 3: Logic Gates and Boolean algebra
Similarly, let the lamp L represent a third binary variable equal to 1 is crossed only during state transitions. The input terminals of digital
when the light is on and 0 when off. For the switches in series, the circuits accept binary signals within the allowable tolerances and
light turns on if A and B are closed. For the switches in parallel, the respond at the out- put terminal with binary signals that fall within the
light turns on if A or B is closed. It is obvious that the two circuits can specified tolerances.
be expressed by means of binary logic with the AND and OR Electronic digital circuits are also called logic circuits because, with
operations, L=A·B L=A+B for the circuit of Fig. 3-1(b) for the the proper input, they establish logical manipulation paths. Any desired
circuit of Fig. 3-1(c) respectively; information for computing or control can be operated upon by passing
Electronic digital circuits are sometimes called switching circuits binary signals through various combinations of logic circuits, each signal
because they behave like a switch, with the active element such as a representing a variable and carrying one bit of information. Logic
transistor either conducting (switch closed) or not conducting (switch circuits that perform the logical operations of AND, OR, and NOT are
open). Instead of changing the switch manually, an electronic switching shown with their symbols in Fig. 3-3.
circuit uses binary signals to control the conduction or non-conduction
state of the active element. Electrical signals such as voltages or
currents exist throughout a digital system in either one of two
recognizable values (except during transition). Voltage-operated
circuits, for example, respond to two separate voltage levels, which
represent a binary variable equal to logic-l or logic-O. For example, a
particular digital system may define logic-l as a signal with a nominal Fig. 3-3 schematic symbols of basic logic gates
value of 3 volts and logic-O as a signal with a nominal value of 0 volt.
four names are widely used, but we shall refer to the circuits as AND, For example, xy = z or xy = Z is read "x AND y is equal to z." The
OR, and NOT gates. The NOT gate is sometimes called an inverter logical operation AND is interpreted to mean that z = 1 if and only if x
circuit since it inverts a binary signal. The input signals x and y in the = 1 and y = 1; otherwise z = O. (Remember that x, y, and z are binary
two-input gates of Fig. 3-3 may exist in one of four possible states: 00, variables and can be equal either to 1 or 0, and nothing else.)
10, 11, or 01. These input signals are shown in Fig. 3-4, together with OR: This operation is represented by a plus sign. For example, x + y = z
the output signals for the AND and OR gates. The timing diagrams in is read "x OR y is equal to z," meaning that z = 1 if x = 1 or if y = 1 or if
Fig. 3-4 illustrate the response of each circuit to each of the four both x = 1 and y = 1. If both x = 0 and y = 0, then z = o.
possible input binary combinations. The reason for the name "inverter" NOT: This operation is represented by a prime (sometimes by a bar).
for the NOT gate is apparent from a comparison of the signal x (input For example, x’ = Z (or x = z) is read "not x is equal to z," meaning that
of inverter) and that of x' (output of inverter), AND and OR gates may z is what x is not. In other words, if x = 1, then z = 0; but if x = 0, then
have more than two inputs, an AND gate with three inputs and an OR z = 1.
gate with four inputs are shown in Fig. 3-3. The three-input AND gate Table 3.1 AND Operation Truth Table
responds with a logic-l output if all three input signals are logic-I. The
output produces a logic-O signal if any input is logic-O. The four-input A B A AND B
OR gate responds with a logic-I when any input is a logic-I. Its output 0 0 0
becomes logic-O if all input signals are logic-O. 0 1 0
1 0 0
The mathematical system of binary logic is better known as Boolean, or
1 1 1
switching, algebra. This algebra is conveniently used to describe the
Summation is represented by the OR operation in Boolean algebra as
operation of complex networks of digital circuits. Designers of digital
shown in Table 1.2. Only one combination of inputs to the OR operation
systems use Boolean algebra to transform circuit diagrams to algebraic
result in a zero sum: 0 + 0 = 0.
expressions and vice versa. We know that, to represent and solve
Table 3.2 OR Operation Truth Table
arithmetic expressions we use arithmetic operators such as +, -, x and
+, similarly, we can use logical operators to represent and solve logical A B A OR B
expressions. 0 0 0
Binary logic consists of binary variables and logical operations. The 0 1 1
variables are designated by letters of the alphabet such as A, B, C, x, 1 0 1
y, Z, etc., with each variable having two and only two distinct possible 1 1 1
values: 1 and O. There are three basic logical operations: AND, OR, and AND and OR are referred to as binary operators, because they require
NOT. two operands. NOT is a Unary, meaning that it requires only one
AND: This operation is represented by a dot or by the absence of an operand. The NOT operator returns the complement of the input: 1
operator.
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 4 of 27
Chapter 3: Logic Gates and Boolean algebra
becomes 0, and 0 becomes 1. When a variable is passed through a NOT In fact, the symbols used for AND and OR are the same as those used
operator, it is said to be inverted. for multiplication and addition. However; binary logic should not be
Boolean variables may not seem too interesting on their own. It is what confused with binary arithmetic. One should realize that an arithmetic
they can be made to represent that leads to useful constructs. A variable designates a number that may consist of many digits. A logic
rather contrived example can be made from the following logical variable is always either a l or a O. For example, in binary arithmetic,
statement: we have 1 + 1 = 10 (read: "one plus one is equal to 2"), whereas in binary
“If today is Saturday or Sunday and it is warm, then put on logic, we have 1 + 1 = 1 (read: "one OR one is equal to one").For each
shorts.” combination of the values of x and y, there is a value of z specified by
Three Boolean inputs can be inferred from this statement: Saturday, the definition of the logical operation. The gate is a digital circuit with
Sunday, and warm. One Boolean output can be inferred: shorts. These one or more input voltages but only one output voltage. By connecting
four variables can be assembled into a single logic equation that the different gates in different ways, we can build circuits that
computes the desired result, perform arithmetic and other functions associated with the human
Shorts = (Saturday OR Sunday) AND warm brain because they simulate mental processes.
While this is a simple example, it is representative of the fact that any The operation 'of logic gate can be easily understood with the help of
logical relationship can be expressed algebraically with products and "truth table". A truth table is a table that shows all the input-output
sums by combining the basic logic functions AND, OR, and NOT. possibilities of a logic circuit; i.e. the truth table indicates the outputs
Several other logic functions are regarded as elemental, even though for different possibilities of the inputs. A truth table is a table of all
they can be broken down into AND, OR, and NOT functions. These are possible combinations of the variables showing the relation between
not–AND (NAND), not–OR (NOR), exclusive–OR (XOR), and exclusive– the values that the variables may take and the result of the operation.
NOR (XNOR). Table 3.3 presents the logical definitions of these other For example, the truth tables for the operations AND and OR with
basic functions. XOR is an interesting function, because it implements a variables x and y are obtained by listing all possible values that the
sum that is distinct from OR by taking into account that 1 + 1 does not variables may have when combined in pairs. The result of the operation
equal 1. As will be seen later, XOR plays a key role in arithmetic for for each combination is then listed in a separate row.
this reason. All binary operators can be chained together to implement a wide
Table 3.3 NAND, NOR, XOR, XNOR Truth Table function of any number of inputs. For example, the truth table for a
A B A NAND B A NOR B A XOR B A XNOR B ten-input AND function would result in a 1 output only when all inputs
0 0 1 1 0 1 are 1. Similarly, the truth table for a seven-input OR function would
0 1 1 0 1 0 result in a 1 output if any of the seven inputs are 1. A four-input XOR,
1 0 1 0 1 0
however, will only result in a 1 output if there are an odd number of
1 1 0 0 0 1
ones at the inputs. This is because of the logical daisy chaining of
Binary logic resembles binary arithmetic, and the operations AND and
multiple binary XOR operations.
OR have some similarities with multiplication and addition, respectively.
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 5 of 27
Chapter 3: Logic Gates and Boolean algebra
As shown in Table 3.3, an even number of 1’s presented to an XOR circuit terminology, the logical operators are called gates.
function cancel each other out. It quickly grows unwieldy to write out . Figure 3.5 shows how the basic logic gates are drawn on a
the names of logical operators. Concise algebraic expressions are circuit diagram. Naming the inputs of each gate A and B and the output
written by using the graphical representations shown in Table 3.4. Note Y is for reference only; any name can be chosen for convenience. A
that each operation has multiple symbolic representations. The choice small bubble is drawn at a gate’s output to indicate a logical inversion.
of representation is a matter of style when hand-written and is
predetermined when programming a computer by the syntactical
requirements of each computer programming language. A common means
of representing the output of a generic logical function is with the
variable Y.
Table 1.4 Symbolic Representations of Standard Boolean Operators
FIGURE 3.5 Graphical representations of basic logic gates.
More complex Boolean functions are created by combining Boolean
operators in the same way that arithmetic operators are combined in
normal mathematics. Parentheses are useful to explicitly convey
precedence information so that there is no ambiguity over how
two variables should be treated. A Boolean function might be written
as
An alternative graphical representation would use a three-input OR [CMOS devices listed in the figures include 74HCxx, 4000(B), while
gate by collapsing the two-input OR gates into a single entity. TTL devices shown include the 74xx, 74Fxx, and 74LS.]
The construction of digital gates is best left to the IC manufacturers.
In fact, making gates from discrete components is highly impractical in
regard to both overall performance (power consumption, speed, drive
capacity, etc.) and overall cost and size. There are a number of
technologies used in the fabrication of digital logic. The two most
popular technologies include TTL (transistor-transistor logic) and
CMOS (complementary MOSFET) logic. TTL incorporates bipolar
transistors into its design, while CMOS incorporates MOSFET
transistors. Both technologies perform the same basic functions, but
certain characteristics (e.g., power consumption, speed, output drive
capacity, etc.) differ. There are many subfamilies within both TTL and
CMOS.
A logic IC, be it TTL or CMOS, typically houses more than one logic
gate (e.g., quad 2-input NAND, hex inverter, etc.). Each of the gates
within the IC shares a common supply voltage that is implemented via
two supply pins, a positive supply pin (+VCC or +VDD) and a ground pin
(GND). The vast majority of TTL and CMOS ICs are designed to run Figure 3.6 typical IC logic families
off a +5-V supply. (This does not apply for all the logic families, but I
will get to that later.)
Generally speaking, input and output voltage levels are assumed to be 0
V (low) and +5 V (high). However, the actual input voltage required and
the actual output voltage provided by the gate is not set in stone. For
example, the 74xx TTL series will recognize a high input from 2.0 to 5
V, a low from 0 to 0.8 V, and will guarantee a high output from 2.4 to 5
V and a low output from 0 to 0.4 V. However, for the CMOS 4000B
series (VCC = +5 V), recognizable input voltages range from 3.3 to 5 V
for high, 0 to 1.7 V for low, while guaranteed high and low output levels
range from 4.9 to 5 V and 0 to 0.1 V, respectively. For now, let’s just
get acquainted with what some of these ICs look like. See Figs. 3.6.
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 7 of 27
Chapter 3: Logic Gates and Boolean algebra
3.4 The universal property of NAND and NOR gates input example. Also, an OR gate can be produced from NOR gates,
as illustrated in Fig.( (3-9)(b). An AND gate can be constructed by the
The NAND Gate as a Universal Logic Element use of NOR gates, as shown in Fig(3-9)(c). In this case the NOR gates
The NAND gate is a universal gate because it can be used to produce G 1 and G 2 are used as inverters, and the final output is derived by the
the NOT, the AND, the OR, and the NOR functions. An inverter can use of DeMorgan's theorem as follows:
be made from a NAND gate by connecting all of the inputs X=(A’+B’)’=AB Fig(3-9)(d) shows how NOR gates are used t0 form a
together and creating, in effect, a single input, as shown in Fig.(6- NAND function.
8)(a) for a 2-input gate. An AND function can be generated by the use
of NAND gates alone, as shown in Fig.(6-8)(b). An OR function can be
produced with only NAND gates, as illustrated in part (c). Finally.
a NOR function is produced as shown in part (d).
Fig 3.9
Exercise
implement the following Boolean function using Basic logic gates and
Fig3.8
repeat using NAND-NAND AND NOR-NOR logic network
The NOR Gate as a Universal Logic Element
A’B 2. AB’ C. A’B+AB’
Like the NAND gate, the NOR gate can be used to produce the NOT,
AND. OR and NAND functions. A NOT circuit, or inverter, can be
made from a NOR gate by connecting all of the inputs together to
effectively create a single input, as shown in Fig.(3-9)(a) with a 2-
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 8 of 27
Chapter 3: Logic Gates and Boolean algebra
Positive and Negative Logic Boolean Algebra, invented by the mathematician George Boole in 1854.
The binary signals at the inputs or outputs of any gate may be one of Boolean Algebra deals with the rules by which logical operations
two values, except during transitions. One signal value represents logic are carried out. In 1854 George Boole introduced a systematic
1, and the other is logic 0. For a positive logic system, the most approach of logic and developed an algebraic system to treat the logic
positive voltage level represents logic 1 state or HIGH level voltage functions, which is now called Boolean algebra. In 1938 C.E. Shannon
level represents logic 1 state. developed a two-valued Boolean algebra called Switching algebra, and
demonstrated that the properties of two-valued or bi-stable electrical
switching circuits can be represented by this algebra. The postulates
formulated by E.V. Huntington in 1904 are employed for the formal
definition of Boolean algebra. However, Huntington postulates are
not unique for defining Boolean algebra and other postulates are
For example, if the voltage levels are –1 volt and –10 volt in a positive also used. The following Huntington postulates are satisfied for
logic system, then –1 volt represents logic 1 and –10 volt represents the definition of Boolean algebra on a set of elements S
logic 0. together with two binary operators (+) and (•).
In a negative logic system, logic 1 state is represented by –10 volt and (a) Closer with respect to the operator (+).
logic 0 is represented by –1 volt. Figure 3.41(a) represents the (b). Closer with respect to the operator (•).
positive logic system choosing the highest voltage level as logic 1 (a) An identity element with respect to (+) is designated by 0 i.e.,
and the lowest voltage level as logic 0. Whereas Figure 3.41(b) A+0 = 0+A = A.
represents the negative logic system assigning the highest voltage level (b) An identity element with respect to (•) is designated by 1 i.e.
as logic 0 and the lowest voltage level as logic 1. A•1= 1•A = A.
(a) Commutative with respect to (+), i.e., A + B = B + A.
3.5 INTRODUCTION TO BOOLEAN ALGEBRA (b) Commutative with respect to (•), i.e., A•B = B•A.
Binary logic deals with variables that have two discrete values—1 for (a) (•) Is distributive over (+), i.e., A •(B+C) = (A•B) + (A•C).
TRUE and 0 for FALSE. A simple switching circuit containing active For every element A ∈ S, there exists an element A' ∈ S (called
elements such as a diode and transistor can demonstrate the binary the complement of A) such that A+ A′ =1 and A • A′ = 0.
logic, which can either be ON (switch closed) or OFF (switch open). There exists at least two elements A,B ∈ S, such that A
Electrical signals such as voltage and current exist in the digital is not equal to B.
system in either one of the two recognized values, except during Comparing Boolean algebra with arithmetic and ordinary algebra
transition. The switching functions can be expressed with Boolean (the field of real numbers), the following differences are
equations. Complex Boolean equations can be simplified by a new observed:
kind of algebra, which is popularly called Switching Algebra or
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 9 of 27
Chapter 3: Logic Gates and Boolean algebra
1. Huntington postulates do not include the associate law. However, The set of elements S, together with the two operators
Boolean algebra follows the law and can be derived from the satisfies six Huntington postulates.
other postulates for both operations. One may formulate many Boolean algebras, depending on the
2. The distributive law of (+) over (•) i.e., A+ (B.C) = (A+B) •(A+C) is choice of elements of set S and the rules of operation. In the
valid for Boolean algebra, but not for ordinary algebra. subsequent chapters, we will only deal with a two-valued Boolean
3. Boolean algebra does not have additive or multiplicative algebra i.e., one with two elements. Two-valued Boolean algebra
inverses, so there are no subtraction or division operations. has the applications in set theory and propositional logic. But
4. Postulate 5 defines an operator called Complement, which is not here, our interest is with the application of Boolean algebra to
available in ordinary algebra. gate-type logic circuits.
5. Ordinary algebra deals with real numbers, which consist of an 3.5.1 TWO-VALUED BOOLEAN ALGEBRA
infinite set of elements. Boolean algebra deals with the as yet Two-valued Boolean algebra is defined on a set of only two
undefined set of elements S, but in the two- valued Boolean elements, S = {0,1}, with rules for two binary operators (+) and (•)
algebra, the set S consists of only two elements—0 and 1. and inversion or complement as shown in the following operator table.
Boolean algebra is very much similar to ordinary algebra in some A B A + B A•B A′ B′
respects. The symbols (+) and (•) are chosen intentionally to facilitate 0 0 0 0 1 1
Boolean algebraic manipulations by persons already familiar to ordinary 0 1 1 0 1 0
algebra. Although one can use some knowledge from ordinary 1 0 1 0 0 1
algebra to deal with Boolean algebra, beginners must be careful not to 1 1 1 1 0 0
substitute the rules of ordinary algebra where they are not The rule for the complement operator is for verification of
applicable. It is important to distinguish between the elements of the postulate 5. These rules are exactly the same for as the logical
set of an algebraic structure and the variables of an algebraic system. OR, AND, and NOT operations, respectively
For example, the elements of the field of real numbers are It can be shown that the Huntington postulates are applicable
numbers, the variables such as X, Y, Z, etc., are the symbols for the set S = {0,1} and the two binary operators defined above.
that stand for real numbers, which are used in ordinary algebra. On Closure is obviously valid, as it is can be observed from truth
the other hand, in the case of Boolean algebra, the elements of a set S tables of AND Operator (•) and OR Operator(+),the result of each
are defined, and the variables A, B, C, etc., are merely symbols operation is either 0 or 1 and 0,1 ∈ S.
that represent the elements. At this point, it is important to From the above table we can see clearly the following facts; In
realize that in order to have Boolean algebra, the following must fact these operations verifies the two identity elements 0 for (+) and 1
be shown. for (•) as defined by postulate 2 above.
The elements of the set S. 0 + 0 = 0 1•1=1
The rules of operation for the two binary operators 0 + 1 = 1 1•0=0
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 10 of 27
Chapter 3: Logic Gates and Boolean algebra
1 + 0 = 1 0•1=0 In ordinary algebra, the letter symbols can take on any number of
1 + 1 = 1 0•0=0 values including infinity. In Boolean algebra, they can take on either of
The commutative laws are confirmed by the symmetry of two values, that is, 0 and 1.
binary operator tables. The values assigned to a variable have a numerical significance in
. The distributive laws of (•) over (+) i.e., A •(B+C)=(A • B) + (A •C), ordinary algebra, whereas in its Boolean counterpart they have a logical
and (+) over (•) i.e., A+(B•C)=(A+B)•(A+C) can be shown to be significance.
applicable with the help of the truth tables considering all the While ‘.’ and ‘+’ are respectively the signs of multiplication and
possible values of A, B, and C.( exercise by yourself this fact). addition in ordinary algebra, in Boolean algebra ‘.’ means an AND
A + A′ = 1, since 0 + 0' = 1 and 1 + 1' = 1. operation and ‘+’ means an OR operation. For instance, A + B in ordinary
A • A′ = 0, since 0 • 0’ = 0 and 1 • 1’ = 0. algebra is read as A plus B, while the same in Boolean algebra is read as
These confirms postulate 5. A OR B. Basic logic operations such as AND, OR and NOT have already
Postulate 6 also satisfies two-valued Boolean algebra that has two been discussed in previous section .
distinct elements 0 and 1 where 0 is not equal to 1. More specifically, Boolean algebra captures the essential properties
3.5 BASIC PROPERTIES AND THEOREMS OF BOOLEAN of both logic operations such as AND, OR and NOT and set operations
ALGEBRA such as intersection, union and complement. As an illustration, the
Boolean algebra is mathematics of logic. It is one of the most basic logical assertion that both a statement and its negation cannot be true
tools available to the logic designer and thus can be effectively used has a counterpart in set theory, which says that the intersection of a
for simplification of complex logic expressions. Other useful and widely subset and its complement is a null (or empty) set.
used techniques based on Boolean theorems include the use of Boolean algebra may also be defined to be a set A supplied with two
Karnaugh maps in what is known as the mapping method of logic binary operations of logical AND, logical OR (V), a unary operation of
simplification and the tabular method given by Quine–McCluskey. In logical NOT and two elements, namely logical FALSE (0) and logical
this chapter, we will have a closer look at the different postulates and TRUE (1).
theorems of Boolean algebra and their applications in minimizing This set is such that, for all elements of this set, the postulates or
Boolean expressions. We will also discuss at length the mapping and axioms relating to the associative, commutative, distributive,
tabular methods of minimizing fairly complex and large logic absorption and complementation properties of these elements hold
expressions. good. These postulates are described in the following pages.
Boolean algebra, quite interestingly, is simpler than ordinary algebra. Variables, Literals and Terms in Boolean Expressions
It is also composed of a set of symbols and a set of rules to manipulate Variables are the different symbols in a Boolean expression. They may
these symbols. However, this is the only similarity between the two. take on the value ‘0’ or ‘1’. For instance, in the first expression shown
The differences are many. These include the following: below, A, B and C are the three variables. In second expression shown
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 11 of 27
Chapter 3: Logic Gates and Boolean algebra
Each occurrence of a variable or its complement is called a literal. In In Boolean algebra, a product term is the product of literals.
the first and second expressions shown above there are eight and A product term is equal to 1 only if each of the literals in the term is 1.
seven literals respectively. A term is the expression formed by literals A product term is equal to 0 when one or more of the literals are 0.
and operations at one level. The above Expression has five terms Some examples of product terms are
including four AND terms and the OR term that combines the first- Example;
level AND terms.
► Boolean Addition Boolean addition is equivalent to the OR
operation and the basic rules are illustrated with their relation to
3.5.1 Principle of Duality
the OR gate as follows:
From Huntington postulates, it is evident that they are grouped in pairs
as (a) and (b) and every algebraic expression deductible from the
postulates of Boolean algebra remains valid if the operators and
In Boolean algebra, a sum term is a sum of literals. Some examples of identity elements are interchanged. The dual of a Boolean expression is
sum terms are: obtained by replacing all ‘.’ operations with ‘+’ operations, all ‘+’
operations with ‘.’ operations, all 0s with 1s and all 1s with 0s and leaving
A sum term is equal to 1 all literals unchanged. The examples below give some Boolean
when one or more of the literals in the term are1. A sum term is equal expressions and the corresponding dual expressions: Given Boolean
to 0 only if each of the literals is 0. expression This important property of Boolean algebra is called
Example; principle of duality.
Solution:
Boolean Multiplication is the equivalent to the AND operation and 3.5.2 DeMorgan’s Theorem
the basic rules are illustrated with their relation to the AND gate as
Two theorems that were proposed by DeMorgan play important
follows: parts in Boolean algebra. The first theorem states that the
complement of a product is equal to the sum of the complements.
That is, if the variables are A and B, then (A•.B)′ = A′ + B′
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 12 of 27
Chapter 3: Logic Gates and Boolean algebra
The second theorem states that the complement of a sum is Absorption A + A.B = A A.(A + B) = A
equal to the product of the complements. In equation form, this can Theorem
be expressed as A+A’B=A+B A.(A’+B)=A.B
(A+ B) ′ = A′ •B′ Theorem Figure 3.6
The complements of Boolean logic function or a logic expression Theorem 1(a): A + A = A
may be simplified or expanded by the following steps of A + A = (A + A).1 by postulate 2
DeMorgan’s theorem. = (A + A). (A + A′) by postulate 5
Replace the operator (+) with (.) And (.) With (+) given in the = A + A.A′
expression. =A+0 by postulate 4
Complement each of the terms or variables in the expression. = A postulate 2
DeMorgan’s theorems are applicable to any number of variables. For (a) Theorem 1(b): A . A = A
three variables A, B, and C, the equations are A. A = (A . A) + 0 by postulate 2(a)
(A.B.C)′ = A′ + B′ + C′ and (A + B + C)′ = A′.B′.C′ = (A . A) + ( A . A′) by postulate 5
3.5.3 Other Important Theorems = A (A + A′) = A . 1 by postulate 4
The following is the complete list of postulates and theorems = A postulate 2(b)
useful for two-valued Boolean algebra. Theorem 2(a): A + 1 = 1 Theorem 2(b): A . 0 = 0
Postulate 2 A+0=A A.1 = A Theorem 3(a): A + A.B = A
Postulate A+1=1 A.0 = 0 A + A.B = A. 1 + A.B by postulate 2(b)
Postulate A + A′ = 1 A.A′ = 0 = A (1 + B) by postulate 4(a)
Postulate A +A =A A.A = A = A. 1 by postulate 2(a)
Theorem 3, (A′)′ = A =Theorem 3(b): A (A + B) = A by duality
Involution Exercise
Theorem A+B=B+A A.B = B.A Write the output expression for each circuit as it appears in Fig.(3- 11)
Commutative and then change each circuit to an equivalent AND-OR configuration.
Associativity A+(B+C)=(A+B)+C A.(B.C) = (A.B).C Develop the truth table for circuit in Fig.(3-11)(a-b).
Theorem
Distributive A(B + C) = A.B + A.C A+B.C= (A+B).(A + C)
Theorem
DeMorgan’s (A + B)′ = A′.B′ (A.B)′ = A′ + B′
Theorem
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 13 of 27
Chapter 3: Logic Gates and Boolean algebra
Show that an exclusive-NOR circuit produces a POS output. AB+A’B’ variables present in the Boolean function or expression. For example, if
a Boolean function is expressed algebraically as F =AB’C then
the value of F will be 1, when A = 1, B = 0, and C = 1.
For other values of A, B, C the value of F is 0.
Boolean functions can also be represented by truth tables. A truth
table is the tabular form of the values of a Boolean function according
to the all possible values of its variables. For an n number of variables,
2n combinations of 1’s and 0’s are listed and one column represents
function values according to the different combinations. For example,
3.6 Boolean functions and simplification methods for three variables the Boolean function F = AB + C truth table
We have studied so far logic gates and Boolean can be written as below in Figure 4.1.
algebra. Boolean algebra and theorems are used for the
manipulations of logical expressions. It has also been seen that a
logical expression can be realized by using the logic gates.
The number of gates required and the number of input terminals
for the implementation of a logical expression, in general, get reduced
considerably if the expression can be simplified. Therefore, the
simplification of logical expression is very important as it saves the
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 14 of 27
Chapter 3: Logic Gates and Boolean algebra
a. Simplification of Boolean expressions using Algebraic method The above expression can be written as
Some of the examples are given here: (XX′+XZ+YX′+YZ)(Y+Z)
i. Simplify the Boolean expression F=XY′Z′+XY′Z′W+XZ′ = (XZ+YX′+YZ) (Y+Z) as XX′=0
The above expression can be written as =XZY+YYX′+YYZ+XZZ+YX′Z+YZZ
XY′Z′ (1+W) +XZ′ =XZY+YX′+YZ+XZ+YX′Z+YZ as YY=Y, ZZ=Z
=XY′Z′+XZ′ as 1+W=1 Rearranging the terms we get
=XZ′ (Y′+1) XZY+XZ+YX′+YX′Z+YZ as YZ+YZ=YZ
=XZ′ as Y′+1=1 =XZ(Y+1) +YX′+YZ (X′+1) as Y+1=1, X′+1=1
ii. Simplify the Boolean expression F=X+X′Y+Y′+(X+Y′) X′Y =XZ+YX′+YZ
The above expression can be written as Now it seems that it cannot be reduced further.
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 15 of 27
Chapter 3: Logic Gates and Boolean algebra
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 16 of 27
Chapter 3: Logic Gates and Boolean algebra
3.6.3 Standard and Canonical Forms (a). using AND-OR network (b). NAND-NAND network:
(i). AB + B (CD + EF)
3.6.3.1 STANDARD FORMS OF BOOLEAN EXPRESSIONS (ii). (A + B) (B + C + D)
(iii). [(A + B)’ + C]’
All Boolean expressions, regardless of their form, can be
Solution: (i). AB + B (CD + EF) ←this expression is not in standard form.
converted into either of two standard forms: the sum-of-products
(Why?)
form or the product-of- sums form. Standardization makes the
In order to write the expression in standard form; remember
evaluation, simplification, and implementation of Boolean expressions
Boolean theorems and postulates we discussed earlier.
much more systematic and easier. A given Boolean function is said to be
Thus it can be rewritten as:
in standard form, if it is expressed in sum of the products or product
AB + B (CD + EF) = AB + BCD + BEF… (Using distributive property)
of the sums fashion.
Now the expression is in standard SOP forms. AB, BCD, & BEF are
For examples expressions, like
Y = AB + BC + AC (SUM-OF-PRODUCT=> SOP Expression)
product terms that can be realized using AND gates. The product terms
are logically summed together using OR logic gate.
Y = (A + B +C) (A+B′ + C) (A + B + C′) (PRODUCT-Of-SUM => POS Expression)
are the standard forms. Then Implementation of the SOP expression; AB + BCD + BEF
However, Boolean functions are also sometimes expressed in
nonstandard forms like F = (AB + CD)(A′B′ + C′D′), which is neither a
sum of products form nor a product of sums form. However, the same
expression can be converted to a standard form with help of
various Boolean properties, as
F = (AB + CD) (A′B′ + C′D′) = A′B′CD + ABC′D′
i. Sum of product (SOP) Expressions. Fig. (3.6) AND-OR logic network Fig. (3.7) NAND-NAND logic network
A sum of products (SOP) expression consists of several product
This NAND-NAND implementation shown above in fig.3.7 is equivalent
terms logically added. A product term is a logical product of several
to the AND-OR in figure 3.6 given above.
variables. The variables may or may not be complemented. The following
are the examples of sum of products expressions.
I will leave it for you the remaining two questions (ii) & (iii) as an
exercise
1. XY+X'Y+XY' 2. AB+ABC+BC'
ii. Product of Sum (POS) Expressions.
3. A+AB'+B'C 4. ABC+A'B+AB'C+A'BC' A product of sums (POS) expression consists of several sum terms
Sometimes a product term may consist of a single variable. logically multiplied. A sum term is the logical addition of several
Example: Convert each of the following Boolean expressions to SOP variables. The variables may or may not be complemented. The following
form and realize its logic circuit are examples of product of sums expressions:
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 17 of 27
Chapter 3: Logic Gates and Boolean algebra
When a logic expression is not in the canonical form, it can be As shown in the above table each minterm is represented by mi
converted into canonical form by using unifying theorem. In the and each maxterm is represented by Mi where ‘i’ is the decimal
canonical form there is uniformity in the expression, which number equivalent of the natural binary number. With these
facilitates minimization procedure. shorthand notations logical functions can be represented as follows:
The following are examples of the canonical form of sum of products a. Y = A’ B' C’ + A’ B’ C + A’ B C + A B C’
expressions (or minterm canonical form):
= 0 0 0 + 0 0 1 + 0 1 1 + 1 1 0 respectively
(i). Z = XY + XY′
(ii). F = XYZ′ + X′YZ + X′YZ′ + XY′Z + XYZ = m0 + m 1 + m 3 + m 6
In case of 2 variables, the maximum possible product terms are 4, for = ∑m (0, 1, 3, 6)
3 variables, the possible product terms are 8, for 4 variables 16, and for n
b. Y = (A+B+C’) ( A+B’+C’) ( A’ + B’ + C)
variables, 2ⁿ. In the above examples the expression (ii) contains 5 out of 8
= (0 01 ) (011) (110) respectively
possible product terms. When the expression is in the canonical form all
terms are mutually exclusive. It means that for a given set of values of the = M1.M3. M6
variables, when one of the terms is equal to 1, all others must be 0. Of course, = π M (1, 3, 6)
it is possible that all terms may be 0.The following are examples of Where ∑ denotes sum of product while π denotes product of sum
canonical form of product of sums expressions (or maxterm canonical
form).
Note that: A=> 1, A’=>0 in SOP But , A=> 0, A’=>1 in POS
(i). Z = (X + Y) (X + Y′)
(ii). F = (X′ + Y + Z′) (X′ + Y + Z) (X′ + Y′ + Z′) i. Canonical Sum of Product Expression.
The following figure gives the minterms and maxterms for a three A product term containing all n variables of the function in
variable logical function where the number of minterms as well as either true or complemented form is called the minterm. Each minterm
maxterms is 2³ = 8. In general, for an n-variable logical function there is obtained by an AND operation of the variables in their true form or
are 2ⁿ minterms and an equal number of maxterms. complemented form. For a two-variable function, four different
combinations are possible, such as, A′B′, A′B, AB′, and AB. These product
terms are called the fundamental products or standard products or
minterms. In the minterm, a variable will possess the value 1 if
it is in true or un complemented form, whereas, it contains the
value 0 if it is in complemented form. For three variables
function, eight minterms are possible as listed in the following
table in Figure 3.9.
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 20 of 27
Chapter 3: Logic Gates and Boolean algebra
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 21 of 27
Chapter 3: Logic Gates and Boolean algebra
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 22 of 27
Chapter 3: Logic Gates and Boolean algebra
Example 3.6. Obtain the canonical product of the sum form of the As explained above, the product of sums (POS) expression
following function. of a Boolean function can also be obtained from its truth table
F (A, B, C) = A + B′C by a similar procedure. Here, an AND operation is performed on the
Solution. In the above three-variable expression, the function is sum terms corresponding to the combinations containing a function
given at sum of the product form. First, the function needs to be value of 0.
changed to product of the sum form by applying the distributive law as In the sum terms the input variables appear either in true (un
shown below. F (A, B, C) = A + B′C = (A + B′) (A + C) Now, in complemented) form if it contains the value 0, or in complemented
the above expression, C is missing from the first term and B is missing form if it possesses the value 1.
from the second term. Hence CC′ is to be added with the first term and Now, consider the same truth table as shown in Figure 3.12, for a
BB′ is to be added with the second term as shown below. three-input function Y.
F (A, B, C) = (A + B′) (A + C) = (A + B′ + CC′) (A + C + BB′)
= (A + B′ + C) (A + B′ + C′) (A + B + C) (A + B′ + C) [using
the distributive property, as X + YZ = (X + Y) (X + Z)]
= (A + B′ + C) (A + B′ + C′) (A + B + C) [as (A + B′ + C) (A + B′ +C)
= A + B′ + C]
Hence the canonical product of the sum expression for the given
function is F (A, B, C) = (A + B′ + C) (A + B′ + C′) (A + B + C).
Example 7:
Convert the following expression into canonical form :(A +B) (B + C) Figure 3.12 deriving a Boolean function as Products -of- Sum form from a truth table
To convert the above expression into canonical form the following Here the output Y value is 0 for the input conditions of 000,
identity can be used: 001, 011, and 111, and their corresponding product terms are A + B +
X + Y = (X + Y + Z) (X + Y + Z′) C, A + B + C′, A + B′ + C′, and A′ + B′ + C′ respectively. So now the final
Applying the above identity, the given logic expression can be written product of sums expression (POS) for the output Y is derived
as by performing an AND operation of the four sum terms as shown
(A + B + C) (A + B + C′) (A + B + C) (A′ + B + C) below.
= (A + B + C) (A + B + C′) (A′ + B + C) Y = (A + B + C) (A + B + C′) (A + B′ + C′) (A′ + B′ + C′)
When a Boolean function is expressed as the logical In general, the procedure of deriving the output expression in POS
product of all the maxterms from the rows of a truth table, for form from a truth table can be summarized as below.
which the value of the function is 0, it is referred to as the 1. Form a sum term for each input combination in the table, containing an output value of 0.
canonical product of sum expression. The same can be expressed 2. Each product term consists of its input variables in either true form or complemented form. If the
in a compact form by listing the corresponding decimal equivalent input variable is 1, it appears in complemented form and if the input variable is 0, it appears
codes of the maxterms containing a function value of 0 in true form.
3. To obtain the final POS expression of the output, all the sum terms are AND operated.
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 23 of 27
Chapter 3: Logic Gates and Boolean algebra
3.7 Simplification of Boolean Expressions using Karnaugh Maps Once all possible groups have been formed, the corresponding terms are
Karnaugh maps provide a systematic method to obtain identified.
simplified sum-of-products (SOPs) Boolean expressions. This is a compact ->A group of two 1's eliminates one variable from the original minterm.
way of representing a truth table and is a technique that is used to simplify ->A group of eight 1's eliminates three variables from the original minterm,
logic expressions. It is ideally suited for four or less variables, becoming and so on.
cumbersome for five or more variables. Each square represents either a ->A group of four 1's eliminates two variables from the original minterm.
minterm or maxterm. ->A group of eight 1's eliminates three variables from the original minterm,
A K-map consists of a grid of squares, each square representing one canonical and so on.
minterm combination of the variables or their inverse. A K-map of ->The variables eliminated are those which are different in the original
n variables will have 2n squares. For a Boolean expression, product minterms of the group.
terms are denoted by 1's, while sum terms are denoted by 0's. The map is In any K-Map, each square represents a minterm. Adjacent squares always
arranged so that squares representing minterms which differ by only one differ by just one literal (So that the unifying theorem may apply: X + X' = 1).
variable are adjacent both vertically and horizontally. Therefore XY'Z' would For the 2-variable case (e.g.: variables X, Y), the map can be drawn as in Figure
be adjacent to X'Y'Z' and would also adjacent to XY'Z and XYZ'. 3.14 (a). Two variable map is the one which has got only two variables as input.
Minimization Technique
• Based on the Unifying Theorem: X + X' = 1
• The expression to be minimized should generally be in sum-of-products form
(If necessary, the conversion process is applied to create the sum-of-products
form).
• The function is mapped onto the K-map by marking a 1 in
those squares corresponding to the terms in the expression to be simplified
(The other squares may be filled with 0's).
• Pairs of 1's on the map which are adjacent are combined using
the theorem Y(X+X') = Y where Y is any Boolean expression (If two pairs are
also adjacent, then these can also be combined using the same theorem).
The minimization procedure consists of recognizing those pairs and multiple Equivalent Labeling
pairs K-map need not follow the ordering as shown in the Figure 3.14 (a). What this
->These are circled indicating reduced terms. means is that we can change the positions of m0, m1, m2, m3 of the above
o Groups which can be circled are those which have two (21) 1's, four (22) 1's, figure as shown in the Figure 3.14 (b) and Figure 3.14 (c).Position assignment is
and eight (23) 1's. the same as the default k-map positions. This is the one which we will be using
->Note that because squares on one edge of the map are considered adjacent throughout this unit.
to those on the opposite edge, group can be formed with these squares. The K-map for a function is specified by putting a '1' in the square
->Groups are allowed to overlap. corresponding to a minterm, a '0' otherwise.
The objective is to cover all the 1's on the map in the fewest number of groups Grouping/Circling K-maps
and to create the largest groups to do this.
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 25 of 27
Chapter 3: Logic Gates and Boolean algebra
The power of K-maps is in minimizing the terms, K-maps can be minimized with Example - X'Y+XY+XY'
the help of grouping the terms to form single terms as shown in Figure 3.15 In this example we have the equation as input, and we have one output
(d). When forming groups of squares, observe/consider the following: function. Draw the k-map for function F with marking 1 for X'Y, XY and XY
• Every square containing 1 must be considered at least once. positions. Now combine two 1's as shown in Figure 2.2.4(g) to form two single
• A square containing 1 can be included in as many groups as desired terms.
A group must be as large as possible. F=X+Y
Figure 2.2.4(g)
There are 8 minterms for 3 variables (X, Y, Z). Therefore, there are 8 cells in
a 3-variable K-map. One important thing to note is that K-maps follow the gray
Figure 3.15 code sequence, not the binary one. Using gray code arrangement ensures that
• If a square that is containing 1 which cannot be placed in a group, then leave minterms of adjacent cells differ by only one literal. Each cell in a 3-variable
it out to include in final expression. K-map has 3 adjacent neighbours. In general, each cell in an n- variable K-map
• The number of squares in a group must be equal to 2(pair), 4(quad), 8(octet). has n adjacent neighbours as shown in Figure 2.2.4(h)
The map is considered to be folded or spherical; therefore squares at the end
of a row or column are treated as adjacent squares.
The simplified logic expression obtained from a K-map is not always
unique. Groupings can be made in different ways as shown in Figure 3.15 (e).
Before drawing a K-map the logic expression must be in canonical form.
In the next few pages we will see some examples of grouping. Figure 2.2.4 (h) (i)
There is wrap-around in the K-map
• X'Y'Z' (m0) is adjacent to X'YZ' (m2) XY'Z' (m4) is adjacent to XYZ' (m6)
Example - F= X'Y+XY
as shown in Figure 2.2.4(i)
In this example we have the equation as input, and we have one output
Example draw a k-map for the Boolean function given as ;
function. Draw the k-map for function F with marking 1 for X'Y and XY
F = XYZ'+XYZ+X'YZ
positions. Now combine two 1's as shown in Figure 2.2.4 (f) to form the single
term. As you can see X and X' get canceled and only Y remains F = Y
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 26 of 27
Chapter 3: Logic Gates and Boolean algebra
A s it can be viewed from the k-map group one is formed by X’YZ (m3) and Example F (W, X, Y, Z) = ∑ (4, 5, 10, 11, 14, 15)
XYZ (m7) eliminating common term redundant term after writing the term as
YZ(X’+X) gives YZ. F = W'XY' + WY
Similarly group 2 is formed by XYZ’ (m6) and XYZ (m7) can be rewritten as
XY. Combining the simplified terms as SOP expression it can be written as F
= XY + YZ. Note that a given cell can be taken twice as m7 is included in both
groups. Both groups contains a 21 ones so each formed group is capable of
reducing 1 variable from the original expression.
Example F(X, Y, Z) =∑ (1, 3, 4, 5, 6, 7) Don’t Care Condition:
In some digital systems, certain input conditions never occur during normal
operations; therefore the corresponding output never appears. Since the
output does not appear it is indicated by an X in the truth table. X is called
don’t care condition. So don’t cares can be treated either as 0’s or as 1’s; such
F=X+Z that it is more convenient in the process of k-map simplification.
Consider the following truth table in which the output is low for all input
There are 16 cells in a 4-variable (W, X, Y, Z) K-map as shown in the Figure entries from 1001 and ‘X’ from 1010 through 1111. The don’t care conditions
2.2.4 (j). are denoted by ’X’.
There are 2 wrap-around: a horizontal wrap-around and a vertical wrap-around. Commented [R1]:
Every cell thus has 4 neighbors. For example, the cell Here three don’t cares are treated as 1’s to get a quad which
corresponding to minterm m0 has neighbor’s m1, m2, m4 and m8 as shown eliminates two variables. The remaining don’t care are treated as 0’s.
in Figure 2.2.4(k). Steps to be followed to apply don’t care conditions:
Example F (W, X, Y, Z) = ∑ (1, 5, 12, 13) 1. For the given truth table, draw a K-map with 0’s, 1’s and don’t cares.
2. Encircle the actual 1’s on the K-map in the largest groups, by treating the
F=WXY'+W'Y'Z don’t cares as 1’s.
3. After the actual 1’s have been included in groups discard the remaining don’t
cares visualizing them as 0’s.
Digital Logic Design Lecture Notes Compiled by: Eyosiyas A A/Year: 2022 Page 27 of 27