Chapter 5 Digital Logic Design
Chapter 5 Digital Logic Design
[EEng--2042 ]
Chapter Five:
Analysis and Synthesis of Combinational Logic
Circuits
Outline
Introduction
An Implementation of Combinational Logic
The Universality of NAND and NOR Gates
Implementation of Combinational Logic Using NAND and NOR Gates
Design of Combinational Logic Circuits
Basic Adder
Comparator
Encoder and Decoder
Multiplexer and Demultiplexer
Parity generator/checker
2
Introduction
The digital system consists of two types of circuits, namely
1.Combinational circuits and
2.Sequential circuits
3
Cont’d...
Sequential circuits contains logic gates as well as memory cells.
Their output depends on the present inputs and also on the states of
memory elements.
Since the output of sequential circuits depends not only on the present
inputs but also on the past inputs, the circuit behavior must be specified by
a time sequence of inputs and memory states.
4
Cont’d...
In previous chapters we have discussed binary numbers, codes, Boolean
algebra and simplification of Boolean function, logic gates, and
economical gate implementation.
Binary numbers and codes bear discrete quantities of information and the
binary variables are the representation of electric voltages or some other
signals.
5
Cont’d...
A combinational circuit consists of input variables, logic gates and out
put variables.
The logic gates accept signals from inputs and output signals are
generated according to the logic circuits employed in it.
Binary information from the given data transforms to desire out put data in
this process.
Both inputs an outputs are obviously
the binary signals, i.e., both the input
and output signals are of two possible
states, logic 1 and logic 0.
Figure 4-1 6
Cont’d...
Figure 4-1 shows a block diagram of a combinational logic circuits.
There are n-number of input variables coming from an electric source and
m-number of output signals go to an external destination.
The source and/or destination may consists of memory elements or
sequential logic circuits or shift registers, located either in the
vicinity/neighborhood of the combinational logic circuit or in a remote
external location.
7
Cont’d...
But the external circuit does not interfere in the behavior of the
combinational circuit.
For n-number of input variables to a combinational circuit, possible
combinations of binary input states are possible.
For each possible combination, there is one and only one possible out put
combination.
A combinational logic circuit can be described by ‘m’ Boolean functions
and each output can be expressed in terms of ‘n’ input variables.
8
Cont’d...
Types of Logic Circuits
Combinational Logic
Memoryless
Outputs are strictly dependent on the combination of input values that are being applied to
circuit right now.
In some books called Combinatorial Logic
Sequential Logic
Has memory
Structure stores history Can ”store” data values
Outputs are determined by previous (historical) and current values of inputs
9
Cont’d...
Logic gates were discussed on an individual basis and in simple
combinations.
When logic gates are connected together to produce a specified output for
certain specified combinations of input variables, with no storage
involved,
10
Cont’d...
Basic Combinational Logic Circuits
SOP expressions are implemented with an AND gate for each product
term and one OR gate for summing all of the product terms.
As you know, this SOP implementation is called AND-OR logic and is the
basic form for realizing standard Boolean functions.
In this section, the AND-OR and the AND-OR-Invert are examined;
the exclusive-OR and exclusive-NOR
NOR gates, which are actually a form of
AND-OR logic, are also covered.
11
Cont’d...
AND-OR Logic
13
Cont’d...
AND-OR-Invert Logic
When the output of an AND-OR circuit is complemented (inverted), it
results in an AND-OR-Invert circuit.
circuit
Recall that AND-OR logic directly implements SOP expressions.
POS expressions can be implemented with AND-OR-Invert logic.
This is illustrated as follows, starting with a POS expression and
developing the corresponding AND-OR
OR-Invert (AOI) expression.
14
Cont’d...
a combination of two AND gates, one OR gate, and two inverters, as shown in
Figure 5.3.
Exclusive-NOR Logic
The complement of the exclusive--OR function is the exclusive-NOR,
which is derived as follows:
17
Cont’d...
Notice that the output X is HIGH only when the two inputs, A and B, are at the same
level.
19
Cont’d...
Note that in this particular expression, the AND operations forming the two
individual terms, AB and CDE, must be performed before the terms can be
ORed.
To implement this Boolean expression, a 2-input AND gate is required to form
the term AB, and a 3-input AND gate is needed to form the term CDE.
A 2-input OR gate is then required to combine the two AND terms.
21
Cont’d...
AB(CD + EF) = ABCD + ABEF
22
Cont’d...
From a Truth Table to a Logic Circuit
We can write the SOP expression from the truth table and then implement the
logic circuit.
The Boolean SOP expression obtained from the truth table by ORing the product
terms for which X = 1 is
X = ABC + AB C
23
Cont’d...
24
Cont’d...
Example Design a logic circuit to implement the operation specified in the truth
table of Table 5–4.
Notice that X=1 for only three of the input conditions. Therefore, the logic
expression is
X = ABC + ABC + ABC 25
Cont’d...
Similarly, the NOR gate can be used to implement the inverter (NOT),
AND, OR, and NAND operations.
The NAND gate is a universal gate because it can be used to produce the
NOT, the AND, the OR, and the NOR functions.
27
Cont’d...
An inverter can be made from a NAND gate by connecting all of the
inputs together and creating, in effect, a single input, as shown in Figure
5–18(a) for a 2-input gate.
An AND function can be generated by the use of NAND gates alone, as
shown in Figure 5–18(b).
An OR function can be produced with only NAND gates, as illustrated in
part (c).
Finally, a NOR function is produced as shown in part (d).
28
Cont’d...
29
Cont’d...
31
Cont’d...
33
Cont’d...
Consider the NAND logic in Figure 5–20. The output expression is
developed in the following steps:
34
Cont’d...
36
Cont’d...
NAND Logic Diagrams Using Dual Symbols
All logic diagrams using NAND gates should be drawn with each gate
represented by either a NAND symbol or the equivalent negative-OR
symbol to reflect the operation of the gate within the logic circuit.
The NAND symbol and the negative-OR
negative symbol are called dual
symbols.
37
Cont’d...
(a) Several Boolean steps are required to arrive at final output expression.
38
Cont’d...
(b) Output expression can be obtained directly from the function of each gate symbol in
the diagram.
Figure 5.13 Illustration of the use of the appropriate dual symbols in a NAND logic diagram.
39
Cont’d...
Example Redraw the logic diagram and develop the output expression for the circuit in
Figure 5.14 using the appropriate dual symbols.
symbols
a
b
Figure 5.15
41
Cont’d...
NOR Logic
A NOR gate can function as either a NOR or a negative-AND, as shown
by DeMorgan’s theorem.
42
Cont’d...
As you can see in Figure 5.16, the output expression (A + B)(C + D) consists of two OR terms
ANDed together.
This shows that gates G2 and G3 act as OR gates and gate G1 acts as an AND gate, as
illustrated in Figure 5.17(a).
This circuit is redrawn in part (b) with a negative-AND
negative symbol for gate G1.
a b
Figure 5.17 43
Cont’d...
NOR Logic Diagram Using Dual Symbols
As with NAND logic, the purpose for using the dual symbols is to make the logic diagram
easier to read and analyze, as illustrated in the NOR logic circuit in Figure 5.18.
When the circuit in part (a) is redrawn with dual symbols in part (b), notice that all output-to-
input connections between gates are bubble-to--bubble or nonbubble-to-nonbubble.
(b) Output expression can be obtained directly from the function of each gate symbol in the diagram.
Figure 5.18 Illustration of the use of the appropriate dual symbols in a NOR logic diagram. 45
Cont’d...
Example Using appropriate dual symbols, redraw the logic diagram and develop the output
expression for the circuit in Figure 5.20.
Redraw the logic diagram with the equivalent
negative-AND symbols as shown in Figure 5.20..
Writing the expression for X directly from the
indicated operation of each gate,
X = (A B + C)(D E + F)
Figure 5.20. Illustration of the use of the appropriate dual symbols in a NOR logic diagram. 46
Design of Combinational Logic Circuits
A combinational circuit can be designed by the following steps of design
procedure.
1. The problem is stated
2. Identify the input variables and output functions
3. The input and output variables are assigned letter symbols
4. The truth table is prepared that completely defines the relationship
between the input variables and output functions
5. The simplified Boolean expression is obtained by any method of
minimization
6. A logic diagram is realized from the simplified expression using logic
gate
47
Cont’d...
A practical design approach should consider constraints like:
Minimum number of gates
Minimum number of output
Minimum propagation time of the signal through the circuit
Minimum number of interconnections
Limitations of the driving capabilities of each logic gates
Since the importance of each constraints is dictated by the particular application, it is
difficult to make all these criteria satisfied simultaneously and also difficult to make a
general statement on the process of achieving an acceptable simplification.
In most cases, first simplified Boolean expression at standard form is derived and then
other constraints are taken care of as far as possible for a particular application.
48
Cont’d...
Basic Adder
Various information processing jobs are carried out by digital computers.
Arithmetic operations are among basic functions of a digital computer.
Addition of two binary digits is the most basic arithmetic operation.
The simple addition consists of four elementary operations which are:
TABLE 5.1 Rule Sum (+) Carry
Rule 1 0+0=0
Rule 2 0+1=1
Rule 3 1+0=1
Rule 4 1+1=0 and carry 1 = 10
+ symbol means add 49
Cont’d...
The first three operations produce a sum of one digit, but the fourth
operation produces a sum consisting of two digits.
The higher significant bit of this result is called the carry.
A combinational circuit that performs the addition of two bits as described
above is called half-adder.
When the augend and addend numbers contain more significant digits, the
carry obtained from the addition of two bits is added to the next higher-
order pair of significant bits.
Here the addition operation involves three bits-the augend bit, addend bit,
and the carry bit and produces a sum result as well as carry.
50
Cont’d...
The combinational circuit performing this type of addition operation is
called a full-adder.
In circuit development two half adders can be employed to form a full-
adder.
Two sample binary addition problems are shown below.
51
Cont’d...
Design of Half Adder
As described above, a half-adder has two inputs and two out puts.
Let the input variables: augend and addend be designated as A and B, and
output functions be designated as S for sum and C for carry.
A half-adder is represented by the logic symbol in Figure 5.21.
The full-adder accepts two input bits and an input carry and generates a
sum output and an output carry.
55
Cont’d...
Full-Adder Logic
The full-adder must add the two input bits and the input carry.
From the half-adder you know that the sum of the input bits A and B is the
exclusive-OR of those two variables, A ⊕ B.
For the input carry (Cin) to be added to the input bits, it must be exclusive-
Ored with A ⊕ B, yielding the equation for the sum output of the full-
adder.
Equation 5-4
56
Cont’d...
58
Cont’d...
Figure 5.26.
(a) The input bits are A = 1, B = 0, and C in = 0.
1 + 0 + 0 = 1 with no carry
Therefore, 1 and Cout = 0.
60
Cont’d...
(b) The input bits are A = 1, B = 1, and C in = 0.
1 + 1 + 0 = 0 with a carry of 1
Therefore, 0 and Cout = 1.
(c) The input bits are A = 1, B = 0, and C in = 1.
1 + 0 + 1 = 0 with a carry of 1
Therefore, 0 and Cout = 1.
61
Cont’d...
Parallel Binary Adders
Two or more full-adders are connected to form parallel binary adders.
A single full-adder is capable of adding two 1-bit numbers and an input
carry.
To add binary numbers with more than one bit, you must use additional
full-adders.
When one binary number is added to another, each column generates a
sum bit and a 1 or 0 carry bit to the next column to the left, as illustrated
here with 2-bit numbers.
62
Cont’d...
63
Cont’d...
To add two binary numbers, a full-adder
adder (FA) is required for each bit in
the numbers.
So for 2-bit numbers, two adders are needed; for 4-bit numbers, four
adders are used; and so on.
The carry output of each adder is connected to the carry input of the next
higher-order adder, as shown in Figure 5.27 for a 2-bit adder.
Notice that either a half-adder can be used for the least significant position
or the carry input of a full-adder can be made 0 (grounded) because there
is no carry input to the least significant bit position.
64
Cont’d...
In Figure 6–7 the least significant bits (LSB) of the two numbers are
represented by A1 and B1. The next higher-order bits are represented by
A2 and B2.
The three sum bits are 1, © 2, and © 3. Notice that the output carry from
the left-most full-adder becomes the most significant bit (MSB) in the
sum, © 3.
65
Cont’d...
Example Determine the sum generated by the 3-bit parallel adder in
Figure 6–8 and show the intermediate carries when the binary numbers
101 and 011 are being added.
Figure 5.28
66
Cont’d...
Four-Bit Parallel Adders
A group of four bits is called a nibble.
nibble
A basic 4-bit parallel adder is implemented with four full-adder stages as
shown in Figure 5.30.
68
Cont’d...
71
Cont’d...
The Ripple Carry Adder
A ripple carry adder is one in which the carry output of each full-adder is
connected to the carry input of the next higher-order stage (a stage is one
full-adder).
73
Cont’d...
Comparators
The basic function of a comparator is to compare the magnitudes of two
binary quantities to determine the relationship of those quantities.
In its simplest form, a comparator circuit determines whether two numbers
are equal.
Equality
The exclusive-NOR gate can be used as a basic comparator because its
output is a 0 if the two input bits are not equal and a 1 if the input bits are
equal.
Figure 6–18 shows the exclusive-NOR
NOR gate as a 2-bit comparator.
74
Cont’d...
1 The input bits are equal. 0 The input bits are not equal.
0 The input bits are not equal. 1 The input bits are equal.
77
Cont’d...
The Basic Binary Decoder
Suppose you need to determine when a binary 1001 occurs on the inputs of
a digital circuit.
An AND gate can be used as the basic decoding element because it
produces a HIGH output only when all of its inputs are HIGH.
Therefore, you must make sure that all of the inputs to the AND gate are
HIGH when the binary number 1001 occurs;
this can be done by inverting the two middle bits (the 0s), as shown in
Figure 6–26.
78
Cont’d...
Figure 5.35. Decoding logic for the binary code 1001 with an active-HIGH
active output.
Example Determine the logic required to decode the binary number 1011 by producing a
HIGH level on the output.
79
Cont’d...
The 4-Bit Decoder
In order to decode all possible combinations of four bits, sixteen decoding
gates are required (24 = 16).
This type of decoder is commonly called either a 4-line-to-16-line decoder
because there are four inputs and sixteen outputs or a 1-of-16 decoder
because for any given code on the inputs, one of the sixteen outputs is
activated.
A list of the sixteen binary codes and their corresponding decoding
functions is given in Table 6–4.
80
Cont’d...
TABLE 6–4
Decoding functions and truth table for a 4-line-to-16
16-line (1-of-16) decoder with active-LOW outputs.
81
Cont’d...
If an active-LOW output is required for each decoded number, the entire
decoder can be implemented with NAND gates and inverters.
In order to decode each of the sixteen binary codes, sixteen NAND gates are
required (AND gates can be used to produce active-HIGH outputs).
82
Figure 5.36. Logic symbol for a 4-line-to-16-line
4 (1-of-16) decoder.
Cont’d...
Encoders
An encoder is a combinational logic circuit that essentially performs a
“reverse” decoder function.
An encoder accepts an active level on one of its inputs representing a digit,
such as a decimal or octal digit, and converts it to a coded output, such as
BCD or binary.
Encoders can also be devised to encode various symbols and alphabetic
characters.
The process of converting from familiar symbols or numbers to a coded
format is called encoding.
83
Cont’d...
The Decimal-to-BCD Encoder
This type of encoder has ten inputs one for each decimal digit and four
outputs corresponding to the BCD code, as shown in Figure 6–36.
This is a basic 10-line-to-4-line encoder.
encoder
85
Cont’d...
86
Cont’d...
Demultiplexers
A demultiplexer (DEMUX) basically reverses the multiplexing function. It
takes digital information from one line and distributes it to a given number
of output lines.
For this reason, the demultiplexer is also known as a data distributor. As
you will learn, decoders can also be used as demultiplexers.
87
Cont’d...
Parity Generators/Checkers
Errors can occur as digital codes are being transferred from one point to
another within a digital system or while codes are being transmitted from one
system to another.
The errors take the form of undesired changes in the bits that make up the
coded information; that is, a 1 can change to a 0, or a 0 to a 1, because of
component malfunctions or electrical noise.
noise
In most digital systems, the probability that even a single bit error will occur
is very small, and the likelihood that more than one will occur is even
smaller.
Nevertheless, when an error occurs undetected, it can cause serious problems
in a digital system.
88
Cont’d...
Basic Parity Logic
In order to check for or to generate the proper parity in a given code, a
basic principle can be used:
The sum (disregarding carries) of an even number of 1s is always 0, and
the sum of an odd number of 1s is always 1.
Therefore, to determine if a given code has even parity or odd parity, all
the bits in that code are summed.
89
Thank You !
90