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

Lecture 2 - Logic Fundamentals

The document discusses the fundamentals of logic and Boolean algebra. It begins by explaining that binary systems need rules for symbolic manipulation like algebra, known as digital algebra. George Boole then formulated the basic rules of logic in the 1800s. Boolean algebra is useful for manipulating binary variables and analyzing digital systems. The document then defines basic logic gates like OR, AND, and NOT along with their truth tables. It also discusses derived gates like NAND, NOR, and XOR. Finally, it covers the postulates and theorems of Boolean algebra that can be used to simplify Boolean expressions.

Uploaded by

fmwansa806
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)
55 views

Lecture 2 - Logic Fundamentals

The document discusses the fundamentals of logic and Boolean algebra. It begins by explaining that binary systems need rules for symbolic manipulation like algebra, known as digital algebra. George Boole then formulated the basic rules of logic in the 1800s. Boolean algebra is useful for manipulating binary variables and analyzing digital systems. The document then defines basic logic gates like OR, AND, and NOT along with their truth tables. It also discusses derived gates like NAND, NOR, and XOR. Finally, it covers the postulates and theorems of Boolean algebra that can be used to simplify Boolean expressions.

Uploaded by

fmwansa806
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/ 32

The University of Zambia

LECTURE TWO: Logic Fundamentals

Jasper HATILIMA
Department of Electrical and Electronic Engineering, School of Engineering

[email protected] January 2017


[email protected]
 We have seen that binary arithmetic and decimal arithmetic are similar in many
respects. In decimal systems, Algebra helps us simplify complex expressions.
It should therefore be obvious that binary systems also need a set of rules for
symbolic manipulation that will enable us to simplify complex binary
expressions and solve for unknowns.
 Simply put, we need a digital algebra. Nearly 100 years before the first digital
computer, George Boole, an English mathematician (1815-1864), formulated a
basic set of rules governing the true-false statements of logic.
 Eighty-five years later (1938), Claude Shannon , at that time a graduate student
a MIT, pointed out the usefulness of Boolean algebra in solving telephone
switching problems and established the analysis of such problems on a firm
mathematical basis.
 Boolean algebra is valuable in manipulating binary variables in OR, AND, or
NOT relations and in the analysis and design of all types of digital systems.

EEE3131 Jasper Hatilima 2017 2


 Logic gates are electronic circuits that can be used to implement the most
elementary logic expressions also known as Boolean expressions.
 The logic gate is the most basic building block of combinational logic. 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 gate and the EXCLUSIVE-NOR gate.
Truth Table
 A truth table lists all possible combinations of input binary variables and the
corresponding outputs of a logic system.
 When the number of input binary variables is only one, then there are only two
possible inputs, i.e., ‘0’ and ‘1’.
 If the number of inputs is two, there can be four possible input combinations,
i.e., 00, 01, 10 and 11.

EEE3131 Jasper Hatilima 2017 3


OR Gate
 An OR gate performs an ORing operation on two or more logic variables. The
OR operation on two independent logic variables A and B is written as
Y  A  B and reads as Y equals A OR B.
 An OR gate is a logic circuit with two or more inputs and one output. The
output of an OR gate is LOW only when all of its inputs are LOW, otherwise,
it is HIGH for all other possible input combinations.

Figure 1: Two-input OR gate.


 Figure 1 shows the logic circuit symbol and truth table of a two-input OR gate.

EEE3131 Jasper Hatilima 2017 4


AND Gate
 An AND gate is a logic ckt having two or more inputs and one output. Its
output is HIGH only when all of its inputs are in the HIGH state.
 In all other cases, the output is LOW. The logic symbol and truth table of a two
input AND gate are shown in Figure 2.

Figure 2: Two-input AND gate.

 The AND operation on two independent logic variables A and B is written as


Y  A  B and reads as Y equals A AND B.

EEE3131 Jasper Hatilima 2017 5


Not Gate
 A NOT gate is a one-input, one-output logic ckt whose output is always the
complement of the input. That is, a LOW input produces a HIGH output, and
vice versa.
 Figure 3 shows the circuit symbol and the truth table for a NOT gate.

Figure 3: Circuit symbol and truth table of a NOT ckt.

 The NOT operation on a logic variable X is denoted as X or X  . That is, if


X is the input to a NOT ckt, then its Y is given by Y  X or X  and reads as Y
equals NOT X.

EEE3131 Jasper Hatilima 2017 6


Exclusive-OR Gate
 Commonly written as EX-OR gate, is a two-input gate. Its output is logic ‘1’
when the inputs are unlike and logic ‘0’ when the inputs are like.
 The output of a multiple-input EX-OR logic function is a logic ‘1’ when the
number of 1s in the input sequence is odd and logic ‘0’ when the number of 1s
in the input sequence is even, including zero.
 That is an all 0s input sequence also produces a logic ‘0’ at the output.

Figure 4: Circuit symbol and truth table of an EX-OR ckt.


 The output of a two-input EX-OR gate is expressed by Y  A B

EEE3131 Jasper Hatilima 2017 7


NAND Gate
 NAND stands for NOT AND. An AND gate followed by a NOT circuit makes
it a NAND gate. NAND gate operation is logically expressed as Y  A  B .

Figure 5: Circuit symbol and truth table of a NAND gate.

 Figure 5 shows the circuit symbol and the truth table of a two-input NAND
gate.

EEE3131 Jasper Hatilima 2017 8


NOR Gate
 NOR stands for NOT OR. An OR gate followed by a NOT ckt makes it a
NOR gate. The output of a two-input NOR gate is logically expressed as
Y  A B .

Figure 6: Circuit symbol and truth table of a NOR gate.

 Figure 6 shows the circuit symbol and the truth table of a two-input NOR gate.

EEE3131 Jasper Hatilima 2017 9


Exclusive-NOR Gate
 EX-NOR means NOT of EX-OR, i.e., the logic gate that we get by
complementing the output of an EX-OR gate. Logically the output is given by
Y  A B .

Figure 7: Circuit symbol and truth table of a EX-NOR gate.

 Figure 7 shows the circuit symbol and the truth table of a two-input EX-NOR
gate.
 The output of a two-input EX-NOR gate is a logic ‘1’ when the inputs are alike
and logic ‘0’ when they are unlike.

EEE3131 Jasper Hatilima 2017 10


 Boolean algebra is mathematics of logic. It is one of the most basic tools
available to the logic designer and thus can be effectively used for
simplification of complex logic.
 Boolean algebra, quite interestingly, is simpler than ordinary algebra. It is also
composed of a set of symbols and a set of rules to manipulate these symbols.
Nevertheless, the differences between Boolean and ordinary algebra are as
follows:
1. In ordinary algebra, the letter symbols can take on any number of values
including infinity. In Boolean algebra, they can take on either of two values,
that is, 0 and 1.
2. The values assigned to a variable have a numerical significance in ordinary
algebra, whereas in its Boolean counterpart they have a logical significance.
3. While ‘  ’ and ‘+’ are respectively the signs of multiplication and addition
in ordinary algebra, in Boolean algebra ‘  ’ means AND operation and ‘+’
means an OR operation.

EEE3131 Jasper Hatilima 2017 11


4. Boolean algebra captures the essential properties of both logic operations such
as AND, OR and NOT and set operations such as intersection, union and
complement.
5. Boolean algebra may also be defined to be a set A supplied with two
operations of logical AND    , logical OR  V  , a unitary operation NOT
   , and two elements, namely logical FALSE  0  and logical TRUE 1 .
This set is such that, for all elements of this set, the postulates or axioms
relating to the associative, commutative, distributive , absorption and
complementation properties of these elements hold good.
Postulates of Boolean Algebra
 0  0  0, 00  0 .

0  1  1, 1  0  1 ; 0 1  0, 1 0  0 .
 1  1  1, 1 1  1 .
 .
1  0, 0 1
EEE3131 Jasper Hatilima 2017 12
 Many theorems of Boolean algebra are based on these postulates, which can
be used to simplify Boolean expressions.
Theorems of Boolean Algebra
 Theorem 1 (Operations with ‘0’ and ‘1’)
a  0 X  0 and (b) 1  X  1 [1]
where X is not necessarily a single variable – it could be a term or even a large
expression.
Proof of theorem 1(a): we substitute all possible values of X, that is, 0 and 1,
into the give expression and check if the LHS equals the RHS.
 For X  0, LHS  0  X  0  0  0  RHS .
 For X  1, LHS  0 1  0  RHS .
 Thus , 0  X  0 irrespective of the value of X, and hence the proof.
Proof of theorem 1(b) is similar: In general, according to theorem 1,
0   Boolean expression   0 and 1   Boolean expression   1 .
EEE3131 Jasper Hatilima 2017 13
 For example, 0   A  B  B  C  C  D   0 and 1   A  B  B  C  C  D   1 ,
where A, B and C are Boolean variables.
 Theorem 2 (operations with ‘0’ and ‘1’)
a  1 X  X and (b) 0  X  X [2]
where X could be a variable, a term or even a large expression.
Proof of theorem 2(a):.
 For X  0, LHS  1 0  0  RHS .
 For X  1, LHS  11  1  RHS .
Proof of theorem 2(b) is similar: In general, according to theorem 2,
1   Boolean expression   Boolean expression and
0   Boolean expression   Boolean expression .
 For example,
1  A  B  B  C  C  D   0   A  B  B  C  C  D   A  B  B  C  C  D

EEE3131 Jasper Hatilima 2017 14


 Theorem 3 (Idempotent or Identity Laws)

a  X X X XX and (b) XXX X X [3]

 Theorem 3(a) is a direct consequence of an AND gate operation, whereas


theorem 3(b) represents an OR gate operation when all inputs of the gate have
been tied together.
 The scope of the idempotent laws can be expanded further by considering X to
be a term or an expression.
 Example 1
 Apply identity laws to simplify the Boolean expression
 A B  B  C C  A B  B  A B  C C 
 Solution
 A B  B  C C  A B  B  A B  C C    A B  C  A B  A B  C 
  A B  C  A B  C   A B  C

EEE3131 Jasper Hatilima 2017 15


 Theorem 4 (Complementation Law)

a  X X 0 and (b) X  X 1 [4]


 By this theorem, in general, any Boolean expression when ANDed to its
complement yields a ‘0’ and when ORed to its complement yields a ‘1’,
irrespective of the complexity of the expression.
Proof of theorem 4(a):
 For X  0, X  1, LHS  X  X  0 1  0  RHS .
 For X  1, X  0, LHS  X  X  1 0  0  RHS .
 Hence, theorem 4(a) is proved. Since theorem 4(b) is the dual of theorem
4(a), its proof is implied.
 To further illustrate the application of theorem 4, consider

 A  B  C  A  B  C   0 and  A  B C   A  B C  1

EEE3131 Jasper Hatilima 2017 16


 Example 2
Simplify the following:

    
1  L  M  L  M  L  M    L  M  L  M  L  M   L  M  
   
Solution
 We know that 1   Boolean expression   1 .
    
Also, L  M is the complement of L  M and L  M is the complement  
of  L  M  .
 Therefore, the given expression reduces to 1  0  0  1  0  0 .

 Theorem 5 (Commutative Laws)


a  X Y  Y  X and (b) X Y  Y  X [5]
 Theorem 5(a) implies that the order in which variables are add or ORed is
immaterial. Theorem 5(b) implies that the order in which variables are
ANDed is also immaterial.
EEE3131 Jasper Hatilima 2017 17
 Theorem 6 (Associative Laws)
a  X  Y  Z   Y   Z  X  Z   X  Y  and
(b) X   Y  Z   Y   Z  X  Z   X  Y  [6]

 Theorems 6(a) and (b) are further illustrated by the logic diagrams in Figures
8 (a) and (b).,

Figure 8: Associative laws.


1
EEE3131 Jasper Hatilima 2017 8
 Theorem 7 (Distributive Laws)
a  X  Y  Z   Y  X  X  Z and (b) X  Y  Z   X  Y   X  Z  [7]

 Theorem 7(b) is the dual of theorem 7(a).


 The proof of theorem 7(a) is done by means of perfect induction method, see
table 1. Theorem 7(b) is the dual of theorem 7(a) and therefore its proof is
implied
Table 1 Proof of distributive law.
X Y Z Y Z XY XZ X Y  Z  XY  XZ
0 0 0 0 0 0 0 0
0 0 1 1 0 0 0 0
0 1 0 1 0 0 0 0
0 1 1 1 0 0 0 0
1 0 0 0 0 0 0 0
1 0 1 1 0 1 1 1
1 1 0 1 1 0 1 1
1 1 1 1 1 1 1 1

EEE3131 Jasper Hatilima 2017 19


 Example 3 Illustration of Distributive Laws
Simplify the expressions A  B  A  B  A  B  A  B and
   
A  B  A  B  A  B   A  B .
 Solution. Using the theorem 7(a) and (b) we have

   
A  B  A  B  A  B  A  B  A  B  B  A  B  B  A 1  A 1  A  A  1

 A  B    A  B    A  B    A  B    A  B  B    A  B  B    A  0   A  0
 A A  0

 Theorem 8
a  X Y  X Y  X and (b)  X  Y   X  Y   X [8]
 This is a special case of theorem 7. Theorem 8 can be usefully employed to
simplify many complex Boolean expressions.

EEE3131 Jasper Hatilima 2017 20


 Example 4 Illustration of theorem 8.
Simplify the expressions
A B C  D  A B C  D  A B C  D  A B C  D
 A B C  D  A B C  D  A B C  D  A B C  D
and
 A  B  C    A  B  C    A . B  C    A  B  C 
 Solution.
 In the above expression, variables B, C and D are present in all eight possible
combinations, and the variable A is common in all eight product terms. By
theorem 8(a), this expression reduces to A.
 By theorem 8(b) the second expression reduces to A as the variables B and C
are present in all four possible combinations in sum terms and variable A is
the common factor in all the terms.

EEE3131 Jasper Hatilima 2017 21


 Theorem 9
a   X  Y  Y  X Y and (b) X  Y  Y  X  Y [9]

 The Proof of theorem 9(a) is quite trivial.


 X  Y  Y  X Y  Y Y  X Y
 Theorem 9(b) is the dual of theorem 9(a) and hence stands proved.

 Theorem 10 (Absorption Law or Redundancy Law)


a  X  X Y  X and (b) X   X  Y   X [10]
 The Proof of absorption law is trivial.
X  X  Y  X  1  Y   X
 Theorem 10(b) is the dual of theorem 10(a) and is thus implied.
 Theorem 10 implies that, if a smaller term appears in a larger term, then the
larger term is redundant.

EEE3131 Jasper Hatilima 2017 22


 To illustrate the underlying concept of theorem 10 consider an example.
 Example 5
By the absorption theorem, we have the expression simplified as
A  A B  A B C  A B C  C  B  A  A
and
 A  B  C    A  B    C  B  A  A  B
 Theorem 11
a  Z  X  Z  X Y  Z  X  Z Y and
[11]
(b)  Z  X   Z  X  Y    Z  X   Z  Y 
 The Proof of theorem 11(a) is done using the method of perfect induction.
Theorem 11(b) is the dual of theorem 11(a) and is thus implied.

EEE3131 Jasper Hatilima 2017 23


 Theorem 12 (Consensus Theorem)
a  X Y  X  Z  Y  Z  X Y  X  Z and
[12]
(b)  X  Y   X  Z   Y  Z    X  Y   X  Z 
 The Proof of theorem 12(a) is done using the method of perfect induction.
Theorem 12(b) is the dual of theorem 12(a) and thus proof is implied.
 By theorem 12, if in a given Boolean expression we can identify two terms
with one having a variable and the other having its complement, then the term
that is formed by the product of the remaining variables in the two terms, in
the case of a sum-of-products expression or by the sum of the remaining
variables in the case of a product-of-sums expression will be redundant.

EEE3131 Jasper Hatilima 2017 24


 Example 6 Illustration of theorem 12.
Prove that
A B C  D  A B C  D  A B C  D  A B C  D
 A B C  D  E  A B C  D  E  A B C  D  E
can be simplified to A  B .
 Solution. A  B  C  D  A  B  C  D  A  B  C  D  A  B  C  D

 A B C  D  E  A B C  D  E  A B C  D  A B C  D  E
 A B C  D  A B C  D  A B C  D  A B C  D
 
 A B  C  D  C  D  C  D  C  D  A B
 A  B  C  D appears in A  B  C  D  E , A  B  C  D appears in A  B  C  D  E
and A  B  C  D appears in A  B  C  D  E .
 As a result, all three five-variable terms are redundant.
 Also, variables C and D appear in all possible combinations, thus redundant.

EEE3131 Jasper Hatilima 2017 25


 Theorem 13 (DeMorgan’s Theorem)
 a   X1  X 2  X 3   X n   X1  X 2  X 3   Xn and [13]
(b)  X 1  X 2  X 3   X n    X 1  X 2  X 3     X n 
 The Proof of DeMorgan’s theorem. Firstly, let us assume that all variables
are in a logic ‘0’ state. In that case
LHS   X1  X 2  X 3   X n   0  0  0   0  0  1
RHS  X1  X 2  X 3   Xn  000  0  111 1  1

 Therefore, LHS = RHS.


 Secondly, let us assume that any one of the n variables, say X 1 , is a logic
HIGH state:
LHS   X1  X 2  X 3   X n   1  0  0   0  1  0
RHS  X1  X 2  X 3   X n  1 0  0   0  0 1 1  1  0

EEE3131 Jasper Hatilima 2017 26


 Once again LHS = RHS.
 Therefore, theorem 13(a) stands proved. Since theorem 13(b) is the dual of
theorem 13(a), the proof is implied.
 DeMorgan’s theorems can thus be interpreted as follows: the first theorem
says that a multi-input NOR gate can be implemented as a multi-input
bubbled AND gate.
 The second theorem, which is the dual of the first, says that a multi-input
NAND gate can be implemented as a multi-input bubbled OR gate.

 Theorem 14 (Involution Law)


XX [14]
 Involution law says that the complement of the complement of an expression
leaves the expression unchanged. Also the dual of the dual of an expression is
the original expression.

EEE3131 Jasper Hatilima 2017 27


 Theorem 15 (Transposition Theorem)
a  
X Y  X  Z   X  Z   X  Y  and
[15]
(b)  X  Y    X  Z   X  Z  X Y
 This theorem can be applied to any sum-of-products or product-of-sums
expression having two terms, provided that a given variable in one term has
its complement in the other.
 The proof of theorem 15(a) can be done using the method of perfect
induction.

Figure 9: Example 7.

EEE3131 Jasper Hatilima 2017 28


 Example 7
Starting with the Boolean expression for a two-input OR gate, apply Boolean
laws and theorems to modify it in such a way as to facilitate the
implementation of a two-input OR gate by using two-input NAND gates only.
Solution.
 A two-input OR gate has the Boolean equation Y   A  B  ,
where A and B are the input logic variables and Y is the output.
 Now,  A  B   ( A  B) Involution law
 ( A  B) DeMorgan’s theorem
Idempotent law
 [( A  A)  ( B  B)]

 Figure 9 shows the NAND gate implementation of a two-input OR gate.

EEE3131 Jasper Hatilima 2017 29


 Example 8
Apply suitable Boolean laws and theorems to modify the expression for a
two-input EX-OR gate in such a way as to implement a two-input EX-OR
gate by using the minimum number of two-input NAND gates only.
Solution.
 A two-input EX-OR gate has the Boolean equation Y  A  B  A  B ,
 Now, A  B  A  B  A  B  A  B Involution law
DeMorgan’s theorem
 A  B A  B

 [ B  ( A  B)]  [ A  ( A  B)]

 ( B  A  B)  ( A  A  B)
 Figure 10 shows the NAND gate implementation of a two-input EX-OR gate.

EEE3131 Jasper Hatilima 2017 30


 EX-OR gate

Figure 10: Example 8.

EEE3131 Jasper Hatilima 2017 31


Dzikomo
Next: Karnaugh Maps

EEE3131 Jasper Hatilima 2017 32

You might also like