DL CH2
DL CH2
A X=Ac
0 1
1 0
Truth table of NOT operation
INPUT OUTPUT
A B X=A.B
0 0 0
0 1 0
1 0 0
1 1 1
Truth Table of 2 input AND operation
INPUT OUTPUT
A B X=A+B
0 0 0
0 1 1
1 0 1
1 1 1
INPUTS OUTPUT
A B C D X=A+B+C+D X= A.B.C.D
0 0 0 0 0 0
0 0 0 1 1 0
0 0 1 0 1 0
0 0 1 1 1 0
0 1 0 0 1 0
0 1 0 1 1 0
0 1 1 0 1 0
0 1 1 1 1 0
1 0 0 0 1 0
1 0 0 1 1 0
1 0 1 0 1 0
1 0 1 1 1 0
1 1 0 0 1 0
1 1 0 1 1 0
1 1 1 0 1 0
1 1 1 1 1 1
Electronic circuits which combine digital signals according to the Boolean algebra are referred to as
logic gates. They are called gates because they control the flow of information. Positive logic is an
electronic representation in which the true state is at a higher voltage, while negative logic has the
true state at a lower voltage. We will use the positive logic type in this course.
Logic circuits are grouped into families, each with their own set of detailed operating rules. Some
common logic families are:
The ECL is very fast. The MOS features very low power consumption and hence is often used in LSI
technology. The TTL is normally used for small-scale integrated circuit units.
The inverter (NOT circuit) performs a basic logic function called inversion or complementation. The
purpose of the inverter is to change one logic level (HIGH / LOW) to the opposite logic level. In terms
of bits, it changes a ‘1’ to a ‘0’ and vice versa. The standard logic symbol for the inverter and a Venn
diagram illustrating the relationship between the variables and the logic gate operation, are shown in
Figure 1-1 and Figure 1-2, respectively. A NOT gate is a single input and a single output gate.
Actually an Inverter is the complement of Buffer. Buffer is a gate that produces same output as that of
input and is also a single input and single output gate.
Figure 1-1 Standard Logic Symbol for Inverter Standard logic symbol of Buffer
E:\Sandeep's Notes\Logic circuits notes\chapter 2.doc
INPUT OUTPUT
A X=Ac
0 1
1 0
The AND gate, which is composed of two or more inputs and a single output, performs logical
multiplication. The standard symbol for the AND gate is shown in Figure 1-3 and its truth table listed
in Table 1-2. The logical operation of the AND gate is such that the output is HIGH (1) when all the
inputs are HIGH, otherwise it is LOW (0). The Venn diagram shown in Figure 1-4 provides an insight
into the AND function. The highlighted area represents the function X=AB.
INPUT OUTPUT
A B X=A.B
0 0 0
0 1 0
1 0 0
1 1 1
3. The OR gate
The OR gate, which is composed of two or more inputs and a single output, performs logical addition.
The standard symbol for the OR gate is shown in Figure 1-5 and its truth table listed in Table 1-3. The
logical operation of the OR gate is such that the output is HIGH (1) when any of the inputs are HIGH,
otherwise it is LOW (0). The Venn diagram shown in Figure 1-6 provides an insight into the OR
function. The highlighted area represents the function X=A+B.
INPUT OUTPUT
A B X=A+B
0 0 0
0 1 1
1 0 1
1 1 1
The NAND, which is composed of two or more inputs and a single output, is a very popular logic
element because it may be used as a universal function. That is, it may be employed to construct an
inverter, an AND gate, an OR gate, or any combination of theses functions. The term NAND is formed
by the concatenation NOT-AND and implies an AND function with an inverted output. The standard
symbol for the NAND gate is shown in Figure 1-7 and its truth table listed in Table 1-4. The logical
operation of the NAND gate is such that the output is LOW (0) only when all the inputs are HIGH (1).
INPUT OUTPUT
A B
0 0 1
0 1 1
1 0 1
1 1 0
The NOR gate, which is composed of two or more inputs and a single output, also has a universal
property. The term NOR is formed by the concatenation NOT-OR and implies an OR function with an
inverted output. The standard symbol for the NOR gate is shown in Figure 1-7 and its truth table listed
in Table 1-5. The logical operation of the NOR gate is such that the output is HIGH (1) only when all
the inputs are LOW (0).
INPUT OUTPUT
A B
0 0 1
0 1 0
1 0 0
1 1 0
These gates are usually formed from the combination of the other logic gates already discussed.
However, because of their functional importance, these gates are treated as basic gates with their
own unique symbols. The truth tables for the XOR and XNOR gates, shown in Figure 1-8, are listed in
Table 1-6. In the Exclusive-OR gate the output is HIGH (1) when the odd numbers of inputs are HIGH
(1). Conversely, in the Exclusive-NOR gate the output is LOW (0) when the odd number of inputs are
HIGH (1). XNOR is basically an XOR gate followed by an inverter. They are also a multi input and
single output gates.
Figure 1-8 Standard logic symbols for: (a) XOR (b) XNOR
A B
0 0 0 1
0 1 1 0
1 0 1 0
1 1 0 1
Table 1-6 Truth table for XOR and XNOR logic gates
Timing diagram is basically a graph that accurately displays the relationship of two or more
waveforms with respect to each other on a time basis. Following examples clearly illustrates the
concept of timing diagrams.
E:\Sandeep's Notes\Logic circuits notes\chapter 2.doc
Figure b:-Timing diagram of NOT gate of figure a wrt its input (output is high when input is low and
vice versa)
Figure c:- Timing diagram of 2 input AND gate.( Output is high when all inputs are high)
Figure d: - Timing diagram of 3 input AND gate. (Output is high when all inputs are high)
E:\Sandeep's Notes\Logic circuits notes\chapter 2.doc
Figure e: - Timing diagram of 3 input OR gate (output is high when any one of the input is high)
Variable, complement and literal are terms used in Boolean algebra. A variable is a symbol that is
used to represent a logical quantity. Any single variable can have 1 or 0 value. The complement is the
inverse of the variable and is indicated by over bar. e.g. Complement of variable A is A. It can be
also written as A or Ac. The complement of variable A is read as “NOT A” or “A bar”. A literal is a
variable or complement of a variable.
Boolean Operations
• Boolean addition: - Boolean addition is equivalent to OR operation. The basic rules are:-
0+0=0
0+1=0
1+0=0
1+1=1
In Boolean algebra, a sum term is the sum of literals. In logic circuits, a sum term is produced
by an OR operation with no AND operation involved. Some examples of sum terms are A+B,
A+Bc+C etc.
A sum term is equal to 1 when one or more of the literals in the term are 1. A sum term is 0
only if each of the literal is 0.
__ __
# Determine the values of A, B, C and D that make the sum term A+B + C + D equal to
zero.
Since a sum term is zero only when all literals are zero so,
A=0 __
Bc = 0 → B = 0 → B = 1
C=0 __
Dc = 0 → D = 0 → D = 1
0.0=0
0.1=0
1.0=0
1.1=1
In Boolean algebra, a product term is the product of literals. In logic circuits, a product term is
produced by an AND operation with no OR operation involved. Some examples of product
terms are A.B, A.Bc.C etc.
A product term is equal to 1 only if each of the literals in the term is1. A product term is 0 when
one or more of the literals are 0.
__ __
# Determine the values of A, B, C and D that make the product term A.B.C.D equal to one.
Since a product term is one only when all literals are one so,
__
Ac = 1 → A = 1 → A = 0
B=1
C=1
__
c
D =1→D=1 →D=0
Associative laws
The associative law of addition is written as:- A + ( B+C ) = ( A+B ) + C
i.e. when ORing more than two variables, the result is the same regardless of the grouping of the
variables.
Distributive law
The distributive law is written as: A.(B+C) = A.B + A.C
i.e. ORing two or more variable and then ANDing the result with a single variable is equivalent to
ANDing the single variable with each of the two or more variables and then ORing the products.
SN Expression Result
1 A+0 A
2 A+1 1
3 A.0 0
4 A.1 A
5 A+A A
6 A+A 1
7 A . A A
8 A . A 0
9 ( Ac)c A
10 A + A.B A
11 A + A.B A+B
12 (A+B). (A+C) A+ B.C
1. Rule 1:- A + 0 = A A variable ORed with 0 is always equal to the variable. If the input variable
A is 1 then output variable X is also 1 and if the input variable is 0 then the output variable X is
also 0. In both case the output being equal to the variable A.
2. Rule 2:- A + 1 = 1 A variable ORed with 1 is always equal to 1. A 1 on the input of the OR gate
always produces 1 as an output regardless of the value of the variable on the other input.
E:\Sandeep's Notes\Logic circuits notes\chapter 2.doc
3. Rule 3:- A.0 = 0 A variable ANDed with 0 is always equal to 0 since 0 on the input of an AND
gate always produces 0 on the output regardless of the value of the variable on the other input.
4. Rule 4:- A.1 = A A variable ANDed with 1 is always equal to the variable. If the input variable
A is 1 then output variable X is also 1 and if the input variable is 0 then the output variable X is
also 0. In both case the output being equal to the variable A.
5. Rule 5:- A + A = A A variable ORed with itself is always equal to the variable. If A is 1 , X is
also 1 and if A is 0 X is also 0,the output being equal to variable A in both case.
7. Rule 7:- A.A = A A variable ANDed with itself is always equal to the variable. If A is 1, X is
also 1 and if A is 0 X is also 0, the output being equal to variable A in both case.
8. Rule 8:- A. Ac = 0 A variable ANDed with its complement is always equal to 0. If A is 1, its
complement is 0 and hence X is 0. Similarly, if A is 0 its complement is 1 and again X is 0
because any one 0 on the input of AND gate produces 0 on the output.
E:\Sandeep's Notes\Logic circuits notes\chapter 2.doc
9. Rule 9: - [Ac]c = A The double complement of a variable is always equal to the variable.
10. Rule 10: - A + AB = A This rule can be proved by applying the distributive law, rule 2 and
rule 4 as follows:-
=A ………………… {Rule 4}
= A +B ……………………………… {Rule 4}
12. Rule 12 : - ( A+B). (A+C) = A + B.C This rule can be proved as follows:-
First Theorem: - The complement of a product of a variable is equal to the sum of the complements
of the variables. i.e. the complement of two or more variables ANDed is equivalent to the OR of the
complement of individual variable. The formula for expressing this theorem for 2 variables A and B is
given below:-
(A.B)C = AC + BC
Second Theorem: - The complement of a sum of a variable is equal to the product of the
complements of the variables. i.e. the complement of two or more variables ORed is equivalent to the
AND of the complement of the individual variables. The formula for expressing this theorem for 2
variables A and B is given below:-
(A+B)C = (A)C.(B)C
Figure below shows the gate equivalence and truth tables for equation (i) and equation (ii) :
A B (A.B)C AC + BC
0 0 1 1
0 1 1 1
1 0 1 1
1 1 0 0
Truth table of NAND and Bubbled OR gate (Verification of De Morgan’s First Theorem)
E:\Sandeep's Notes\Logic circuits notes\chapter 2.doc
0 0 1 1
0 1 0 0
1 0 0 0
1 1 0 0
Truth table of NOR and Bubbled AND gate (Verification of De Morgan’s Second Theorem)
As stated De Morgan’s theorems also apply to expressions in which there are more than two
variables. The following examples illustrate the application of De Morgan’s theorem’s to 3 variable
and 4 variable expressions.
_________ __ __ __
X + Y + Z = X. Y. Z
The following procedure illustrates the application of De Morgan’s theorems and Boolean algebra to
the specific expression
E:\Sandeep's Notes\Logic circuits notes\chapter 2.doc
E:\Sandeep's Notes\Logic circuits notes\chapter 2.doc
2.9 Duality theorem
Duality theorem states that “Starting with a Boolean expression, another equivalent Boolean
expression can be derived by changing each OR sign to AND sign, AND sign to OR sign and
complementing any 0 and 1 present in the expression.” E.g. Dual of A + 0 = A is A.1 = A. Some of
Boolean relations and their duals are tabulated below:-
A + (B + C) = (A + B) + C A.(B.C) = (A.B).C
A+A=A A. A = A
A+Ac = 1 A. Ac = 0
To derive the Boolean expression for a given logic circuit, begin at the leftmost inputs and work
toward the final output, writing the expression for each gate. For example for circuit in the figure
below, the Boolean expression is determined as follows:-
Input to G1 is C and D
Input to G2 is output of
G1
and B
Input of G3 is output of
G3
and A.
E:\Sandeep's Notes\Logic circuits notes\chapter 2.doc
Constructing a Truth table for a Logic Circuit
Once Boolean expression for a given logic circuit has been determined, a truth table that shows the
output for all possible values of the input variables can be developed. Consider the logic circuit which
is in the figure above. There are 4 inputs A, B, C and D and hence sixteen combinations are possible
To evaluate the expression A.(B+CD), first find the values of the variable that make the expression
equal to 1, using the rules of Boolean addition and multiplication. In this case, the expressions equal
1 only if A = 1 and B+CD = 1The expression B+CD is 1 if either B is 1 or CD is 1 or B and CD is both
1.Now expression CD is 1 only if both C and D are 1.To sum up, the above expression will be one for
A=1 and B= 1; A=1 and C=1 and D = 1.The truth table is then constructed as:-
INPUTS OUTPUT
A B C D A.(B+CD)
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 0
1 0 1 0 0
1 0 1 1 1
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
E:\Sandeep's Notes\Logic circuits notes\chapter 2.doc
# REPLACE THE AND GATE WITH OR GATE AND OR GATE WITH AND GATE
IN ABOVE FIGURE AND DETERMINE THE BOOLEAN EXPRESSION FOR THE
OUTPUT AND CONSTRUCT THE TRUTH TABLE
Thus the simplification of an expression results in the same output with minimum
number of gates which is depicted in the figure above.
E:\Sandeep's Notes\Logic circuits notes\chapter 2.doc
0 0 0 P0 S0
0 0 1 P1 S1
0 1 0 P2 S2
0 1 1 P3 S3
1 0 0 P4 S4
1 0 1 P5 S5
1 1 0 P6 S6
1 1 1 P7 S7
In short, minterms and maxterms may be used to define the two standard forms for logic expressions,
namely the sum of products (SOP), or sum of minterms, and the product of sums (POS), or
product of maxterms. These standard forms of expression aid the logic circuit designer by simplifying
the derivation of the function to be implemented.
RED = A
Green = B
BLUE = C
BLACK = D
Output of G4 is SOP
expression AB + BCD +AC
The standard SOP form: - A standard SOP expression is one in which all the variables in domain
appear as literal in each product term in the expression. E.g. the expression ABCc + ABCcD +CDc has
a domain made up of the variables A, B, C, D.However, the complete set of variables in the domain is
not represented in the last two terms of the expression ie D or Dc is missing from first and A or Ac
and B or Bc is missing from the last.
Standard SOP expressions are important in constructing truth tables and in Karnaugh map
simplification methods.
An SOP expression is equal to 1 if at least one of the product terms is equal to 1. A truth table is
simply a list of the possible combinations of input variables values and the corresponding output
value. The following steps shall be followed while converting SOP expression to truth table format.
• Convert the SOP expression to standard SOP expression and list the combination of binary
values of the variables in the expression.
• Place 1 in the output column for each binary value that makes standard product terms
(minterms) in the expression of standard SOP a binary 1 and place 0 for all other remaining
values. __ __
As for an example consider a standard SOP expression A B C + A B C + ABC
Since domain of SOP expression is A, B, C so there are 8 combinations. And binary values of
inputs that make minterms of above expression 1 are respectively 001, 100 and 111. So all other
values of input will yield 0 on the output and thus the truth table will be as shown:-
Input Minterms Output
A B C
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
0 0 0 0 0
1 0 0 1 0
2 0 1 0 0
3 0 1 1 1
4 1 0 0 0
5 1 0 1 1
6 1 1 0 1
7 1 1 1 0
1
2 X = P3 + P5 + P6 or
3
2. The product of Sums (POS) form: - When two or more sum terms are multiplied, the resulting
expression is a product of sums. An SOP expression can be implemented with one AND and two
or more OR gates. Some examples are (A+B). (A+B+C), (A+B+C). (C+D+E). (Bc+C+Dc) etc
Also an SOP expression can contain a single variable term as in A. (Ac+Bc+C). It is to be noted
that a single overbar can’t extend over more than one variable; however more than one variable in
a term can have an overbar. E.g. an SOP expression can have the term Ac+Bc but not (A+B)c.
Implementation of a POS expression: - Implementing a POS expression simply requires ANDing
the outputs of two or more OR gates. A sum term is produced by OR operation and the product of
two or more sum term is produced by AND operation. Therefore POS expression can be
implemented by OR – AND logic in which the outputs of a number (equal to the number of sum
terms in the expression) of OR gates
connect to the input of an AND gate. In
the figure below output of AND gate
equals POS expression.
RED = A
Green = B
BLUE = C
BLACK = D
Output of G4 is POS expression
(A+B). (B+C+D). (A+C)
E:\Sandeep's Notes\Logic circuits notes\chapter 2.doc
The standard POS form: - A standard POS expression is one in which all the variables in domain
appear as literals in each sum term in the expression. E.g. the expression (A+B+Cc). ( A+B+Cc+D)
.(C+Dc) has a domain made up of the variables A, B, C, D. However, the complete set of variables in
the domain is not represented in the last two terms of the expression ie D or Dc is missing from first
and A or Ac and B or Bc is missing from the last.
Standard POS expressions are important in constructing truth tables and in Karnaugh map
simplification methods.
A POS expression is equal to 0 if at least one of the sum terms is equal to 0. A truth table is simply a
list of the possible combinations of input variables values and the corresponding output value. The
following steps shall be followed while converting SOP expression to truth table format.
• Convert the POS expression to standard POS expression and list the combination of binary
values of the variables in the expression.
• Place 0 in the output column for each binary value that makes standard sum terms (maxterms)
in the expression of standard POS a binary 0 and place 1 for all other remaining values.
__ __ __
As for an example consider a standard SOP expression (A + B + C). (A + B + C). (A+ B + C)
Since domain of POS expression is A, B, C so there are 8 combinations. And binary values of
inputs that make maxterms of above expression 0 are respectively 000, 010 and 011. So all other
values of input will yield 1 on the output and thus the truth table will be as shown:-
Input Maxterms Output
A B C
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
0 0 0 0 0
1 0 0 1 0
2 0 1 0 0
3 0 1 1 1
4 1 0 0 0
5 1 0 1 1
6 1 1 0 1
7 1 1 1 0
The POS expression for this circuit is thus given by any of the following:
1
2 X = S0S1S2S4S7
3
Note:
• Boolean functions expressed as a standard SOP or a standard POS are said to be in
canonical form.
• Note that POS is not the complement of the SOP expression.
# Derive the SOP and POS expressions for the truth tables shown below:
0 0 0 1
1 0 1 0
2 1 0 1
3 1 1 0
E:\Sandeep's Notes\Logic circuits notes\chapter 2.doc
SOP POS
X = P0 + P2 X = S1S3
The Karnaugh map (K map) provides a systematic method for simplifying a Boolean expression or a
truth table function. It is similar to truth table because it also provides all the possible values of input
variables and the resulting output variable. When used properly, the K map will produce the simplest
SOP or POS expression possible. Familiarity with the law and rules of Boolean algebra is not
required. Instead, simplification is done graphically using the K mapping technique. Instead of being
organized into columns and rows like a truth table, K map is an array of cells in which each cells
represent binary value of input variables The K map consists of N = 2n cells, where n is the number of
input variables. The cell format is such that there is a single variable change between any adjacent
cells. This is the characteristic that will determine adjacency. The 2, 3, 4 and 5 variable K map is as
shown in the diagram below. For n>5 the K map technique becomes impractical unless implemented
on computer.
E:\Sandeep's Notes\Logic circuits notes\chapter 2.doc
Truth table specifications for a logic function may not to include all possible combinations of the input
binary digits for the input variables, yet they may still be complete specifications of the logic function
for the prescribed application. In these situations certain input combinations will not occur due to the
nature of the application. When the input combinations are irrelevant or cannot occur, the output
states are in the Truth table and the K map are filled with an X and are referred to as don’t care
states. When simplifying K maps with don’t care states, the contents of the undefined cells (1
or 0) are chosen according to preference. The aim is to enlarge group sizes thereby
eliminating as many input variables from the simplified expression as possible. Only those X’s
that assist in simplifying the function should be included in the groupings. No additional X’s
should be added that would result in additional terms in the expression. To illustrate let us
consider the Truth Table below.
Input Output
A B C D Y
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 1
1 0 0 0 1
1 0 0 1 1
1 0 1 0 x
1 0 1 1 x
1 1 0 0 x
1 1 0 1 x
1 1 1 0 x
1 1 1 1 x
E:\Sandeep's Notes\Logic circuits notes\chapter 2.doc
The above truth table is the circuit for BCD code that will output 1 only when inputs are 7, 8 and 9.
The K map of this truth table is:-