0% found this document useful (0 votes)
19 views

2-Boolean Algebra and Digital Logic Gates

Uploaded by

Abdella Siraje
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)
19 views

2-Boolean Algebra and Digital Logic Gates

Uploaded by

Abdella Siraje
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
You are on page 1/ 31

Boolean Algebra and Digital Logic

Gates

➢Logic Operations

➢Boolean Algebra

➢Universality of NOR and NAND gates

➢Standard Representations

➢Karnaugh Maps

1
Introduction

➢Boolean algebra is the mathematics of digital systems


for expressing the relationship between a logic circuit’s
inputs and outputs using Boolean variable.
➢A Boolean variable is a symbol that represents digital
quantity that may, at different times, be equal to either
0 or 1.
➢In Boolean algebra there are only three basic logic
operations: OR, AND, and NOT.
➢ Digital circuits called logic gates that have 1 or more
inputs and only a single output can be constructed from
diodes, transistors, and resistors connected so that the
circuit output is the result of a basic logic operation
(OR,AND, NOT) performed on the inputs.
➢Boolean variables are actually represent the voltage
level (logic level) present on a wire or at the
input/output terminals of a circuit.
➢A truth table is a means for describing how a logic
circuit’s output depends on the logic levels present at
the circuit’s inputs. The table lists combinations of logic
levels present at inputs A and B, along with the
corresponding output level x..

2
Logic Operations
1. NOT operation
• The NOT operation is performed on a single input
variable. For example, if the variable A is subjected to
the NOT operation, the result x can be expressed as
𝑥 = 𝐴ҧ
where the overbar represents the NOT operation.
• NOT logic circuit, which is more commonly called an
INVERTER always has only a single input, and its output
logic level is always opposite to the logic level of this
input.
• It inverts (complements) the input signal at all points on
the waveform so that whenever the input = ? 0, output
= 1, and vice versa.

Fig 1. Truth table (a) NOT gate (b) Wave forms ©

3
Logic Operations
2. AND operation
• The Boolean expression for the AND operation is
𝑥 = 𝐴. 𝐵
• In this expression, the . sign stands for the Boolean AND
operation and not the multiplication operation.
However, the AND operation on Boolean variables
operates the same as ordinary multiplication.
• The AND gate output is equal to the AND product of the
logic inputs. In other words, the AND gate is a circuit
that operates so that its output is HIGH only when all its
inputs are HIGH. For all other cases, the AND gate
output is LOW.
• This same operation is characteristic of AND gates with
more than two inputs.

Fig 2. Truth table (a) AND gate (b)

4
Logic Operations
3. OR operation
• The Boolean expression for the OR operation is
𝑥 =𝐴+𝐵
• In this expression, the + sign does not stand for
ordinary addition; it stands for the OR operation.
• The OR operation is similar to ordinary addition except
for the case where A and B are both 1; the OR
operation produces 1 + 1 = 1, not 1 + 1 = 2.
• The same holds true for combining three or more
inputs using the OR operation.
• An OR gate is a circuit that has two or more inputs and
whose output is equal to the OR combination of the
inputs.
• The OR gate operates so that its output is HIGH (logic 1)
if either input A or B or both are at a logic 1 level.
• The OR gate output will be LOW (logic 0) only if all its
inputs are at logic 0. This same idea can be extended to
more than two inputs.

Fig 3. OR gate (a) Truth table (b)

5
Logic Operations
4. NOR operation
• The Boolean expression for the NOR operation is
𝑥 =𝐴+𝐵
• It’s gate has the same symbol as the OR gate symbol
except that it has a small circle on the output.
• The small circle represents the inversion operation.
• Thus, the NOR gate operates like an OR gate followed
by an INVERTER.

Fig 4. NOR gate (left) Truth table (right)

6
Logic Operations
5. NAND operation
• The Boolean expression for the NOR operation is
𝑥 = 𝐴. 𝐵
• It’s gate has same symbol as the AND gate symbol
except that it has a small circle on the output.
• The small circle represents the inversion operation.
• Thus, the NAND gate operates like an AND gate
followed by an INVERTER.

Fig 5. NAND gate (left) Truth table (right)

7
Logic Operations
6. Exclusive-OR (XOR) operation
• The Boolean expression for the XOR operation is
𝑥 =𝐴⊕𝐵
• It is a combination of two AND gates, one OR gate, and
two inverters. It is the same as the following:
• 𝑥 = 𝐴 ⊕ 𝐵 = 𝐴𝐵ത + 𝐴𝐵 ҧ

Fig 6. XOR gate (top) Truth table (bottom)

8
Logic Operations
7. Exclusive-NOR (XNOR) operation
• The Boolean expression for the XNOR operation is
𝑥 =𝐴⊕𝐵
• The complement of the exclusive-OR function is the
exclusive-NOR, which can be described as follows:
• 𝑥 = 𝐴 ⊕ 𝐵 = 𝐴𝐵 + 𝐴ҧ𝐵ത

Fig 7. XNOR gate (top) Truth table (bottom)

9
Logic Operations
IEEE Symbols for Logic gates
• The institute of Electrical and Electronics Engineers
(IEEE) recommends rectangular shape symbols for logic
gates. IEEE symbols for gates are listed below:

Fig 8. IEEE symbols for logic gates

10
Logic Operations
Positive and Negative Logic
• The inputs and output of logic gates are represented by
either logic 1 or logic 0. There are two ways of assigning
voltage levels to the logic levels:
• The positive logic convention assigns HIGH voltage for
logic 1 and LOW voltage for logic 0.
• The negative logic a logic 1 represents LOW voltage
level and a logic 0 represents HIGH voltage level.
• A signal is “active high” if it performs the required
function when HIGH (1).
• An “active low” signal on the other hand, performs the
required function when LOW (0).
• A signal is said to be asserted when it is active and it is
disasserted when it is not at its active level.

11
Universal Property of NAND and NOR gates
The NAND gate as a Universal Logic Element
• The NAND gate is a universal gate because it can be used
to produce the NOT, the AND, the OR, and the NOR
functions.

12
Universal Property of NAND and NOR gates
The NOR gate as a Universal Logic Element
• The NOR gate is a universal gate because it can be used
to produce the NOT, the AND, the OR, and the NOR
functions.

13
Boolean Algebra
Introduction
• Boolean algebra provides basis for logic operations
using binary variables A binary variable is expressed in
alphabetic characters and can have either true or
complement value. For example, the binary variable 𝐴
can be either 𝐴 and/or 𝐴ҧ in a Boolean function.
• A Boolean function is an operation expressing logical
operations between binary variables, it can have a
value of 0 or 1. As an example of a Boolean function,
consider the following:
• 𝑓 = 𝐴ҧ𝐵ത + 𝐶
• Here, the Boolean function 𝑓 is 1 if both A and B are
1 or C is 1; otherwise, 𝑓 is 0.
• A truth table can be used to represent a Boolean
function. The truth table contains a combination of 1 ’s
and 0’s for the binary variables.

Fig 9. Truth table and logic diagram for 𝑓 14


Boolean Algebra
Describing Logic Circuits Algebraically
• Any logic circuit, no matter how complex, can be
described completely using the three basic Boolean
operations because the OR gate, AND gate, and NOT
circuit are the basic building blocks of digital systems.

Fig 10.

• To avoid confusion, it is a good practice to put


parenthesis to imply the operator precedence.

15
Boolean Algebra
Evaluating Logic Circuit Outputs
• Once we have the Boolean expression for a circuit
output, we can obtain the output logic level for any set
of input levels. To determine the output of a given
Boolean function/ expression, follow the following
steps:
1. First, perform all inversions of single terms.
2. Then perform all operations within parentheses.
3. Perform an AND operation before an OR
operation unless parentheses indicate otherwise.
4. If an expression has a bar over it, perform the
operations inside the expression first and then
invert the result.
• For example, the output of the logic circuit given in Fig
10a for a particular input states, where and 𝐴 =
0, 𝐵 = 1, 𝐶 = 1 and D = 1 will be:
• The output equation is
• Substituting the input states gives

• It is also possible to evaluate the output of any given


logic circuit using truth table.
16
Boolean Algebra
Implementing Logic Circuits from Boolean
Expressions
• When the operation of a circuit is defined by a Boolean
expression, we can draw a logic-circuit diagram directly
from that expression.
• Suppose that we wanted to construct a circuit whose
output is y = 𝐴𝐶 + 𝐵𝐶ҧ + 𝐴𝐵𝐶.ҧ
• This Boolean expression contains three terms which are
ORed together (𝐴𝐶, 𝐵𝐶,ҧ 𝐴𝐵𝐶).
ҧ This tells us that a three-
input OR gate is required.
• Then, two AND gates with two inputs and one AND gate
with three input are required to implement 𝐴𝐶, 𝐵𝐶ҧ and
𝐴𝐵𝐶ҧ terms respectively.
• Finally, two inverters are required to implement 𝐴ҧ and
𝐶.ҧ

Fig 11. 17
Boolean Algebra
Identities
• Boolean functions can be simplified by using the rules
(identities) of Boolean algebra. This allows one to
minimize the number of gates in a logic diagram, which
reduces the cost of implementing a logic circuit.
i) Basic Laws of Boolean Algebra

ii) Rules of Boolean Algebra

18
Boolean Algebra
Identities
De Morgan’s Laws
1)

2)

19
Boolean Algebra
Self Assessment
1. Ss
2. ss

3. ss

20
Standard Representations
Introduction
➢ The standard representations of a Boolean function
typically contain either logical product (AND) terms
called “minterms” or logical sum (OR) terms called
“maxterms.” These standard representations make the
minimization procedures easier.
➢A minterm is a product term of all variables in which
each variable can be either complemented or
uncomplemented.
➢A maxterm, on the other hand, can be defined as a
logical sum (OR) term that contains all variables in
complemented or uncomplemented form. A maxterm is
obtained from the logical sum of all the variables by
complementing each variable.
➢For example, there are four minterms and maxterms
for two variables, A and B.

➢Boolean expression can be represented by either


➢Sum of Product( SOP) form or
➢Product of Sum (POS form) 21
Standard Representations
Introduction

22
Standard Representations
Sum of Product form
➢It consists of two or more product terms (minterms)
that are summed by Boolean addition. E.g.

➢In SOP expression, an over bar can not extend more


than one variable; but more than one variable can have
an over bar. If sum/product of two/more variables are
complemented, apply the De Morgan’s law to obtain
the desired form.
➢Any general Boolean expression can be converted to
SOP form by applying distributive law. Eg: A(B + CD) =
AB + ACD
➢SOP expression can be implemented by one OR gate
and two or more ANDs. E.g.

23
Standard Representations
Sum of Product form
➢ In standard SOP each term of Boolean expression
must contain all the literals (with and without bar) that
has been used in Boolean expression.
➢ For instance, in Boolean expression AB + AC the literal
C is missing in the 1st term AB and B is missing in 2nd
term AC. So AB + AC is not a standard/canonical SOP.
➢To converting product terms to standard SOP, multiply
each nonstandard product term by a term made up of
the sum of a missing variable and its complement
➢Repeat the above step until all resulting product terms
contain all variables in the domain in either
complemented or uncomplemented form.

24
Standard Representations
Product of Sum form
➢The Product of sum( POS) form consists of two or more
sum terms (maxterms) that are multiplied by Boolaen
multiplication. E.g.

➢In POS expression, an over bar can not extend more


than one variable; but more than one variable can have
an over bar. If sum/product of two/more variables are
complemented, apply the De Morgan’s law to obtain
the desired form.
➢SOP expression can be implemented by one OR gate
and two or more ANDs.
➢In standard POS each term of Boolean expression must
contain all the literals (with and without bar) that has
been used in Boolean expression.
➢Converting sum terms to its standard POS
1. Add to each nonstandard sum term by a term made up
of the sum of a missing variable and its complement.
This results in two sum terms.
2. Apply Boolean algebra rule A + BC = (A + B)(A + C)
3. Repeat step 1 until all resulting sum terms contain all
variables in the domain in either complemented or
uncomplemented form.
25
Standard Representations
Product of Sum form
➢.
Standard Representations
Determining standard expressions from truth
table

➢.
Karnaugh Maps

• The Karnaugh map (K map) is a graphical tool used to


simplify a logic equation or to convert a truth table to
its corresponding logic circuit in a simple, orderly
process.
• Although a K map can be used for problems involving
any number of input variables, its practical usefulness is
limited to five or six variables.
Simplification Process
• Step 1 Construct the K map and place 1s in those
squares corresponding to the 1s in the truth table.
Place 0s in the other squares.
• Step 2 Examine the map for adjacent 1s and loop those
1s that are not adjacent to any other 1s.These are
called isolated 1s.
• Step 3 Next, look for those 1s that are adjacent to only
one other 1. Loop any pair containing such a 1.
• Step 4 Loop any octet even if it contains some 1s that
have already been looped.
• Step 5 Loop any quad that contains one or more 1s that
have not already been looped, making sure to use the
minimum number of loops.

28
Karnaugh Maps

• Mapping
• The K-map squares are labeled so that horizontally
adjacent squares differ only in one variable. For
example, the upper left-hand square in the four-
variable map is 𝐴ҧ𝐵ത 𝐶ҧ 𝐷
ഥ while the square immediately to
its right is 𝐴ҧ𝐵ത 𝐶𝐷
ҧ (only the 𝐷 variable is different). E.g.

29
Karnaugh Maps

• Cell adjacency
• The cells in a Karnaugh map are arranged so that there
is only a single variable change between adjacent cells.

30
Karnaugh Maps

• Solution

• The corresponding minimum SOP expression will be:

Don’t care conditions

31

You might also like