CHAPTER TWO
DIGITAL LOGIC BASICS
Objectives
❖ To introduce basic logic gates
❖ To discuss properties of logical expressions;
❖ To show how logical expressions can be simplified and
implemented;
❖ To illustrate the digital logic design process.
❖ Understand boolean algebra is the theoretic foundation to analyze
the operation of logic circuits
❖ Familiar with the rules and theorems of boolean algebra
❖ Know how to simplify the logic expression
1.1. OVERVIEW OF DIGITAL COMPUTER
• Digital computer is a digital system that performs various
computational tasks.
• Digital computers function more reliably if only two states are
used. Those are binary (i.e. true-or-false, yes-or-no statements).
• Digital computers use the binary number system, which has two
digits: 0 and 1. A binary digit is called a bit.
• Information in digital computers represented in groups of bits.
groups of bits can be represent not only binary numbers but
also other discrete symbols, such as decimal digits or letters of
alphabet.
• Groups of bits are used to develop complete sets of instructions for
performing various types of computations.
1.2. Fundamental Building Blocks (Simple Gates)
• The Hardware That Is Responsible For Executing Machine Language
Instructions Can Be Built Using A Large Number Of A Few Basic
Building Blocks. These Building Blocks Are Called Logic Gates.
• These Logic Gates Implement The Familiar Logical Operations Such As
And, Or, Not, And So On, In Hardware. For Example, As We Show Later,
We Can Build Hardware Circuits Using AND & NOT Gates Or Their
Equivalent.
• Logic Gates Are Built Using Transistors. Transistors Are The Basic
Electronic Components Of Digital Hardware Circuits.
• One Transistor Is Enough To Implement A Not Gate. But We Need Three
Transistors To Implement The AND Gate.
• Binary information is represented in digital computers by
physical quantities called signals. The two states represent a
binary variable that can be equal to 1 or 0. For example, a
particular digital computer may employ a signal of 5 volts to
represent binary 1 and 0 volt to represent binary 0 .
• In circuitry theory, not, and, and or gates are the basic gates. Any
circuit can be designed using these gates.
• The circuits designed depend only on the inputs, not on the
output. In other words, these circuits have no memory. Also these
circuits are called combinatorial circuits.
• The symbols not gate, and gate, and or gate are also considered
as basic circuit symbols, which are used to build general circuits.
• A truth table is a list of all possible input combinations and their
corresponding output.
• For example, if you treat a logical zero as representing false and
a logical 1 true, you can see that the truth table for the and gate
represents the logical and operation.
• Each gate has a distinct graphic symbol and its operation can
be described by means of an algebraic expression.
• The input-output relationship of the binary variables for each
gate can be represented in tabular form by a truth table.
• Each gate has one or two binary input variables designated by A
and B and one binary output variable designated by F or x.
• Some types of Gate are:
• AND
• OR
• NOT
• NOR
• NAND
• X-OR
• X-NOR
GATES
Boolean operators extended to more than two inputs (A,
B, . . .)
• In logical expressions, we use the dot, +, and over bar to
represent the AND, OR, and NOT operations, respectively.
• The precedence of these three logical operators is as follows.
• The and operator has a higher precedence than the or operator,
whereas the unary not operator has the highest precedence
among the three operators.
• Thus, when we write a logical expression such as it
implies
• As in arithmetic expressions, we can use parentheses to override
the default precedence.
• Even though the three gates are sufficient to implement any
logical function, it is convenient to implement certain other
gates.
• The nand gate is equivalent to an and gate followed by a not
gate.
• Similarly, the nor gates are a combination of or and not gates.
• It turns out that, contrary to our intuition, implementing the nand
and nor gates requires only two transistors whereas the and and
or gate implementations require three transistors.
• The exclusive-or (xor) gate generates a 1 output whenever the
two inputs differ.
• This property makes it useful in certain applications such as
parity generation.
• The exclusive-nor gate is equivalent to an XOR followed by a
NOT gate.
• This gate output, which is a complement of the xor gate, is 1
whenever the two inputs match.
• The exclusive-nor gate is also called the equivalence or
coincidence gate.
Figure Some additional useful gates.
Draw a circuit diagram for = (xy' + x'y)z.
1.3. Boolean algebra and logic simplification
Why studying boolean algebra?
• Boolean algebra used to simplify or optimize logic circuit
• Given logic expression , truth table is unique, however, the
expression and logic circuit diagram are not…
• For example:
1.3.1. Basic operations, rules of boolean algebra and DE morgan's theorem
1. Boolean addition
• In boolean algebra, a variable is a symbol used to represent an action, a
condition, or data.
• A single variable can only have a value of 1 or 0.
• The complement represents the inverse of a variable and is indicated with an
over bar.
• Thus, the complement of a is a.
• A literal is a variable or its complement.
• Addition is equivalent to the or operation. The sum term is 1 if one or more of
the literals are 1.
• The sum term is zero only if each literal is 0.
Example: Determine the values of A, B, and C that make
18 of the expression A + B + C = 0?
the sum term
Solution: Each literal must = 0; therefore A = 1, B = 0 and
C = 1.
2. Boolean Multiplication
• In Boolean algebra, multiplication is equivalent to the
AND operation.
• The product of literals forms a product term.
• The product term will be 1 only if all of the literals are
1.
Example: What are the values of the A, B and C if the
product term of A.B`.C` = 1?
Solution: Each literal must = 1; therefore A = 1, B = 0 and
C = 0.
19
20
Stated another way,
The complement of two or more ANDed variables is equivalent
to the OR of the complements of the individual variables.
Stated another way,
The complement of two or more ORed variables is equivalent to
the AND of the complements of the individual variables,
28
Fig. Gate equivalencies and the corresponding truth tables that
illustrate DE Morgan's theorems.
1.3.2. Simplification USING BOOLEAN ALGEBRA
• A simplified Boolean expression uses the fewest gates possible to
implement a given expression.
Example
• Using Boolean algebra techniques, simplify this expression:
AB + A(B + C) + B(B + C)
Solution
Step 1: Apply the distributive law to the second and third terms in
the expression, as follows:
AB + AB + AC + BB + BC
Step 2: Apply rule 7 (BB = B) to the fourth term.
AB + AB + AC + B + BC
Step 3: Apply rule 5 (AB + AB = AB) to the first two terms.
AB + AC + B + BC
Step 4: Apply rule 10 (B + BC = B) to the last two terms.
AB + AC + B
Step 5: Apply rule 10 (AB + B = B) to the first and third terms.
B+AC
• At this point the expression is simplified as much as possible.
31
Fig. Gate circuits for example above.
Exercise
Simplify the Boolean expressions:
STANDARD FORMS OF BOOLEAN EXPRESSIONS
• All Boolean expressions, regardless of their form, can be
converted into either of two standard forms: the sum-of-products
form or the product-of sums form.
• Standardization makes the evaluation, simplification, and
implementation of Boolean expressions much more systematic and
easier.
The Sum-of-Products (SOP) Form
• When two or more product terms are summed by Boolean
addition, the resulting expression is a sum-of-products (SOP).
Some examples are:
In an SOP expression a single overbar cannot extend over more than
one variable.
34
Fig. Implementation of the SOP expression AB + BCD + AC.
Fig. This NAND/NOR implementation is equivalent to the AND/OR in figure above.
The Product-of-Sums (POS) Form
• A sum term was defined before as a term consisting of the sum
(Boolean addition) of literals (variables or their complements).
• When two or more sum terms are multiplied, the resulting
expression is a product-of-sums (POS).
• Some examples are
• A POS expression can contain a single-variable term, as in A(A
+ B + C)(B + C + D).
• In a POS expression, a single overbar cannot extend over more
than one variable; however, more than one variable in a term can
have an overbar. For example, a POS expression can have the
term
• Implementation of a POS Expression simply requires ANDing the
outputs of two or more OR gates.
• A sum term is produced by an OR operation and the product of two
or more sum terms is produced by an AND operation. Fig. below
shows for the expression (A + B)(B + C + D)(A + C).
• The output X of the AND gate equals the POS expression.