You are on page 1of 64

LOGIC GATES Digital Signals A digital signal has two discrete levels or values.

. Two representations of digital signals are as shown below.


5V High 3.5V Low 3.5V 5V

1V Low (a) 0V

1V High 0V (b)

In each case there are two discrete levels and the levels can be represented using the terms LOW and HIGH. Fig (a), the lower of the two levels has been designated as LOW and higher level as HIGH level. In Fig. (b), the designation has been reversed. Digital systems using the representation in Fig. (a) are said to employ positive logic system and those using the other representation of Fig. (b) are said to employ negative logic system.

Truth Tables A truth table is means of describing how a logic circuits output depends on the logic levels present at the circuits inputs e.g. Inputs Outputs A B X 0 0 0 0 1 1 1 0 1 1 1 0 Truth table for three or four inputs can also been drawn depending on the inputs present at circuit. Boolean Expression Its a simple mathematical tool allows the description of the relationship between logic circuit output (s) and its inputs as an algebraic equation e.g.
A B +B =A +B

BASIC LOGIC GATES Logic gates are the basic building blocks for forming digital electronic circuitry. It has one output terminal and one or more input terminals. Some of these gates include:a) INVERTER (or NOT gate) b) AND gate c) OR gate 1

d) e) f) g)

NAND gate NOR gate Exclusive-OR gate (EXOR) Exclusive-NOR gate

The INVERTER, AND and OR gate are the basic gates. The NAND, NOR, Exclusive-OR and Exclusive-NOR gates are derived gates.

(i) The INVERTER or NOT gate Its gate that performs inversion (or complementation) operation. It has one input (A) and one output (B). Its logic symbols are as shown.
A (a) Y A
1

(b)

The truth table of a NOT gate is Input A 0 1 Output Y 1 0

The operation of a NOT gate can be expressed in the Boolean expression as It states that the output X is complement or opposite of the input A i.e. X = 0 if A = 1, and X = 1 if A = 0. AN electronic implementation this gate is as shown.
+5V(VCC ) Vo

X =A

Vi

Inverter electronic circuit

When Vi is low (0 V) transistor is cut off and is unable to conduct, thus full voltage of Vcc is available at the output. Whereas when Vi is high (+5 V), it will make the transistor to conduct and thus giving a low Vo The AND gate Its composed of 2 or more inputs and a single output. Its logic symbol for 2input AND gate is as shown. 2

(ii)

A B

The truth table of a 2-input AND gate is Inputs A 0 0 1 1 B 0 1 0 1 outputs Y 0 0 0 1

Logic operation: An AND gate produces a HIGH (1) output only when all of the inputs are HIGH (1) else the output is LOW (1). Example 1 Determine the total number of possible input combinations of a 3-input AND gate. Sketch a logic symbol and develop a truth table for this logic gate. Solution A 3-input AND gate has eight possible combination i.e. ( 2 3 = 8) . The symbol and truth table of a 3-input AND gate is as shown.
A B C Y

A 0 0 0 0 1 1 1 1

Inputs B 0 0 1 1 0 0 1 1

C 0 1 0 1 0 1 0 1

Outputs Y 0 0 0 0 0 0 0 1

Exercise: Determine the total number of possible input combinations of a 4-input AND gate. Sketch a logic symbol and develop a truth table for this logic gate. Pulse operation of an AND gate Example 2 Consider the two waveforms below:-

A B Y t 1 t2 t3 t 4 t 5 t6

A B

Hence, applying the rules of AND gate as shown in the truth table, the output Y as shown in obtained. Example 3 The Fig. below shows two input waveforms, A and B applied to an AND gate.
A B Y 1 0 1 0 1 0 t1 t2 t3 t4 t5 t 6 t 7 t8 t9 t10 A B Y

Boolean Expression for an AND gate The operation of an AND gate can be expressed in the Boolean expression Y = AB The AND operation can be extended to more than two variables. For example, the three and four input AND operation Boolean expressions are expressed as:Y = ABC and Y = ABCD

The electronic implementation this gate is as shown below.


+5V

A B

D1 D2
AND electronic circuit

When inputs A and B are low, both diodes are connected to +5 V and thus they are forward biased and conduct pulling down the output to low value. If one input is low, the diode with low input conducts pulling down the output to low. If both inputs are high, both diodes being reversed biased get cut-off and supply voltage, high appears at the output, hence its through table.

(iii)

The OR gate OR gate is also basic logic gate from which all logic functions are constructed. It composed of two or more input and one output. The symbol of a 2-input OR gate and its truth table is shown.
A B Y

The truth table of a 2-input OR gate is Inputs A 0 0 1 1 B 0 1 0 1 outputs Y 0 1 1 1

Logic operation: An OR gate produces a HIGH (1) output when any of the inputs are HIGH (1) else the output is LOW (1). Example 4 Determine the total number of possible input combinations of a 3input OR gate. Also draw a logic symbol and develop a truth table for this logic gate. Solution 3 A 3-input OR gate has eight possible combination i.e. ( 2 = 8) . The symbol and truth table of a 3-input OR gate is as shown.
A B C Y

Inputs Outputs 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 Exercise: Determine the total number of possible input combinations of a 4-input OR gate. Sketch a logic symbol and develop a truth table for this logic gate 5

Pulse operation of an OR gate Example 5


A A B Y

B Y t1 t2 t3 t4 t5

Example 6 The Fig. below shows the two input waveforms A and B applied to an OR gate. The resulting output is as shown in waveform Y.
A B Y t 1 t2 t3 t4 t 5 t6 t7 t8 A B Y

Exercise: The Fig. below shows the three input waveforms, A, B, and C applied to an OR gate. Sketch the resulting output waveform at Y.
A A B C

B C

Boolean expression for an OR Gate OR gate operate on the Boolean expression Y= A+B For a three or four input OR gates, the Boolean expressions becomes
Y = A + B + C and Y = A + B + C + D

The electronic implementation this gate is as shown below


A
B

D1 D2
Y

OR electronic circuit

If both inputs are low (0), then both diodes do not conduct, giving low (0) output at Y.If any input is is high, the diode with that high input conducts, giving high (1) output. If both inputs are high, both diodes conduct, giving high (1) output.

UNIVERSAL LOGIC GATES They are referred to as universal logic gates because they can be used to realize any logic expression. They are derived from the basic logic gates. These are NAND and NOR gates. The NAND gate The term NAND is a contraction of NOT-AND. It implies an AND function with a complemented (or inverted) output. The standard logic symbol for a 2-input NAND gate is as shown.
A B Y

The small circle (or a bubble) on its output denotes the inversion operation. Thus a NAND gate operates like an AND gate followed by a NOT as show below.
A B Y

It truth table a 2-input NAND is Inputs A 0 0 1 1 B 0 1 0 1 outputs Y 1 1 1 0

Logical operation of the NAND gate NAND gate produces a LOW (0) output only when all the inputs are HIGH (1). When any of the inputs is LOW (0), the output will be HIGH (1). Pulsed Operation of a NAND Gate In order to determine the output level of an NAND gate, we look at the inputs with respect to each other with reference to the truth table. Some examples are given below 7

Example 7
A A B Y

B Y t 1 t2 t 3 t4 t5 t 6 t7 t8 t9 t 10

Example 8 The figure below shows the two waveforms applied to the NAND gate inputs. Determine the resulting output waveform.
1 A 0 1 B Y 0 1 0 t1 t2 t3 t4 t 5 t6 t 7 t 8 t9 t10 A B Y

Exercise Sketch the output waveform for the 3-input NAND gate shown in the figure below showing its proper time relationships to the inputs
A B C 1 0 1 0 1 0 A B C Y

Boolean Expression for the NAND Gate The Boolean expression representing NAND function is Y = AB This expression means that the two input variables, A and B are first ANDed and then inverted (or complemented) as indicated by the bar over the AND expression. For a three and four input OR gates, the Boolean expressions becomes Y = ABC and Y = ABCD

The NOR gate The term NOR is a contraction of NOT-OR. It implies an OR function with a complemented (or inverted) output. The standard logic symbol for a 2-input NOR gate is as shown.
A B Y

The small circle (or a bubble) on its output denotes the inversion operation. Thus a NOR gate operates like an OR gate followed by a NOT as show below.
A B Y

It truth table a 2-input NOR is Inputs A 0 0 1 1 B 0 1 0 1 outputs Y 1 0 0 0

Logical operation of the NAND gate The NOR gate produces a LOW (0) output when any of the inputs is HIGH (1). The output is HIGH (1) only when all of the inputs are LOW (0).

Pulsed Operation of a NOR Gate Example 10 Consider waveforms A and B applied at the inputs of a 2-input NOR gate as shown.
A B Y t0 t1 t2 t3 t4 t5 t6 A B Y

Exercise Sketch the output waveform for a 3-input NOR gate shown below, showing the proper time relationships to the inputs.
1 0 1 B 0 A 1 C 0 t0 t1 t2 t3 t4 t5 t6

A B C

Boolean Expression for a NOR gate The Boolean expression representing NAND function is Y =A+B This expression means that the two input variables, A and B are first ORed and then inverted (or complemented) as indicated by the bar over the OR expression. For a three and four input OR gates, the Boolean expressions becomes Y = A + B + C and Y = A + B + C + D

The Exclusive-OR and Exclusive-NOR gates Both these gates are formed by combination of the basic gates i.e. Inverter, AND and OR gates. But because of their fundamental importance in many applications, they are treated as basic logic gates with their unique symbols.

The Exclusive- OR (XOR) gate Unlike other gates, this gate has only two inputs and one output. Its logic symbol is as shown.
A B Y

The truth table of a 2-input XOR gate is Inputs A 0 0 1 1 0 1 0 1 B output Y 0 1 1 0

10

Logic Operation The output is HIGH (1) only when the two inputs are at opposite logic levels. The output is LOW (0) when the two inputs are at the same logic levels. Pulsed Operation of a XOR Gate Example 11 Consider the two waveforms, A and B being the inputs of an XOR gate shown. The output waveform is as shown in Y.
1 0 1 B 0 A 1 Y 0 t1 t2 t3 t4 t5 A B Y

Exercise Sketch the output waveform for an XOR gate with the input waveforms as shown in the figure below.
A 1 0

A B t1 t2 t3 t4 t5 t6 t7 t8

1 B 0

Boolean Expression for a XOR gate The Boolean expression representing XOR function is Y = A B = AB + AB The Exclusive-NOR (XNOR) gate It has only two inputs and one output. Its logic symbol is as shown.
A B Y

The truth table of a 2-input XNOR gate is Inputs A 0 0 B output Y 1 11

0 1 1

1 0 1

0 0 1

Logic Operation The output of this gate is HIGH (1) only when the two inputs are at the same logic level. The output is LOW (0) when the two inputs are at opposite logic levels. Pulsed Operation of a XNOR Gate To determine the output waveform, we look at the inputs with respect to each other with reference to the truth table. Some examples are given below:-

Example 12 Consider the two waveforms, A and B being the inputs of an XOR gate shown. The output waveform is as shown in Y.
1 0 1 B 0 A 1 Y 0 t1 t2 t3 t4 t5 t6 t7 A B Y

Exercise Sketch an output waveform for an exclusive-NOR gate with the input waveforms as shown below.
1 A 0 B 1 0

A B

Boolean Expression for a XNOR gate The Boolean expression for an XNOR gate is given by the equation
Y = A B = A B + A B

ASSINGMENT 2 1. Realize the following logic operations using only NOR gates a) NAND (b) XOR (c) XNOR 2. Realize the following logic operations using only NAND gates NAND (b) XOR (c) XNOR

[9 marks] [9 marks]

12

Determination of Boolean Expression for a Logic Circuit Irrespective of how complex a logic circuit is, it can completely be described using the Boolean expressions. Consider the circuit below
A B C Y = (A.B) + C

Also consider the circuit below


A B C A +B Y = (A + B).C

Example 13 Write the Boolean expression for output Y for logic circuit shown the figure below.
A B C
A
A+ B + C

AD

Y = A + B+ C+ AD

AD

Example 14 Write the Boolean expression for output Y for logic circuit shown the figure below.
A B C D E Y

A+ B

(A+ B) C

(A+ B) C

(A+ B) C + D

Thus, the Boolean expression for the final output is


Y = ( A + B )C + D E

Exercise Determine the Boolean expression for the output X for the logic circuit shown in the figure below. 13

A B C D E Y

Evaluating the Boolean Expression for the Logic Circuit Output After obtaining the Boolean expression as shown above, the output logic can be determine for any set of input levels. The following general rules are followed. (i) First, perform all inversions of single terms; i.e. 0 =1 or 1 =0 (ii) Then perform all operations within parentheses. (iii) Perform an AND operation before an OR operation unless parentheses indicates otherwise (iv) If an expression has a bar over it, perform the operation of the expression first then invert the result. Example 15 Suppose we want to know the logic level Y for the circuit below for the case where A = 0, B =1, C =1 and D = 1 .
A B C

A
B

A+ B

A+ B

Y = (A+ B) BC

Substituting the values of the variables A, B, and C into the output expression have
Y = ( A + B )B C Y =( 0 +1 )1.1

Y =(1 +0)1.1

Y =(1)1.1

Y = 0.1.1 =0

Determination of a Truth table for a Logic Circuit Once the Boolean expression for all the possible combination of the inputs variables have evaluated as shown above, the result can be summarized in a truth table. To illustrate this concept, consider the circuit below.

14

A B

A+ B

Y =(A+ B)(B+ C )
C

B+ C

We can then evaluate all the possible combination of the input variables and determine the logic level of the final output. The results are as shown in the table below. Inputs A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 output Y 0 0 1 1 1 0 1 1

Implementing Logic Circuits from Boolean Expression A logic circuit can be implemented directly from Boolean expression. For example, a circuit defined by Y = ABC , can be implemented using a 3-input AND gate. If on the other hand a circuit is defined by Y = A + B , then a two-input OR with an NOT gate on one of the input terminal is used to implement it. This can be extended to more complex logic circuits. C B Example 16 Construct a circuit whose output is Y =A +BC+A C Solution A, , B The expression has three terms ( C B C A C ) which are ORed together. Hence it shows that a 3-input OR gate is required with inputs equal to A, C B C a d A C , respectively i.e. , n B
AC BC Y = AC+ BC+ ABC

A BC

Since each OR gate input is an AND product term, then it means that an AND gate with appropriate inputs can be used to generate each of these terms i.e.

15

AC

B C

BC

Y = AC+ BC+ AB C

A BC

Example 17 Sketch the logic circuit for the Boolean expressions: a) (A +B) C b) AB+C Solution
(a) A B C

A
B

A+ B

(A + B ) C

(b)

A B C

A
C

AB

AB+ C

Exercise Construct the logic circuits that can implement the Boolean expressions: a) Y = AB + AB Y =W +P Q b) Y = A (C +D B ) c) Y =(A +B+C DE) +BC D d) The Universality of NAND and NOR Gates These gates can be used to implement the basic gates as well as each other. The NAND gate as a universal logic gate An INVERTER can be made from a NAND gate by connecting all of its inputs together i.e.
A

Y = A .A = A

A B

It can be used as an AND gate as


AB

Y = AB

16

It can also be implemented as an OR gate as


A

Y = A B = A+ B
B

The NOR gate as a universal logic gate Like NAND, NOR gate can be used to implement the INVERTER i.e.
A

Y = A+ A = A

An OR can be performed by connecting a 2-input gates as shown


A B

A+ B

Y = A+ B = A+ B

An AND gate operation can be performed by connecting 3 NOR gates as show.


A
Y = A+ B = AB

COMBINATIONAL LOGIC DESIGN Introduction 17

Boolean algebra theorems are used for the manipulations of logic expressions. It has been shown that a logical expression can be realized using the logic gates. The number of gates and the number of input terminals for the gates required for the realization of a logical expression, in general, get reduced considerably if the expression can be simplified. Thus, simplification of logical expression is very important as is saves the hardware required to design a specific system. Basically, digital circuits are divided into two broad categories: (i) Combinational circuits, and (ii) Sequential circuits In combinational circuits, the outputs at any instant of time depend upon the inputs present at that instant of time. Thus, these circuits have no memory. There are other types of circuits in which the outputs at any instant of time depend upon the present inputs as well as the past inputs/outputs. This implies that they have memory. Such circuits are known as sequential circuits. The design requirements of combinational circuits may be specified in any of the following ways: (i) A set of statements (ii) Boolean expression, and (iii) Truth table There are two approaches to the design of combinational circuits. One is the traditional method, where the given Boolean expression or the truth table is simplified by using standard methods and the simplified expression is realized using logic gates. The other method does not require any simplification of the logical expression or truth table; instead the complex logic functions available in medium scale integrated circuits (MSI) can be directly used. Computer-aided design (CAD) tools are used for the design using Programmable logic devices (PLDs). Boolean algebra and logic simplification Boolean algebra is a convenient and systematic way of expressing and analyzing the operation of logic circuits. Its named after George Boole who invented it. Laws and rules of Boolean algebra The main laws which are necessary for manipulating different Boolean expressions. 1) OR Rules A+ 0 = A (i) (ii) A+1 = 1 (iii) A+ A = A (iv) A+ A =1 2) AND Rules A .0 = 0 (i) A .1 = A (ii) A.A = A (iii) A.A = 0 (iv) 18

3) Laws of Complementation 0 =1 (i) 1 =0 (ii) (iii) If A =1, then A = 0 (iv) If A = 0, then A =1 (v) A =A 4) Commutative laws These laws allow changes of position of variables in OR and AND expressions (i) A + B = B+ A A . B = B. A (ii) 5) Associative laws These laws allow removal of brackets from logic expressions and regrouping of variables. A + (B + C) = (A + B) + C (i) (A + B) + (C + D) = A + B+ C+ D (ii) A .(B . C) = (A . B). C (iii) 6) Distributive laws These laws permit factoring or multiplying out of an expression A(B + C) = AB + AC (i) A + BC = (A + B)(A + C) (ii) (iii) A + AB = A + B 7) Absorptive laws These laws are used in reduction of a complex expression to a simpler form by absorbing some of the terms into existing terms (i) A + AB = A A(A+ B) = A (ii) A A +B = A ( ) B (iii) Example 1: Prove the following Boolean identity AC + ABC = AC Solution AC + ABC = AC(1 + B) (But 1 + B = 1 ) Then

AC(1 + B) = AC .1 = AC A + ABC = AC C

Example 2 Prove that the following Boolean identity (A + B)(A + C) = A + BC Solution Let y = (A + B)(A + C) = AA + AC + BA + BC
= A + AC + BA + BC
= A(1 + B) + AC + BC

= A + AC + BC

19

= A(1 + C) + BC

= A+ BC Example 3 Prove the following Boolean identity A + AB = A + B Solution Let y =A +AB


= A .1 + AB
= A +B +AB (1 )

= A + AB + AB

= A+ B Example 4 Using the truth table, show that the Boolean expression A + AB = A
A 0 0 1 1 B 0 1 0 1 AB 0 0 0 1 A+AB 0 0 1 1

= A +B (A +A)

Hence, from the table, the columns of A and A+AB are the same and hence A + AB = A Example 5 Using the truth table, show that the Boolean, A + AB = A + B A 0 0 1 1 B 0 1 0 1
A AB A+ AB

1 1 0 0

0 1 0 0

0 1 1 1

A+B 0 1 1 1

An inspection of the fifth and sixth columns indicates that they are the same. This verifies that A + AB = A + B
( A + B )( A + C ) = A + BC

Example 6 Using the truth table, show that the Boolean expression,

A 0 0 0 0 1 1 1 1

B 0 0 1 1 0 0 1 1

C 0 1 0 1 0 1 0 1

A+B 0 0 1 1 1 1 1 1

A+C 0 1 0 1 1 1 1 1 20

(A+B)(A+C) 0 0 0 1 1 1 1 1

BC 0 0 0 1 0 0 0 1

A+BC 0 0 0 1 1 1 1 1

The sixth and the eighth columns are the same. This verifies that
( A + B )( A + C ) = A + BC

Example 7 Using the Boolean laws and rules simplify the expression and implement the minimized expression using logic gates: y =ABD+AB D Solution
y =AB D +AB D

=A (D +D ) (Using B

= A (1) (Using the rule A + A = 1 ) B

distributive law)

= AB
B A

Y = AB

Example 8 Using the Boolean laws and rules, simplify the following expression and implement the minimized expression using logic gates: x = ACD + ABCD Solution
x = ACD + ABCD
=(A +AB C ) D
A B

= (A + B) CD (Since A + AB = A + B )
A+ B

(Using distributive law)

Y = (A+ B) CD
C D

CD

Example 9 Using Boolean algebra techniques, simply the expression:


z = AB + A(B + C) + B(B + C)

Solution

z = AB + A(B + C) + B(B + C)

= AB + AB + AC + BB + BC (Using distributive law) = AB + AB + AC + B+ BC (Since BB = B ) = AB + AC + B+ BC (Since AB+ AB = AB ) = AB + AC + B (Since B+ B C = B ) = AC + B (Since AB+ B = B )


B A C

z = B+ AC

AC

Example 10 Using laws and rules of Boolean algebra simplify the Boolean the following expression and implement the simplified expression.
z =[A B (C +B ) +A B ] C D

Solution
z =[A B (C +B ) +A B ] C D =(A BC +AB B +A B ) C D

(Using distributive laws) 21

=(A B C+A .0. D +A B ) C (Since B B = 0 ) =(A B C +0 +AB ) C (Since A .0. D = 0 )

= AB C C + AB C (Using distributive = ABC+A BC (Since CC = C ) =(A +A) B C (Factoring out B C ) =1. B C (Since A+ A ) = BC
B C

laws)

z = BC

Exercise (i) Simplify the following Boolean expression and draw the logic circuits for the simplified expressions. y = AB =AB C+A C +B C (ans: AC + B ) C B a) y = B(A +C +C A +B +A ) ( ) C (ans: AB +C ) b) c) z = ABC + AB C + A B C + ABC + ABC (ans: AB + BC + B C ) De Morgans Theorem De Morgan proposed the following theorems that are an important part of Boolean algebra: Theorem 1: The complement of a product of variables is equal to the sum of the complements of the variables i.e. Theorem 2: The complement of a sum of variables is equal to the product of the complements of the variables i.e.
A+B = A . B

AB = A + B

A B

In terms of logic circuits, theorem 1 can be illustrated as


AB
A B

A+ B

A B

In terms of logic circuits, theorem 2 can be illustrated as


A+ B
A B

A.B

Example 11 Apply De Morgans theorems to the following Boolean expressions with 3 variables: a) X Z and Y b) X +Y + Z Solution a) X Z , applying De Morgans theorem 1 Y X Z = X+ Y+ Z Y b) X +Y + Z applying De Morgans theorem 2 22

X +Y + Z

= X.Y.Z

Example 12 Using Boolean algebra simplify the following expression.


Z = A +A + A BC B C

Solution
Z =(A ) .(A ) + A B C B C

= (A + B).(A + C) + ABC = AA + AC+ AB+ BC+ ABC = A + AC + AB + BC = A + AB + BC = A + BC Example 13 Simplify the Boolean expression
T ( x, y, z ) = ( x + y )[ x ( y + z )] + x y + x z

Solution Given the Boolean expression


T ( x, y , z ) =( x + y )[ x ( y + z )] + x y + x z = ( x + y )[ x +( y + z )] + x y + x z = ( x + y )[ x +( y.z )] + x y + x z

= ( x + y )( x + yz ) + x y + x z = xx + xyz + xy + yyz + x y + x z = x + xyz + xy + yz + x y + x z = x (1 + yz + y ) + yz + x y + x z = x + yz + x y + x z = ( x + x y ) + yz + x z = x + y + yz + x z = ( x + x z ) + ( y + yz ) =x+z +y +z = x + y + ( z + z) = x + y +1

=1
Exercise (i) Simplify the following expression using De Morgans theorem and Boolean algebra laws and rules a) b) c)
Y = ( B +C )( B +C ) + A + B +C

Z =(C +D ) + A CD + A B + A C + A D C B D C
A CD B

ASSINGMENT 3 (i) (ii) (iii)


)(A +B )( A +C = A ) C Prove the following Boolean identity (A +B Prove the following Boolean identity A B A B = A+ B B B (B ) Prove the following identity A C +ABC+A C =A +C

23

(iv) (v) (vi) a) b) c)

Simplify the following Boolean expression


A C + AB C + A B + A C + AB C B C B

Simplify the following expression and show the minimum gate B implementation. y =A C D +AB C D +B C D Simplify the following expression using De Morgans theorem and Boolean algebra laws and rules
W =R ST .( R + S +T )

X = ABC + ABC + ABC + A BC + AB C


A( B +C ) D

SIMPLIFICATION OF LOGIC CIRCUITS Broadly there are two methods to simplify Boolean algebra: (i) Simplification using Boolean algebra and (ii) Simplification using Karnaugh maps. Simplification using Boolean algebra This method is as had been explained earlier. Such a simplification leads to the simplification of logic circuit..

(i)

Example 14 Determine the Boolean expression for the output of the logic circuit shown below. Solution The Boolean expression for the output of the logic circuit is,
Y = B ( A +C ) C B

Simplifying the expression, have


Y = B ( A +C ) C B = B ( A .C ) C B
=B ( A .C ) C B = B [ A +B ]C C
A B C Y

= B [ A C +B C ] C

= A B C +B B C C C = A BC + 0 = AB C

The simplified expression can be implemented as

24

A B C

Y= ABC

Example 15 Figure (a) below shows a logic circuit with the inputs A and B. The waveforms at the inputs are also shown in figure (b). Determine the minimized circuit and then sketch the waveform at the output.
10 ms

A A B (a) Y B
5 ms 5 ms 10 ms

(b)

Solution The output of the logic circuit is Y =( A +B ). B Applying the De Morgans theorem 1 to the terms on the right, have
Y = A+B +B

= A+B +B = A+B

B A Y

The resulting waveform at Y is obtained by adding the waveforms at A and B and is as shown.
A 10ms B 5ms

Y = A+ B

Example 16 Using Boolean algebra minimize the logic circuit shown below.

25

A B

Solution The output of the logic circuit is Y = A +( A + B ) Applying De Morgans theorem 2 to the right side, have,
Y = A .( A +B )

= A( A + B ) = A + AB ) A = A + AB )

=A Hence, a minimized logic circuit has no logic gate. The output is equal to the value of A itself. In other words the given logic circuit is redundant.
Example 17 The circuit shown below is used to implement the function Z = f ( A, B ) = A + B . What values should be selected for I and J.
J I A Y

= A(1 +B )

Solution The above circuit is redrawn as shown below.


J I A 1

A+ I
4 3

Y = A+ B

A+ J

Y = ( A + J )( A + I )

Since the output Y is given to be equal to A + B , therefore, A + B = AI + AJ + JI Comparing the terms on the left and right on the above equation, have that, A = AJ .(i) B = A I + JI ...(ii) and From equation (i), if J = 1 then A = A.1 . Hence J = 1 From equation (ii), B = ( A + J ) I = ( A +1) I =1.I = I , Thus, J = 1 and B = I 26

= 0 + AI + AJ + JI = AI + AJ + JI

= A A + AI + AJ + JI

Example 18 The figure below shows a combinational logic circuit. Obtain a simplified Boolean expression for this circuit at V, W, X, Y and Z in terms of input variables A, B and C.
Y A B V

Solution The logic circuit is redrawn and each is numbered as shown.


5 A B 2 V Y

AV
1

AB
7

X+ Y

3 C

X =V + W

V+ A+ B+ C

The output of gate 2 is V = AB Applying De Morgans theorem1, we get


V = A +B

(i) The output of gate 3 is

= A + B ...

W =V + A + B + C (ii)

Substituting for V from (i) in equation (ii), we get


W = ( A + B ) + A + B +C = ( A + A) + ( B + B ) +C

W = (1 + B +C

= 0 ..

= 1

(iii) The output of gate 5 is 27

Y =A V

...

(iv) Substituting the value of V from equation (i) into equation (iv) we get
Y = A = A( A + B ) V

= AA + AB
=0 + A B

(v) The output of gate 6 is


X =V +W

=A B

.....

Substituting the value of V and W for equation (i) and (iii) we get
X = A +B +0 = A + B +1 = 1

= 0 .. (vi) Finally, the output of gate 7 is Z = X + Y ... (vii) Substituting for X and Y from (v) and (vii), we get
Z =0 + AB

=A B

= AB
STANDARD FORMS OF BOOLEAN EXPRESSIONS Each Boolean expression can be converted into either of two forms: (i) Sum-of-Product (SOP) form or (ii) Product-of-Sum (POS) form

(i) Sum-of-Product (SOP) Form In Boolean algebra, a product term (also called min-term) is the product of literals (or Boolean variables). In logic circuit circuits, a product term is produced B by AND operation with no OR operation e.g. AB , AB , A C , AB CD . A product term is equal to 1 if and only if each of the literals in the term is 1. Its equal to 0 when one or more of the literals are 0. When two or more product terms are ORed, the resulting expression is called a Sum-of-Product (SOP) e.g. AB + BCD , ABC + CDE + B CD , AB + A B E + B D . SOP expression can contain a single variable term but a single overbar cannot extend over more than one variable, although more than one variable in a term can have an overbar e.g. A BC can be a term in SOP expression but not A C . B

Domain of a Boolean expression 28

The domain of a Boolean expression is the set of variables contained in the expression in either complemented or uncomplemented form e.g. the domain of the expression AB + A BC is the set of variables, A, B and C. D.

Implementation of Sum-of-Products (SOP) Expression SOP expressions can be implemented by AND-OR logic. For example, implement the SOP expression AB + A BC + AC .
A
B A

Y = AB+ ABC+ AC

C
A

NB: The no. of AND gates is equal to the number of terms in the sum-of-products expression. Conversion of a General Expression to Sum-to-Products (SOP) Form Any logic expression can be converted to SOP using Boolean laws e.g.
A( BC + D) = ABC + AD

Example 19: Convert the following Boolean expressions to SOP form. a) ( A + B)( C + B ) b) ( A +B C )C Solution ( A + B )( C + B ) = AC + AB + BC + BB a)
= AC + AB + BC + 0 = AC + AB + BC

b)

( A + B C )C = A + B C C C

= AC + B C

d) Standard Sum-of-Product Form A standard SOP expression is one in which all the variables in the domain appear B C C in each product term of the expression e.g. A C D + A B D + AB D . If in any product term one of the literals is missing, then the expression is a nonB C standard SOP expression e.g. AB C + A D + A Standard SOP expressions are very important in constructing the truth table or the K-map.

Conversion of Product term to a Standard Sum-of-Product (SOP) Form 29

The procedure is as follows:(i) Identify the non-standard product terms in the given expression. Multiply each such product term by a term made up of the sum of a missing variable and its complement (ii) Repeat step (i) until all resulting product terms contain all variables in the domain in either complemented or uncomplemented form.
B Example 20 Convert the Boolean expression AB C +A B +A C D to standard SOP form. Solution
AB C +A B +A C D = AB C[ D +D ] +A B[C +C ][ D +D ] +A C D B B = AB C +AB CD + A B +A C ][ D +D ] +A C D D [ C B B

= AB C +AB CD +A B D D C

+ A B D + A C D +A C D +A C D C B B B

Example 21 Convert AB C + B CD + AC D to a standard SOP form. Solution


AB C + B C + AC D = AB C[ D + D ] + B C [ A + A ] + AC D[ B + B ] D D

= AB C + AB CD + AB C + A B C + A C D + AB C D D D D B

(ii)

The Product-of-Sums (POS) Form In the Boolean algebra, a sum term (or max-term) is the sum of literals or variables e.g. A + B , A + B + C , A + D etc. A sum term is equal to 1 when one or more of the literals in the term are 1 and equal to 0 iff each of the literal is 0 e.g. ( A + B )( A + B + D )( A + B +C + D ) or ( A + B +C )( A )( A + B )

The Standard form of POS A standard POS expression is one in which all the variables in the domain appear in each sum term of the expression e.g.
( A + B + C + D )( A + B + +C + D )( A + B + C + D )

If one of the literals is missing in any max-term, then the expression is nonstandard e.g. ( A + D )( A + B + D )( A + B +C + D)

Converting a Sum Term to a Standard Product-of-Sums (SOP) Form The procedure is as follows:(i) Identity the non-standard sum term in the given expression. To each nonstandard sum term, add a product term consisting of a missing variable and its compliment (ii) Apply the following rule of algebra : A + BC = ( A + B )( A + C ) (iii) Repeat step (i) until all sum terms contain all variables in the domain in either complemented or uncomplemented form. Example 22 Convert the following Boolean expression to its standard form 30

( A + B +C )( B ++ + D )( A + B +C + D ) C

Solution Given ( A +B +C )( B +C

+ D )( A + B +C + D ) ( A + B +C + DD )( AA + B ++ + D )( A + B +C + D) C

( A + B +C + D )( A + B +C + D )( A + B + + + D )( A + B +C + D )( A + B +C + D ) C

Exercise Convert the Boolean expression

( A + B )( B +C )

Converting Standard Sum-of-Product (SOP) to Standard Product-of-Sum (POS) The procedure is as follows:(i) Evaluate each product term in the SOP expression i.e. determine the binary number which represents the product terms. (ii) Determine all the binary numbers not included in the evaluation in step (i) (iii) Write the equivalent sum term for each binary number from step (ii) and express in POS form. NB: A similar procedure is used for the reverse. Example 23 Convert the following Sum-of-Product (SOP) expression toan equivalent Product-of-Sums (POS) expression. A B C + A B C + A BC + AB C + ABC Solution On evaluating each term have
A B C + A B C + A BC + AB C + ABC

000 + 001 + 011 + 101 + 111

Since the possible combination is 2 3 = 8 , then the remaining terms are those for POS i.e. 010, 100 and 110. Since these are binary values that make the sum term 0, therefore the equivalent POS expression is,
( A + B +C )( A + B +C )( A + B +C )

Convert SOP Expression to Truth Table Format The procedure is as follows:(i) List all the possible combinations of binary values of the variables in the given expression. (ii) Convert the SOP expression to standard form if it is not already so (iii) Place a 1 in the output column (Y) for each binary value that makes the standard SOP expression a 1 and place a 0 for all the remaining values. Example 24 Construct a truth table for the following expression:
A B C + AB C + ABC

Solution On evaluating each term have


001 + 100 + 111 , hence the truth table becomes,
A B C + AB C + ABC

INPUTS B 31

OUTPUTS Y

0 0 0 0 1 1 1 1
A B + A C + A + AB C B C

0 0 1 1 0 0 1 1

0 1 0 1 0 1 0 1

0 1 0 0 1 0 0 1

Example 25 Develop a truth table for the following Boolean expressions: Solution
A B + A C + A + AB C = A B + A C + A +C + AB C B C B

Standardizing the expression we have,


AB + A B C + A + AB C C + =C A B( + C ) + A B C C ( A + A) ( B + B ) + AB C

+ + A(B B ) C (

= AB C A BC

+ A BC + ABC

+ A B C + AB C

+ AB C

+ A BC

+ ABC

+ ABC

+ A B C

+ AB C

(Some product terms are repeated and one of the repeated terms is retained while the rest are discarded). Thus, the required expression is,
= A BC + A BC + AB C + A B C + A B C + AB C + AB C

Its truth table is A 0 0 0 0 1 1 1 1 INPUTS B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 OUTPUTS Y 1 1 1 1 1 1 1 0

Converting Product-of-Sums (POS) Expression to a Truth Table Form Since a POS expression is equal to 0 only if at least one of the sum terms is equal to 0, then the procedure is: (i) List all the possible combinations of binary values of the variables (ii) Convert the POS expression to standard form if it is not already so. (iii) Place a 0 in the output (Y) for each binary value that makes the expression a 0 and place a 1 for all the remaining binary values. Example 26 Construct a truth table for a standard POS expression
( A + B +C )( A + B +C )( A + B +C )

Solution 32

Given the expression ( A + B +C )( A + B +C )( A + B +C ) , converting to binary equivalent have (1 +1 + 0)( 0 +1 +1)( 0 + 0 + 0) . Hence the truth table becomes, A 0 0 0 0 1 1 1 1 INPUTS B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 OUTPUTS Y 0 1 1 0 1 1 0 1

Example 27 Develop the truth table for the following standard POS expression
( A + B )( A + B +C )( A + B + D )( A + B +C + D )

Exercise (i) Find the canonical Sum-of-Products form for the expression given below
f ( A, B, C ) = A + A B + A C + A + A C B B C

(ii) (iii) (iv) (v)

Also find POS expression for the expression in (i). Determine the canonical POS form and canonical SOP form of the Boolean expression f ( A, B, C ) = B C Find the min terms or canonical SOP form and max terms or canonical POS form for the function f ( A, B, C ) = A C + AC . Find the max terms or canonical POS form of the function f ( A, B, C ) , which is represented by the truth table Decimal value 0 1 2 3 4 5 6 7 A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1
+ A B +C D as C

C 0 1 0 1 0 1 0 1

f(A,B,C) 0 1 1 0 1 0 0 1

(vi)

Express f ( A, B, C , D) = AB the product of max terms.

the sum of min terms and as

The Karnaugh Map (K-Map) Another method of minimizing expression is using a K-map. It provides a simple set procedure for minimizing the Boolean functions. 33

K-map is similar to a truth table in that it presents all the possible values of input variables and the resulting output of each value. But instead of being organized into columns and rows like a truth table, the K-map is an array of squares or cells in which each square represents a binary value of the input variables. Each square is denoted by a binary number or its decimal equivalent e.g. if the function consists of three-variables, then the K-map has 8(23) squares and for four is 16 (24) squares. These maps are as shown below:A
B

a) 2-variable K-map
0 1 0 AB AB 1 AB AB

b) 3-variable K-map
AB C

00

01
ABC A BC

11
ABC
A BC

10
ABC A BC

0 ABC 1 A BC

c) 4-variable K-map
AB D C

00

01

11

10

00 A B C D A B C D A BC D A B C D 01 A B C D A B C D A B C D A B C D 11 A BC D A BC D A BC D ABC D 10 A BC D A BC D ABC D ABC D

Minimizing SOP Expression Using K-Map Any function to be minimized or to be reduced is first written in standard Sum-ofProduct form and its min-terms are then written. Each min-term is then converted to its equivalent binary number and a marking 1 is made in the corresponding square in the map. This is referred to as mapping a SOP expression on the K-map. Example 28 Map the following SOP expression on the K-map:
A B C + A BC + A BC + ABC

Solution 34

AB C

00

01

11 1

10

0 1 1 1

A B C + A BC + A BC + A BC

Example 29 Map the following standard sum-of-products (SOP) expression on a Kmap:


A B D +A C C BD +A C D +A B C D +A C D +A B C D +AB CD +A C B B BD

Solution
B A D C
ABCD

00 1 1

01

11 1 1 1

10
A BC D A BC D
A BC D

00 01
A BC D

11 10 1

A BC D

ABC D ABC D

Example 30 Map the following non-standard sum-of-products (SOP) expression on a B K-map: A + A B + A C Solution First the given expression is standardized as follows:A ( B +B )( C +C ) + A B (C +C ) + A C B

= 011 + 010 + 001 + 000 + 001 + 000 + 110 or = 011 + 010 + 001 + 000 + 110
ABC ABC

= A BC + A BC + A B C + A B C + A B C + A B C + AB C

or

AB C

00 1 1

01 1 1

11 1

10

0 1

A BC

A BC

ABC

After the Boolean expression has been mapped on the K-map, there are three steps in the process of obtaining a minimum SOP expression. 35

a)

c)

(i) Grouping the 1s the adjacent 1s are grouped with the objective of maximizing the size of the groups and to minimize the number of groups using the following rules:A group must contain either 1,2,4,8 or 16 squares b) Each square in the group must be adjacent to one or more squares in that same group but all squares in the same group do not have to be adjacent to each other. Always include the largest possible number of 1s in accordance to rule (a). d) Each 1 on the K-map must be included in at least one group. The 1s already in a group can be included in another group as long as the overlapping groups included non-common 1s. (ii) Determining the Product term for each group the minimum product term and hence the minimum sum-of-products expression is obtained using the following rule: a) Each group of squares containing 1s creates one product term composed of all variables that occur in only one form within the group are eliminated. These are called contradictory variables. (iii) Summing the resulting product terms all the derived minimum product terms are summed together to form the minimum sum-of-product expression. Example 31 Simplify the following expression using a K-map:
Y = A B + A B C + A C + AB C B

Solution First the given is standardized i.e.


Y = A B (C +C ) + A B C + A C + AB C B

= A B + A BC + A B C + A C + AB C C B

Next the standard SOP expression in mapped on to a K-map i.e.


AB C

00

01 1

11 1

10 1
AC

0 1 1

AC

AB

Hence the simplified expression is,


Y = A C + A B + AC

Example 32 Simplify the following SOP expression using the K-map:


Y = A BC D + AB C D + A B C D + A C D + A C D + A C B B B D

Solution 36

The expression is already in standard form and therefore its mapped directly to the K-map.
AB D C

00

01

11 1

10
AB C

00 01 11 10 1 1

1 1

CD

ABD

Hence the simplified expression is,


Y = A D + A C +C D B B

Example 33 Simplify the following SOP expression using the K-map:


Y = BC D + A BC D + A C D + A B D + A C B C B D

Solution First the given is standardized i.e.


Y = . BC D +A BC D +A C D +A B D 1 B C +A C BD

=( A + A ) BC D + A BC D + A C D + A B D + A C B C BD

= A C D + A BC D + A BC D + A C D + A B D + A C B B C B D

Next the standard SOP expression in mapped on to a K-map i.e.


A CD B

00

01 1 1 1

11 1 1 1

10
BC

00 01 11 10

BD

Hence the simplified expression is,


Y = BC + BD

Mapping directly on K-map from a Truth Table A truth table representing an output of a Boolean expression can be mapped directly on a K-map. To illustrate this, consider the truth table below. INPUTS 37 OUTPUTS

A 0 0 0 0 1 1 1 1 On mapping it becomes,
AB

B 0 0 1 1 0 0 1 1

C 0 1 0 1 0 1 0 1

Y 0 1 0 1 0 1 1 1

00

01

11 1

10

Example 34 Implement the following Boolean expression using minimum number of 3-input NAND gates.
f ( A, B, C , D ) =1, 2, 3,4, 7, 9,1 ,1 ) ( 0 2

Solution The expression above can be represented in form a truth table as, Decimal number 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 INPUTS B 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 C 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0 1 1

OUTPUTS F 0 1 1 1 1 0 0 1 0 1 1 0 1 0 0 0

38

Then the variables in the truth are mapped on a K-map as


A CD B

00

01 1

11 1

10
BC D BCD

00 01 11
ACD

1 1 1 1

BCD

10

Hence the resulting simplified expression is


f ( A, B, C , D ) = B C D +B C D + A C D +B C D

This can be implemented using 3-input NAND gates as shown below.


A B C D

BC D

BCD ACD

BCD

IMPLICANTS When a Boolean expression of four or less variables is represented on a K-map, then the set of adjacent minterms or the simplified SOP term are called the implicants of the expression. (i) Prime-implicant An implicant is called prime-implicant of the expression if it is not a subset of any other implicant of the expression. Each product term individually is a prime-implicant.

39

(ii)

Essential prime-implicant a prime-implicant which includes a 1 cell, which is not included in any other prime-implicant, on the K-map, is known as an essential prime-implicant of the function.
AB D C

00
I

01

11
VI
V

10

00 01 11 10

II III

IV

From the above K-map, there are six prime-implicants I, II, III, IV, V and VI each formed by a pair of two adjacent minterms. Prime-implicant I and VI are essential prime-implicants because one of their minterms is not included in any other primeimplicant.
AB C

00 1

01 1 1

11

10 1

0 1

From above K-map, no prime-implicant is essential thus it is called a cyclic-primeimplicant map. This is because each minterm is included in at least two implicants. Example 34 (b): Find the set of prime-implicants and the minimum expressions of the expression below using s a K-map. f ( A, B, C , D) = ( 0,1, 2,3, 4, 6,8,9,10,11) Solution:
AB D C

00
1

01 1

11

10
1

00 01 11 10

1 1

1 1

40

From the group of 8 cell pairs ( 0,1, 2,3,8,9,10,11) have a minterm of B From the group of 4 cell pairs ( 0, 2, 4, 6 ) have a minterm of AD . Thus, the two mintems above are prime-implicants. Both are essential primeimplicants because prime-implicant B contains some mintems i.e. 1,3,8,9,10,11 which are not included in any other prime-implicant. Similarly the prime-implicant AD contains some minterms i.e. 4, 6 which are not included in any other primeimplicant. The minimum expression is f ( A, B, C , D) = B + AD Dont Care conditions In digital design sometimes a situation arises in which some input variable conditions are not allowed e.g. in BCD code, there are six invalid combinations. Since these are unallowed states in BCD code, they can be taken as either 1 or 0. This is what is called dont care condition. These dont care terms can be used to advantage on the K-map for simplification of logic equations. Consider a combinational circuit which produces a 1 output corresponding to a BCD input equal and greater than six. The output is 0 if the input is less than six. In form a truth table, it is as shown. INPUTS A 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 B 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 C 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 OUTPUTS Y 0 0 0 0 0 0 1 1 1 1 x x x x x x

Then this can be mapped on a K-map as,

41

A CD B

00

01

11 x

10 1 1 x x

00 01 11 10 1

x x x

x 1
BC

Hence the simplified expression is,


Y = A + BC Example 35 Consider the K-map shown below. Determine the logic function represented by the map and simplify it in the minimal form.
A CD B

00 1

01

11 x

10 x 1

00 01 11 10

1 x 1 x

x 1

Solution
A CD B

00 1

01

11 x

10 x 1
AC

00 01 11 10

1 x 1 x

x 1

BD

BD

42

The resulting simplified function is,


Y = AC + BD + B D

Minimizing POS expression using a K-map The POS expression is obtained from a K-map in the same manner as it is found from the truth table.
( Example 36 Consider a Boolean function f ( A, B, C , D ) =0, 3,12 ,15 ) . The above SOP expression can be written in POS as,

f ( A, B, C , D ) =0, 3,1 ,1 ) = , 2, 4, 5, 6, 7, 8, 9,1 ,1 ,1 ,1 ) ( 2 5 (1 0 1 3 4

Thus mapping it to a K-map, we obtained


A CD B
(A+ B) 01 11

00

10 0

00 01
(C+ D )

0 0 0 0 0 0 0
(C + D)

0 0 0

11 10

(A + B)

Hence
f ( A, B, C , D ) = ( A + B )( A + B )( C + D )( C + D )

Example 37 Obtain the minimal POS expression for the Boolean function given below using a four variable K-map. f ( A, B, C , D ) = (3, 4, 6, 7,11,12 ,13 ,14 ,15 ) Solution

43

A CD B

(B + D)

00

01 0

11 0 0

10

00 01 11 10 0

(A + B)

0 0

0 0

( C + D)

Hence
f ( A, B, C , D ) = ( A + B )( B + D)( C + D )

Example 38 Minimize the multiple-output Boolean function given below, using fourvariable K-map.
f ( A, B, C , D ) = 1, 2, 6, 7, 8,13 ,14 ,15 ) + 3, 5,12 ) ( (
x

Where the min-terms with x are dont care conditions. Solution


A CD B

00

01

11 x

10 1
ACD
AB

00 01 11 10 1 x 1
AC

AD

x 1 1

1 1 1

Hence
f ( A, B, C , D ) = A + A C + AC D + A D B

ASSIGNMENT 4 44

(i)

Obtain the minimal SOP expression for the Boolean function given below using the K-map.
f ( A, B, C , D) = 0, 3, 4, 7, 8) + 10 ,11,12 ,13 ,14 ,15 ) ( (
x

(ii) Express the Boolean function, f = A + B C in sum-of min-terms (iii) Find the set of prime-implicants from the function given below and obtain the minimum expression/expressions using a K-map. f ( A, B, C , D) = (0,1, 2,5, 7,8,9,10,13,15) (iv) Express the Boolean function f (v) Express the Boolean function :
= A + A C in B

product-of max-terms.

in product-of-sums form (vi) Simplify the following Boolean functions using K-map: f ( A, B , C ) = 0, 2, 3, 4, 6) ( a) f ( A, B, C , D ) =0,1, 2, 4,5, 7,1 ,1 ) ( 1 5 b) (vii) Given the logical function f ( A, B, C ) = ( A + B +C )( A + B +C ) . Express it in the standard sum-of-products form.

f ( A, B, C , D ) =0,1, 2, 5, 8, 9,1 ) ( 0

PRACTICAL DESIGNS OF COMBINATIONAL CIRCUIT

45

All arithmetic operations can be implemented using adders from basic logic gates. Some of these logic circuits are discussed below.

The Half-Adder The logic symbol of a half adder is as shown


A Half - adder B Cout S

Thus it accepts two inputs and produces two digits on the output: a sum bit (S) and a carry bit (Cout). The truth table of a half-adder is Inputs A 0 0 1 1 B 0 1 0 1 S 0 1 1 0 outputs Cout 0 0 0 1

The Boolean expression for the sum output (S) can be expressed as
S = AB + A B

= A B .

(1) And the Boolean expression for the carry output is C = AB ..(2) The two equations can be implemented using logic circuits as
A B S

Cout

The Full-Adder The logic symbol of a full-adder is as shown


A B Cin Full - adder Cout S

A full-adder accepts three inputs (two-input A and B, and a carry input (Cin)) and two outputs: a sum output (S) and a carry-output (Cout). 46

The truth table of a full-adder is A 0 0 0` 0 1 1 1 1 Inputs B 0 0 1 1 0 0 1 1 Outputs Cin 0 1 0 1 0 1 0 1 S 0 1 1 0 1 0 0 1 Cout 0 0 0 1 0 1 1 1

S = A B C in + A BC in + AB C in + ABC

The Boolean expression for the sum output as obtained from the truth table is in .

(3)
= A ( B C in + BC in ) + A( B C in + BC in )

= A ( B C in ) + A( B C in ) ....

(4) Let Y = B C in , then equation (4) can be written as,


S = A.Y + A.Y

= A Y ..

(5) Replacing Y with B C in , equation (5) can be written as


S = A ( B C in ) = A B C in ....

(6) The Boolean expression for the carry-output is as shown with three ABC added since it has common factors with each of the other terms.
C out = A B in + AB C in + AB C in + ABC C = B in ( A + A) + AB C in + A C in C B =B C =B C
in in

in

terms

+ AB C in + A C in B + A in + A C in C B

=C in ( B + AB ) + A C in B
in

= BC in + A(C in + BC in )

= BC in + AC in + AB ...

(7) Equation (6) and (7) can be implemented by using logic gates as

47

A B Cin S

Cout

Full-adder

and

S = A B C in

A full-adder can also be implemented using two half-adders. For a full-adder, the two output equations are,

C out = A BC in + AB C in + AB C in + ABC = ( A B + AB )C in + AB (C in + C in )

in

= ( A B )C in + AB

Hence the full-adder logic circuit using two half-adder is


A A Halfadder B Cin B C out B S
A B

A Halfadder

Sum
A B C

Cout
(A B) C in

Carry output
(A B) C in + AB

Parallel Adders As shown above, a single full-adder can add two 1-bit numbers and an input carry. Thus, to add binary numbers with more than one bit, parallel adders are used. To add two binary numbers, a full adder is required for each bit in the number. Thus, for two-bit numbers, two full-adders are used. Similarly, four full adders are required to add four-bit numbers. A block diagram of a basic 2-bit parallel adder using two full-adders is as shown.

48

A1 A Fulladder Cout

B1 Cin B

A0 A Fulladder

B0 Cin B

Cout

S2 (MSB)

S1

S0 (LSB)

Similarly, a 4-bit parallel adder can be constructed using four full adders in parallel as shown.
A3 A Fulladder C out S C out B3 C in B A Fulladder S C out B A2 B2 Cin A Fulladder S Cout B A1 B1 Cin A Fulladder S B A0 B0 C in

S2 (MSB)

S3

S2

S1

S0 (LSB)

DECODERS A decoder is used to decode the binary information in a digital system by changing it into some other type of number system, preferably decimal or hexadecimal number system. It converts an n-bit binary input code into a maximum of 2n unique output lines. A 3 to 8 line decoder is as shown. A practical application of this decoder is binary to octal conversion. The input variables will represent three binary digit number and output will represent the eight digits in the octal number systems. ENCODERS This is just the reverse of decoding. It has 2n or less input lines and n output lines. For example an octal to binary encoder is as shown below.

49

D0 = CBA

A ( LSB )

D1 = CBA

D 2 = CBA
B

D3 = CBA

C ( MSB )

D 4 = CBA

D5 = CBA

D6 = CBA

D7 = CBA

A 3 to 8 line decoder

D0 D1 D2 D3 D4 D5 D6 D7

Octal to binary encoder

50

MULTIPLEXERS (MUX) It is also known as data selector. It accepts several data inputs and selects only one of them at a time and directs it to a single output line. A 4 line to 1 multiplexer is as shown below.
S1 S0

I0

I1

I2

I3

4 to 1 line multiplexer

The logic symbol and truth table of this MUX are


4 1MUX
Y

Output

S1

S0

Block diagram of MUX

S1 0 0 1 1

S0 0 1 0 1

Y I0 I1 I2 I3

Exercise: With the aid of truth tables, draw the logic circuits of the following Multiplexers a) 2 to 1 MUX b) 8 to 1 MUX 51

DEMULTIPLEXER [DEMUX] It is also known as data distributor. It does the reverse of the multiplexer i.e. it takes in a single input and distributes over several outputs. The select inputs will determine or decide, to which output the data input will be transmitted. For example, a 1 to 4 line demultiplexer with it truth table is as shown below. Inputs Data inputs I I I I S1 0 0 1 1 S0 0 1 0 1 Y3 0 0 0 1 Y2 0 0 1 0 Outputs Y1 0 1 0 0 Y0 1 0 0 0

Exercise: With the aid of truth tables, draw the logic circuits of the following Multiplexers c) 1 to 2 DEMUX d) 1 to 8 DEMUX
I

S1

S0

Y0 = ( S2 ,S1 ) I

Y1 = ( S2 ,S1 ) I

Y2 = ( S2 ,S1 ) I

Y3 = ( S2 ,S1 )I

1 to 4 line demultiplexer

52

ELEMENTS OF SEQUENTIAL LOGIC CIRCUITS Introduction Unlike combinational logic circuits, sequential logic circuits have memory elements which store the previous output information of the circuit to be used as feedback. A block diagram of a sequential logic circuit is as shown.
Inputs Output Memory elements

Combinational circuit

T he

Block diagram of Sequential circuit

storage elements are devices capable of storing binary information. The binary information stored in these elements at any given time defines the state of the sequential circuit at that time. The sequential circuits receive binary information from external inputs. These inputs, together with the present state of the storage elements, determine the binary of value of outputs. They also determine the condition for changing the state in the storage elements. Thus a sequential circuit is specified by a time sequence of inputs, outputs, and internal states. The differences between combinational and sequential circuits are as shown in the table. Combinational Circuit Its output at any instant of time depends on input applied simultaneously at that time. It contains no memory elements It can be totally described by the set of output values only. It is easy to design, due to absence of memory Faster in speed because all inputs are primary inputs applied simultaneously. It needs more hardware for its realization. It is expensive in cost. Sequential Circuit Its output depends on the present inputs and previous history of inputs It contains at least one memory elements. It s performance is totally described by the set of subsequent state values as well as set of output values. It is difficult to design due to presence of memory. Comparatively slower in speed because it has secondary inputs also, which are applied after a delay. It needs less hardware for its realization It is cheaper in cost.

53

FLIP-FLOP (FF) A general symbol for a flip-flop is as shown.


Q

Inputs

Flip-flop
Q

Normal output Inverted output

Flip-flop Symbol

It has two outputs labeled as Q and Q that are inverse (or complement) of each other. When a reference of the state of the flip-flop is made, its usually referring to the state of its normal (Q) output. There are two operating states of the flipflop. One is when Q =1, Q = 0 which is called HIGH state or 1 state or SET state. The other is when Q = 0, Q =1 which is called LOW state or 0 state or RESET state. The flip-flop can have one or more inputs as shown in the block diagram. A flipflop is also called a latch or bistable multivibrator.

Latch Its the most basic type of flip-flop circuit. When a flip-flop operated without the clock, its referred to as a latch. There are two types of latches depending on whether a NAND or a NOR gate is used to construct it. NAND gate Latch Its construction is as shown
SET 1
Q

CLEAR

NAND gate latch

Operation: Normally, the SET and CLEAR inputs of the latch are resting in the HIGH state. If the output needs to be changed, one of the inputs is changed to LOW. For example, when SET = CLEAR = 1, there are two possible output states. If Q = 0 and Q =1 , the inputs of NAND-2 are 0 and 1, which produces Q =1 . The 1 from Q causes NAND-1 to have 1 at both inputs to produce a 0 at Q .The second case is when Q =1 and Q = 0 . This shows that the HIGH from NAND-1 54

produces a LOW at the NAND-2 output, which in turn keeps the NAND-1 output HIGH. Thus, as long as SET = CLEAR = 1, the output Q =1 and Q = 0 . If CLEAR=0 AND SET= 1 and the outputs are Q = 0 and Q =1 , then Q = 0 keeps NAND-2 output HIGH with the LOW at CLEAR having no effect. If CLEAR = 1, the latch outputs still remains Q = 0 and Q =1 . This can be summarized in a truth table below: Inputs SET 1 0 1 0 CLEAR 1 1 0 0 Outputs No change
Q =1 Q =0
Q =Q =1 (invalid)

NOR gate Latch Its construction is as shown.


SET 1
Q

CLEAR

NOR Gate Latch

Operation It operation is similar to the NAND gate latch but the SET and CLEAR inputs are active-HIGH rather than active-LOW. The results are given in the truth table below. Inputs SET 0 1 0 1 (i) CLEAR 0 0 1 1 Outputs No change
Q =1 Q =0

invalid

SET = CLEAR = 0: This condition is the normal resting state for the NOR latch. It has no effect on the output state. In other words, Q and Q will remain in the same state in which they were prior to this input condition. 55

(ii) (iii) (iv)

SET = 1, CLEAR = 0: This condition always causes the output to go to Q =1 state where it will remain even after SET returns to 0. SET = 0, CLEAR = 1: This condition will always causes the output to go to Q = 0 state where it will remain even after CLEAR returns to 0. SET = 1, CLEAR = 1: This condition tries to set and clear the latch simultaneously. It produces invalid results and should not be used.

CLOCKED SIGNALS Digital systems are of two types: (i) Asynchronous systems: in these systems, the outputs of logic circuits can change state any time one or more of the inputs change. They are generally more difficult to design and troubleshoot than a synchronous. (ii) Synchronous systems: In these systems, the exact time at which the output can change states are determined by a signal commonly called a clock. Clocked signal is generally a rectangular pulse train as shown in the figure below.
Rising edge 1 0 Time (a) Rectangular pulse train Falling edge

A square wave can also be used as clock signal as shown.

Rising edge 1 0 (b) Square Wave

Falling edge

The synchronization in a digital system is accomplished through the use of clocked flip-flops that are designed to change states on one or the other of the clocks transitions Clocked flip-flops have a clock input that is labeled as CLK, CK or CP. But CLK is commonly used. The CLK can either be edge triggered or level-triggered. Edge triggered means the CLK is activated by a signal transition and is indicated by the presence of a small triangle on the CLK input. The triggering transition can either be the rising or the falling edge. The two cases are represented in a block diagram form as shown.

56

SET

SET

CLK

CLK

CLR

CLR

(a) rising edge triggering

(b)Falling edge triggering

CLOCKED S-R FLIP-FLOP The logic symbol and truth table of an S-R flip-flop are as shown below:
S
SET

CLK

CLR

(a) Symbol

INPUTS S 0 1 0 1 R 0 0 1 1

OUTPUT Q Q0 (no change) 1 0 Invalid

(b) Truth table Figure (b) shows the truth table for a clocked S-R flip that is triggered by the rising edge of the clock signal. Its operation can easily understood with the help of input and output waveforms as shown. Note that the flip-flop is not affected by the falling edge of the clock pulses. It may also be noted that S and R input levels have no affect on the flip-flop except upon the occurrence of a rising edge of the clock signal.

57

1 S 0 1 R 0 1 CLK 0 1 Q 0 No change Set Reset Set Set

Typical input and output waveforms for a S -R flip-flop

S-R Logic gate implementation Below is a simplified version of a internal circuitry of an edge-triggered S-R flipflop. The circuit contains three sections: (i) A basic NOR latch (ii) A pulse steering circuit and (iii) An edge-detector circuit
S 1 Edge detector CLK 2 Pulse-steering circuit 4
Q

NOR Latch

Edge-triggered S-R flip-flop

CLOCKED J-K FLIP-FLOP The logic symbol and truth table of J-K flip-flop are as shown below:

58

SET

CLK

CLR

(a) Symbol

INPUTS J 0 1 0 1 K 0 0 1 1

OUTPUT Q Q0 (no change) 1 0 Q0 (toggles)

(b) Truth table Its operation can easily understood with the help of input and output waveforms as shown
J 1 0 1 K 0 1

CLK 0 1 Q 0 No change Toggle Reset Set No change Toggle Reset

Typical input and output waveforms for a J -K flip-flop

Initially all the inputs are 0, and the Q output is also assumed to be 0, i.e. Q0 = 0 When the rising edge of the first clock pulse occurs, J = K = 0 condition exists. Thus the flip-flop does not change its output state, i.e. Q = Q0 = 0 . When the rising edge of the second clock pulse occurs, J = K = 1 condition exists. Thus the flip-flop toggles to its opposite state i.e. Q = Q0 = 0 = 1 .

59

When the rising edge of the third clock pulse occurs, J = 0 and K =1 condition exists. Thus the flip-flop is cleared to the Q = 0 state. When the rising edge of the fourth clock pulse occurs, J =1 and K = 0 condition exists. This condition sets the output Q to 1 state. When the rising edge of fifth pulse occurs, J =1 and K = 0 condition exists. This is the condition that sets the output Q to 1. However since Q is already 1, so it will remain there. Hence no change in the output state. When the rising edge of sixth pulse occurs, J = K = 1 condition exists. This is the condition causes the flip-flop to toggle to its opposite state. When the rising edge of seventh pulse occurs, J = 0 and K =1 condition exists. This is the condition causes the clear to Q = 0 state.

J-K Logic gate implementation Below is a simplified version of a internal circuitry of an edge-triggered S-R flipflop. The circuit contains three sections: (i) A basic NOR latch (ii) A pulse steering circuit and (iii) An edge-detector circuit

1 Edge detector 2

CLK K

Internal circuitry of an edge -triggered J-K flip-flop

(iv) (v)

The only difference between the internal circuitry of edge-triggered J-K flipd flop and S-R flip-flop is that in J-K, Q an Q outputs are fed back to the pulse steering NOR gates. It is because of this feedback connection that J-K flip-flop gives the toggle operation for J = K = 1 condition.

THE J-K MASTER-SLAVE FLIP-FLOP All the sequential circuits that we have been covered so far have problem (All the level sensitive sequential circuits have this problem). Before the enable input changes state from HIGH to LOW, if inputs changes, then another state transition occurs for the same enable pulse. This sort of multiple transition problem is called 60

racing. We can overcome this problem using a two stage J-K flip-flop as shown in the block diagram below.
J

SET

SET

K
CLK

CLR

CLR

In the figure above there are two latches, the first latch on RHS is called master latch and the one on LHS is called slave latch. Master latch is positively clocked and slave latch is negatively clock. The internal logic circuit of the master-slave J-K flip-flop is as shown below. During the posive edge of the clock signal, the inputs are first passed on to the master flip-flop while the the slave flip-flop is disabled. During the the negative edge of the clock siganal, the master flip-flop is disabled while the slave is enabled. Hence the output of the master flip-flop becomes the inputs of the slave flip-flop and are passed as the output Q and Q .

K Q
CLK

Q
J

CLOCKED D FLIP-FLOP The logic symbol and truth table of J-K flip-flop are as shown below:
D
SET

CLK
CLR

(a) Symbol

61

Inputs D 0 1

output Q Q 1

(b) Truth table The output Q will go to the same logic level as the present logic level of D input when the rising edge occurs at the CLK. In other words, the level present at D will be stored in the flip-flop at the instant the rising edge occurs. Consider the waveforms below:

1 D 0

1 CLK 0 1 Q 0 Input and output waveforms to illustrate the operation of clocked D flip -flop

An implementation of D flip-flop using J-K flip-flop is as shown below.


D
J

CLK

Q
K

D-LATCH The logic symbol of a D-latch is as shown below:

62

D-Latch Symbol

Its logic gate implementation is also as shown below. It consists of two NOR gates connected as shown with complement inputs. Its truth table is similar to that of a D flip-flop with the exception that in the later, the inputs are controlled by a clock signal while in this case the input are not controlled. As the inputs are fed to the gates, they are manipulated by the gates based on the present levels of the outputs and a next output is produced. For such a logic circuit, its sometimes difficult to predict the output of latch.
D

T FLIP-FLOP This flip-flop is also called a Toggle flip-flop since its outputs toggles continuously based on the clocked changes its value. It based on the characteristic of a J-K flip-flop when both its inputs are at logic level 1. It logic symbol is as shown:
T=1 CLK

SET

CLR

Logic symbol for T flip-flop

The logic gate implementation of this flip-flop look like this:-

63

T=1

Q
Logic circuit of a T flip-flop

The output of the circuit toggles or changes its state from low to high or from high to low depending on the previous state of the output at very instant of positive going edge of the clock signal. Hence it truth table is as shown below Inputs T 0 1 output Q Q 1

Consider the waves below:-

1 T 0 1 CLK 0 1 Q 0

Based on the truth table of a T flip-flop, its Q output is as shown.

64

You might also like