Unit 1
Unit 1
Notes
UNIT 1 - BASIC GATES AND BOOLEAN
ALGEBRA
CONTENTS
1.0 Aims and Objectives
1.1 Introduction
1.2 Logic Gates
1.2.1 NOT-Gate
1.2.2 OR Gate
1.2.3 AND Gate
1.2.4 NOR Gate
1.2.5 NAND Gate
1.2.6 XOR Gate
1.2.7 Exclusive NOR
1.2.8 Complement and Invertors
1.2.9 Logical Multiplication
1.3 Basic Laws of Boolean Algebra
1.3.1 Boolean Algebraic Properties
1.4 Proof by Perfect Induction
1.5 Simplification of Boolean Expressions
1.6 K-Map Method
1.6.1 Rules for Solving Karnaugh Maps
1.6.2 Representing Boolean Terms
1.7 Tabulation Method with don’t cares
1.7.1 Rules of Tabular Method
1.8 Let us Sum up
1.9 Lesson End Activity
1.10 Keywords
1.11 Questions for Discussion
1.12 Suggested Readings
7
Digital Logic Circuits & Microprocessors
1.1 INTRODUCTION
Majority of computers found in today’s world belong to digital category, other popular
categories being that of analog and hybrid computers. This is not by chance. Digital
computers offer various advantages over other types of computers. Moreover, it is
relatively easier to design.
Digital computers and all the digital circuits in general, make use of just two different
values of electrical signals for all their internal operations, unlike their analog and
hybrid counterparts. The two signals may be called as 1 and 0; TRUE or FALSE; or
ON and OFF.
Mathematical logic also deals with just two quantities – True and False. Likewise,
binary number system uses only two different digits for all its computations.
Therefore, it is only natural that digital circuits obey mathematical logic as also binary
arithmetic. For centuries, mathematicians felt there was a connection between
mathematics and logic, but no one before George Boolean could find this missing link.
In 1854, he invented symbolic logic known today as Boolean algebra. Each variable in
Boolean algebra can have either of two values; true or false and this algebra is applied
to computer electronics.
1.2.1 NOT-Gate
A NOT gate (also called an inverter) is a gate with only one input signal and one
output signal. The output state is always opposite of the input state.
Figure 1.3 shows a transistor inverter. The common-emitter amplifier switches
between cut-off and saturation states. When Vin is low the transistor cuts off and (0 or
+5V) Vout is high. On the other hand, a high Vin saturates the transistor, forcing Vout
to go low.
8
Unit 1 - Basic Gates and Boolean Algebra
Notes
V in V out
Low High
High Low
Table 1.2
V in V out
0 1
1 0
An Inverter is also called a NOT gate because the output is not the same as input.
The output is sometimes called complement (opposite) of the input.
9
Digital Logic Circuits & Microprocessors
Notes Figure 1.4(c) is the symbol for a non-inverting amplifier. A low voltage input
produces a low output.
Consider for example, if we are given a 6-bit register whose output may represent
coded instructions, number, letter and the string of bits called binary word 100101 can
be complemented using Inverters.
Complement of 100101 can be obtained in Figure 1.5(b) and is 011010.
1 1
A A 1
0 0
B B 0
6 bit C 0 0
C 0
register D 1 1
D 1
0 0
E E 0
1 1
F F 1
(a) (b)
1.2.2 OR Gate
The OR gate has two or more input signals but only one output signal such that if any
one or more input signal is high, output signal is high.
10
Unit 1 - Basic Gates and Boolean Algebra
A B Y Notes
0 0 0
0 1 1
1 0 1
1 1 1
A B C Y
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
11
Digital Logic Circuits & Microprocessors
(a) (b)
(c) (d)
Figure 1.9: A 2-input AND Gate. (a) Circuit; (b) Both Input Low;
(c) Low Input High; (d) Both Inputs High
When both inputs are high Figure 1.9(d) both diodes are cut off. Since there is number
current in the resistor, the supply voltage pulls the output to high voltage (+5V).
Table below summarize the action so to get a high output, A and B must be high. This
is why the circuit is called an AND gate.
Similarly, we have three inputs AND gate. If all inputs are low, all diodes conduct and
pull the output down to a low voltage. Even one conducting diode will pull the output
down to a low voltage. Therefore, the only way to get a high output is to have all
inputs high. When all inputs are high, all diode are non-conducting and the supply
voltage pulls the output to a high value. Truth table for three inputs AND gate is given
in table.
12
Unit 1 - Basic Gates and Boolean Algebra
A B Y Notes
0 0 0
0 1 0
1 0 0
1 1 1
A B A+B A B
0 0 0 1
0 1 1 0
1 0 1 0
1 1 1 0
Read this as “Y equals NOT A OR B”. If you use the equation remember that the
ORing is done first then the inversion. Similarly, for 3 and 4 input NOR gates are
shown in Figure below:
13
Digital Logic Circuits & Microprocessors
Notes
(a) Three input NOR Gate (b) Four input NOR Gate
A B A .B A.B
0 0 0 1
0 1 0 1
1 0 0 1
1 1 1 0
14
Unit 1 - Basic Gates and Boolean Algebra
Read this as “Y equals NOT A and B”. If you use this equation, remember that the Notes
ANDing is done first then the inversion. Similarly 3 & 4 inputs NAND gate are shown
below:
A A
B Y B
Y
C
C
D
(a) Three input NAND Gate (b) Four input NAND Gate
A
Y
B
A B Y
0 0 0
0 1 1
1 0 1
1 1 0
15
Digital Logic Circuits & Microprocessors
Notes The XNOR gate is drawn using the same symbol as the XOR gate with an invert
bubble on the output line as is illustrated below:
The output from the XNOR gate is written as A B which reads "A XNOR B".
The truth table for a two-input XNOR gate looks like
A B A B
0 0 1
0 1 0
1 0 0
1 1 1
For a 3-input XNOR gate with inputs A, B and C the truth table is given by
A B C A B C
0 0 0 1
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 0
Other than the four basic operations Boolean algebra also supports complement
of a variable i.e. the opposite of its value. Boolean algebra uses capital
alphabetical letters to denote variables.
16
Unit 1 - Basic Gates and Boolean Algebra
Example: Notes
17
Digital Logic Circuits & Microprocessors
Notes
Example
18
Unit 1 - Basic Gates and Boolean Algebra
19
Digital Logic Circuits & Microprocessors
Notes
A+0=A A in parallel with Identity
open = "A"
20
Unit 1 - Basic Gates and Boolean Algebra
Notes
A+B = B+A A in parallel with B = Commutative
B in parallel with A
The basic Laws of Boolean Algebra that relate to the Commutative Law
allowing a change in position for addition and multiplication, the Associative
Law allowing the removal of brackets for addition and multiplication, as well
as the Distributive Law allowing the factoring of an expression, are the same as
in ordinary algebra.
21
Digital Logic Circuits & Microprocessors
From the table we observed that there are 8 (= 23) possible combinations of the three
variables A, B and C. For each combination, the value of A + BC is the same as that
of (A + B) (A + C), which proves the theorem. Theorems 21 and 22 are known as
DeMorgan’s theorems. These theorems can be proved by first considering the two
variable case and then extending this result. From the truth table given in Table 1.13,
we get the relations.
(A . B)’ + A’ + B’
And
(A + B)’ = A’.B’
Table 1.13: Truth Table to prove DeMorgan’s Theorems
A B A’ B’ (AB)’ A’ + B’ (A + B)’ A’ . B’
0 0 1 1 1 1 1 1
0 1 1 0 1 1 0 0
1 0 0 1 1 1 0 0
1 1 0 0 0 0 0 0
22
Unit 1 - Basic Gates and Boolean Algebra
23
Digital Logic Circuits & Microprocessors
Notes
24
Unit 1 - Basic Gates and Boolean Algebra
Notes
25
Digital Logic Circuits & Microprocessors
Notes To summarize, here are the three basic properties: commutative, associative,
and distributive.
T11 (B C) + (B D) + (C D) = Consensus
(B C) + (B D)
T9: Covering
Number Theorem Name
T9 B• (B+C) = B Covering
26
Unit 1 - Basic Gates and Boolean Algebra
T10: Combining
Number Theorem Name
T10 ( (B C) + (B C) = B Combining
T11: Consensus
Number Theorem Name
T11 (B C) + (B D) + (C D) = Consensus
(B C) + (B D)
27
Digital Logic Circuits & Microprocessors
Notes
Prove using other theorems and axioms:
B•C + B •D + C•D = BC + B D + (CDB+CD B ) T10: Combining
= BC + B D + BCD+ B CD T6: Commutativity
= BC + BCD + B D + B CD T6: Commutativity
= (BC + BCD) + ( B D + B CD) T7: Associativity
= BC + B D T9’: Covering
28
Unit 1 - Basic Gates and Boolean Algebra
Notes
y
y
x 0’ 1
m0 m1 x’y’ x’y
0
m2 m3 xy’ xy
x 1
(a) (b)
0 0 1
1
1 1 x 1 1 1
(a) xy (b) x + y
29
Digital Logic Circuits & Microprocessors
Notes
yz y
x 00 01 11 10
m0 m1 m3 m2 0 x’y’z’ x’y’z x’yz x’yz’
z
(a) (b)
30
Unit 1 - Basic Gates and Boolean Algebra
Notes
yz y
x 00 01 11 10
0 1 1
x 1 1 1
Figure 1.27: Map of example F = x’yz + x’yz’ + xy’z’ + xy’z = x’y + xy’
In a similar manner, the other three squares belonging to the function F are marked by
1s in the map. The function is thus represented by an area containing four squares,
each marked with a 1, as shown in Figure 1.27. The next is to subdivide the given are
into adjacent squares. These are indicated in the map by two rectangles, each
enclosing two 1s. The upper right rectangle represents the area enclosed by x’y; the
lower left, the area enclosed by xy’. The sum of these two terms gives the answer:
F = x’y + xy’
Next consider the two squares labeled mo and m2 in Figure 1.26(a) or xyz and xyz in
Figure 1.26(b). These two minterms also differ by one variable y, and their sum can be
simplified to a two-literal expression:
x’y’z’ + x’yz’ = x’z’
Consequently, we must modify the definition of adjacent squares to include this and
other similar cases. This is done by considering the map as being drawn on a surface
where the right and left edges touch each other to form adjacent squares.
Based on above Table, the minterm for each entry of the truth table can be entered into
a map similar to that shown in Figure below. As a result, the terms can be grouped
according to the corresponding map shown in next Figure where n=2.
31
Digital Logic Circuits & Microprocessors
Notes
The principles outlined in the case of the 2-variable minimisation can be applied to
Karnaugh maps of up to 6 variables. In each case, the min-terms are shown in Figure .
If, as in the case of last example, a new function:
were to be implemented, then min-terms 0 & 1 (the first 2 boxes) would be true. In
this case the function would be simplified to
As the number of input variables increases it becomes more and more difficult to
simplify equations using Karnaugh maps. In these situations computer programs are
employed and techniques such as the Quine-McCluskey method using prime and
essential prime implicants.
Shown in Table are graphical representations of truth tables that provide simplification
of Boolean equations for up to six variables. The ability to solve upto 4-variable K-
Maps is required. Following the table are several rules that should be used in
conjunction with these tables.
Two-Variable (n=2):
Two adjacent squares are combined to eliminate one variable.
The remaining variable is common to both squares.
32
Unit 1 - Basic Gates and Boolean Algebra
Four-Variable (n=4):
Same as Three Variable map.
Eight adjacent squares are combined to eliminate three variables.
Imagine a four element K-map wrapped over a sphere where each of the
sides as well as the top and bottom meet to form adjacent squares.
Five-Variable (n=5):
Same as Four Variable map.
Sixteen adjacent squares are combined to eliminate four variables.
Draw two four variable K-maps side by side. Select the first variable such
as A and label one map A and the other map A . Look for common patters
between both maps to reduce the number of variables.
Six-Variable (n=6):
Same as Five Variable map.
Thirty-two adjacent squares are combined to eliminate five variables.
Similar to Five Variable map but select two variables to operate over the
four, 16-variable K-maps.
Solving with Karnaugh maps can be simplified if don’t care conditions are taken into
consideration. These are typically shown on a K-map as an ‘X’ and is an abbreviation
to show the designer that the specific minterm where the ‘X’ is marked, can either be
taken as a logic 1 or a logic 0. Thus, the grouping of terms as discussed above is much
easier if don’t care conditions are included. Note, do not confuse this with the input
variables X1 X2 etc.
Sum-of-Products
As mentioned below, minterms consist of all the product (AND) terms that can
possibly exist for a function and that appear once. Given n variables, 2n product
terms exist for that function. For example, a function that supports 3 variables
33
Digital Logic Circuits & Microprocessors
Notes will have 23 or 8 individual product terms.The notation used for a function F,
that has three variables, X, Y & Z can be described by it’s minterms, m. The
Boolean function F can be expressed as the logical sum of minterms that produces
a logic 1 or true output for that function. For example the function F can be
represented by minterms 0, 2, 5 and 7 that cause F to be true. This can be represented
by the expression:
Note the four product or AND terms in (2), where each term relates to a
corresponding line and minterm entry in Table. Each of these product terms is
summed (OR’ed), together to form a Sum-of-Products. If all the
minterms (every line in Table), were true then the complete function would be
true i.e., F = 1. Due to the complexity of some expressions the notation used in
(1) is preferred with the exception of extremely simple expressions.
The expanded function F can be represented in diagrammatic form as shown in
Figure below. The Karnaugh map in Table below show how the simplification
can lead to a simplified circuit shown in next Figure.
34
Unit 1 - Basic Gates and Boolean Algebra
Notes
Product of Sums
From the previous example using function F, a Product of Sums can be can be
expressed as:
35
Digital Logic Circuits & Microprocessors
Notes
Another way of interpreting above Table is to write each line where the complement
of the function, is true:
To simplify function F but by using the Product of Sums, we can graphically represent
the function F, defined in Table above but this time collect the logic 0 terms and not
the logic 1 terms as we did earlier. This technique is shown in Table below-
Note: The Dual is obtained by taking the De Morgan of the whole function, then each
term.
36
Unit 1 - Basic Gates and Boolean Algebra
37
Digital Logic Circuits & Microprocessors
Notes
This is because the FIRST RULE of the Tabular method for two terms to combine,
and thus eliminate one variable, is that they must differ in only one digit position.
Bear in mind that when two terms are combined, one of the combined terms
has one digit more at logic 1 than the other combined term. This indicates that the
number of 1’s in a term is significant and is referred to as its index.
EXAMPLES
Example 1 Consider the function: Z = f(A,B,C) = + C+A +
A C
To make things easier, change the function into binary notation with index
value and decimal value.
Tabulate the index groups in a column and insert the decimal value
alongside.
From the first list, we combine terms that differ by 1 digit only from one index
group to the next. These terms from the first list are then seperated into groups
group to the next. These terms from the first list are then seperated into groups
in the second list. Note that the ticks are just there to show that one term has
been combined with another term. From the second list we can see that the
expression is now reduced to: Z = + + C+A
38
Unit 1 - Basic Gates and Boolean Algebra
From the second list note that the term having an index of 0 can be Notes
combined with the terms of index 1. Bear in mind that the dash indicates a
missing variable and must line up in order to get a third list. The final
simplified expression is: Z =
Bear in mind that any unticked terms in any list must be included in the
final expression (none occured here except from the last list). Note that the
only prime implicant here is Z =.
The tabular method reduces the function to a set of prime implicants.
Note that the above solution can be derived algebraically. Attempt this
in your notes.
Example 2 Consider the function f(A, B, C, D) = (0,1,2,3,5,7,8,10,12,13,15), note that
this is in decimal form.
(0000,0001,0010,0011,0101,0111,1000,1010,1100,1101,1111) in binary
form.
(0,1,1,2,2,3,1,2,2,3,4) in the index form.
39
Digital Logic Circuits & Microprocessors
Notes
Sometimes a situation arises in which some input variable combinations are not
allowed.
BCD code has six invalid combinations: 1010, 1011, 1100, 1101, 1110, and
1111.
Since these allowed states will never occur in an application involving the
BCD code, they can be treated as don’t care terms with respect to their effect
on the output. The don’t care terms can be used to advantage on the K-map.
40
Unit 1 - Basic Gates and Boolean Algebra
Notes
Whereas considering the don’t care terms, the expression turns out to be Y A BCD
41
Digital Logic Circuits & Microprocessors
42
Unit 1 - Basic Gates and Boolean Algebra
Notes
1.10 KEYWORDS
AND Gate: A gate with two or more input signals but only one output signal. All the
inputs must be high to get a high output.
Gate: A circuit with one or more input signals but only one output signal.
NAND Gate: A gate with two or more input signals but only one output signal such
that at least one input must be low to get a high output.
NOR Gate: A gate with two or more input signals but only one output signal such that
all inputs must be low to get a high output.
43
Digital Logic Circuits & Microprocessors
Notes NOT Gate: A gate with only one input signal and one output signal. The output state
is always opposite of the input state.
OR Gate: A gate with two or more input signals but only one output signal such that if
any one or more input signal is high, output signal is high.
XOR Gate: A gate with two inputs and a single output which goes high
whenever one and only one input line is high.
44
Unit 1 - Basic Gates and Boolean Algebra
(B + C + D)(A + B) Notes
A B C + A BC
(X + Y + Z)(Y+ Z)(X + Y)
M N O + MN O + M N O
(X + Y + Z)(Y + Z)
ABC + A B C
11. Sum-of-Product Boolean expressions all follow the same general form. As such,
their equivalent logic gate circuits likewise follow a common form. Translate each of
these SOP expressions into its equivalent logic gate circuit:
AB + A B
AB+AB
ABC + A B C + AB C
CYP 2
1. Boolean algebra an algebra that deals with logical propositions which are
either true or false and to simplify such propositions.
2. Gorge Boole
3. A mathematical function in Boolean algebra. For example, w = x + y.z
45
Digital Logic Circuits & Microprocessors
46