Architecture - 1.0 Combinational Logic Circuits
Architecture - 1.0 Combinational Logic Circuits
A combinational circuit is one where the output at any time depends only on the present
combination of inputs at that point of time with total disregard to the past state of the inputs. The
logic gate is the most basic building block of combinational logic. The logical function performed
by a combinational circuit is fully defined by a set of Boolean expressions. Some of the
characteristics of combinational circuits are as follows:
The output of combinational circuit at any instant of time, depends only on the levels
present at input terminals.
The combinational circuits do not use any memory. The previous state of input does not
have any effect on the present state of the circuit.
A combinational circuit can have an n number of inputs and m number of outputs.
The Figure shows the block schematic representation of a generalized combinational circuit having
n input variables and m output variables or simply outputs. Since the number of input variables is
n, there are 2n possible combinations of bits at the input. Each output can be expressed in terms of
input variables by a Boolean expression, with the result that the generalized system can be
expressed by m Boolean expressions as shown.
1
Some of the combinational logic circuits in computer hardware to be covered are:
Half Adder
Full Adder
Subtractors
Comparators
Multiplexers
Demultiplexers
Encoders
Decoders
The Boolean expressions for the SUM and CARRY outputs are given by the equations
SUM (S) = 𝐴. 𝐵 + 𝐴. 𝐵 [=A (X-OR) B]
CARRY (C) = A.B
An examination of the two expressions tells that there is no scope for further simplification. While
the first one representing the SUM output is that of an X-OR gate, the second one representing the
CARRY output is that of an AND gate.
2
Figure 1.1 Half Adder logic circuit.
The half-adder can also be represented in block diagram form as shown in figure 2(c).
Figure 2.0 shows the truth table of a full adder circuit showing all possible input combinations and
corresponding outputs. In order to arrive at the logic circuit for hardware implementation of a full
adder, we will firstly write the Boolean expressions for the two output variables, that is, the SUM
and CARRY outputs, in terms of input variables.
3
Figure 2.0 Full Adder truth table.
The Boolean expressions for the two outputs are given by:
A full adder can also be seen to comprise two half-adders and an OR gate. The expressions for
SUM and CARRY outputs can be rewritten as follows:
Let X be A⊕B
Thus, S = Cin.X + Cin.X
= Cin ⊕ X
⸫ S = A ⊕ B ⊕ Cin
4
Similarly, the expression for CARRY output can be rewritten as follows:
Cout = A. B.Cin + A.B.Cin + A.B.Cin + A.B.Cin
= Cin(A. B + A. B) + A.B(Cin + Cin)
= Cin(A ⊕ B) + A.B
= A.B + Cin(A ⊕ B)
Figure 2.1 shows the circuit symbol and logic circuit of a full adder using two half adders and an
OR gate.
5
iii) Full Adder logic circuit using two Half Adders.
6
For example, given that A=A3A2 A1A0 = 1101 and B=B3B2B1B0 = 1011, the two numbers could be
added as:
The addition process starts by adding the Least Significant Bits (LSBs) of the augend and added.
If 5 bit numbers were to be added, the circuit is implemented by adding one more full adder to the
left.
7
a) Truth table and block diagram
b) Logic circuit
A B Bin D Bout
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 0 1
1 0 0 1 0
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1
In the least significant place of the subtraction a difference can only be obtained by borrowing a 1
from the next most significant state. The difference is now a 1 and this is entered in the least
8
significant place of the difference. However, the borrow has to be replaced and this process is
illustrated in the Bout.
The Boolean expressions for the Borrow out is given by the equation:
If we compare these expressions with those derived earlier in the case of a full adder, we find that
the expression for DIFFERENCE output (D) is the same as that for the SUM output. Also, the
expression for BORROW output Bo is similar to the expression for CARRY-OUT (Cout). In the
case of a half-subtractor, the A input is complemented. By a similar analysis it can be shown that
a full subtractor can be implemented with half-subtractors in the same way as a full adder was
constructed using half-adders. Relevant diagrams are shown in figures 10. Again, more than one
full subtractor can be connected in cascade to perform subtraction on two larger binary numbers.
As an illustration, Fig. 8.5 shows a four-bit subtractor.
9
a) Block diagram
Again, more than one full subtractor can be connected in cascade to perform subtraction on two
larger binary numbers. As an illustration, Figure 8.5.1 shows a four-bit subtractor.
10
8.6 COMPARATORS
Comparators are combinational logic circuits used to compare two binary numbers. They are used
for testing whether the value represented by one binary word is greater than, less than, or equal to
the value represented by another binary word. Two basic types of comparator can be used.
Equality comparators.
Magnitude comparators.
11
Figure 8.6.1(b) Four Bit Equality Comparator
An equality comparator is the simplest multi-bit logic comparator, and can be used for such circuits
as electronic locks and security devices where a binary password consisting of multiple bits is
input to the comparator to be compared with another preset word.
This basic circuit for a magnitude comparator may be extended for any number of bits but the more
bits the circuit has to compare, the more complex the circuit becomes. Figure 8.6.2(b) shows the
logic circuit of a four bit magnitude comparator.
12
Figure 8.6.2(b) Four bit magnitude comparator
8.7 Multiplexers
These are also called data selectors. A digital multiplexer (MUX) is a logic circuit that accepts
several digital data inputs and selects one of them at any given time to pass on to the output. The
routing of the desired data input to the output is controlled by SELECT inputs. If there are n
selection lines, then the number of maximum possible input lines is 2 n and the multiplexer is
referred to as a 2n-to-1 multiplexer or 2n×1 multiplexer. Figure 8.7 shows the functional diagram
of a general multiplexer.
The multiplexer acts like a digitally controlled multi-position switch where a digital code applied
to SELECT inputs controls which data inputs will be switched to the output. For example, output
13
Y will equal data input I0 for some particular SELECT input code, Y will equal data input I1 for
another particular SELECT input code and so on. Therefore, a multiplexer selects 1 out of N input
data sources and transmits the selected data to a single output channel. This is called multiplexing.
I0 2:1
Data inputs MUX Output (Y)
I1
SELECT (S)
14
c) 2:1 MUX logic circuit
Figure 8.7.1 2:1 MUX symbol, truth table and logic circuit
Example
The timing diagram shown below is applied to a two-input multiplexer shown in Fig. 8.7.1
(a). Sketch the output waveform Y.
Solution
If the SELECT line input, S = 0, the output, Y = I0, and if S = 1, Y = I1. These
conditions are applied to sketch the output waveform for the two-input multiplexer
with the given set of waveforms.
Within the time period between t0 - t1, S = 0, therefore Y = I0.
Within the time period between t1 - t2, S = 1, therefore, Y = I1.
15
Notice that within the time period, t0 - t1, the Y waveform is the same as I0 waveform.
Similarly, within the time period t1 - t2, the Y waveform is the same as I1.
From the truth table, the Boolean expression for the output can be represented as shown
below.
Figure 8.7.2 shows the logic symbol, truth table and logic circuit implementation.
a) Symbol
16
b) Truth table
c) Logic circuit
Figure 8.7.2 4:1 MUX (a) Symbol (b) Truth table (c) Logic circuit
17
b) Truth table for 2:1 MUX with ENABLE input
Figure 8.7.3(ii) shows a 4-to-1 multiplexer with an active LOW ENABLE input. When the
input to the ENABLE line is 0, the four AND gates are enabled. When ENABLE is 1, the
operation of the MUX is inhibited.
18
b) 4:1 MUX with ENABLE truth table
19
8.8 DEMULTIPLEXERS
These are also called data distributors. A demultiplexer (DEMUX) performs the reverse operation
of a multiplexer. That is, it takes a single input and distributes it over several outputs. It has an
input line, 2n output lines and n SELECT lines. It routes the information present on the input line
to any of the output lines. The output line that gets the information present on the input line is
decided by the bit status of the selection lines. Figure 8.7.4 illustrates the basic idea of a DEMUX.
8.8.1 1 to 2 Demultiplexer
A 1-to-2 demultiplexer consists of one input line, two output lines and one SELECT line.
Since there are only two possible ways to connect the input to output lines, only one
SELECT signal is needed to do the demultiplexing operation.
The truth table of a 1-to-2 demultiplexer shows that the input routed to Y0 and Y1 depends
on the value of SELECT input S. Output Y1 is active when the combination of SELECT line
and input line are high. Therefore, the output Y1 = S.D and similarly the output Y0 is equal
to 𝑆.D. Figure 8.8.1 show the 1: 2 demultiplexer symbol, truth table and logic circuit.
20
a) Symbol
b) Truth table
c) Logic circuit
21
combination of SELECT lines. The block diagram, truth table and logic circuit of a 1: 4
demultiplexer are shown in figure 8.8.2. From the table, the output logic can be expressed
as minterms and are given as follows:
Y0 = 𝑆0. 𝑆1.I
Y1 = S0. 𝑆1.I
Y2 = 𝑆0.S1.I
Y3 = S0.S1.I
a) Block symbol
b) Truth table
c) Logic circuit
22
8.8.3 1-to-8 Demultiplexer
Figure 8.8.3(a) shows the block diagram of a 1-to-8 demultiplexer that consists of a single
input I, three SELECT inputs S2, S1 and S0 and eight outputs from Y0 to Y7. From the truth
table, the Boolean expressions for all the outputs can be written as follows:
From the obtained output expressions, the logic diagram of this demultiplexer can be
implemented by using eight AND gates and three NOT gates as shown in (c).
a) Block symbol
23
b) Truth table
24
c) Logic circuit
25
8.9 ENCODERS
An encoder is used to generate a coded output (such as binary or BCD) from the active input line.
It has a number of input lines, only one of which is activated at a given time and produces an N-
bit output code, depending on which input is activated. Encoder takes ALL its data inputs one at a
time and then converts them into a single encoded output. Therefore, a binary encoder is a multi-
input combinational logic circuit that converts the logic level “1” data at its inputs into an
equivalent binary code at its output. Generally, digital encoders produce outputs of 2-bit, 3-bit or
4-bit codes depending upon the number of data input lines. An n - bit binary encoder has 2n input
lines and n- bit output lines with common types that include 4-to-2, 8-to-3 and 16-to-4 line
configurations
Figure 8.9 shows a general diagram for an encoder with M inputs and N outputs.
8.9.1 4 to 2 Encoder
A four bit Encoder allows only four inputs such as I0, I1, I2 and I3, and generates two outputs
such as A0 and A1. The assumption is that there are only four types of input signals: 0001,
0010, 0100 and 1000. Figure 8.9.1 shows the circuit symbol, truth table and logic circuit.
One of the main disadvantages of standard digital encoders is that they can generate the
wrong output code when there is more than one input present at logic level 1. For example,
if inputs I1 and I2 are made HIGH (logic 1) at the same time, the resulting output is neither
at 01 nor at 10 but will be at 11 which is an output binary number that is different to the
actual input present. In addition, an output code of all logic 0s can be generated when all
of its inputs are at 0 or when input I0 is equal to one.
a) Symbol
26
b) Truth table
c) Logic circuit
From this table it may be noted that binary output A gives the logic 1 if any of the input
digits D4 or D5 or D6 or D7 is at logic 1. Therefore the Boolean expression for A is given
by:
A = D4 + D5 + D6 + D7
Similarly, the expressions for B and C may be given as:
B = D2 + D3 + D6 + D7
C = D1 + D3 + D5 + D7
Output A is the Most Significant Bit (MSB), while C in the Least Significant Bit (LSB).
The logic circuit for the octal – to – binary encoder with active high inputs is as shown in
figure 8.9.2
27
a) Block symbol
b) Truth table
c) Logic circuit
28
8.9.3 Decimal – to – BCD Encoder
A decimal encoder is also known as a 10 line to 4 line encoder. It accepts 10 inputs and
produces a 4 - bit output corresponding to the activated decimal input. For example, when
line 2 is set to 1 and all other inputs to 0, the output will be 0010. This shows that the output
gives count of the input which is selected. Similarly, if input 5 is set to 1 and others to 0
then its BCD output will be 0101. Figure 8.9.3 shows the circuit symbol, truth table and
logic circuit.
From the truth table, the output expressions could be written as:
A = D1 + D3 + D5 + D7 + D9
B = D2 + D3 + D6 + D7
C = D4 + D5 + D6 + D7
D = D8 + D9
a) Block symbol
b) Truth table
29
c) Logic circuit
Note
The encoder designs described have the following drawbacks:
At any given time, only one input must be active (HIGH).
If the number of active inputs is greater than one, then the output is incorrect.
When no inputs are active, then all outputs are low which is also similar to the
output generated by active input D0.
A priority encoder is used to overcome the short comings of standard encoders.
30
the last row of the table, it implies that, if D7 = 1, then, irrespective of the logic status of
other inputs, the output is 111 as D7 will only be encoded.
8.10 DECODERS
A decoder is a combinational circuit that decodes the information on n input lines to a maximum
of 2n unique output lines. In general, if n and m are respectively the numbers of input and output
lines, then m≤ 2n. It accepts a set of inputs which represents a binary number and activates only
the output that corresponds to the input number. A decoder is thus a special case of a demultiplexer
without the
input line.
8.10.1 2 to 4 Decoder
A 2 to 4 decoder has two inputs and four outputs. It uses all AND gates and so the outputs are
active-HIGH. It may be noted that for a given input code, the only output that is active is the one
corresponding to the decimal equivalent of the binary input code. The output Y0 goes high only
when BA=002=010. Similarly, Y1 goes HIGH only when BA=012=110. The operation of the decoder
is given in the truth table. From the truth table, the expressions for the outputs are:
31
Y0 = 𝐴 𝐵
Y1 = A𝐵
Y2 = 𝐴 𝐵
Y3 = AB
a) Block symbol
b) Truth table
c) Logic circuit
8.10.2 3 to 8 Decoder
This decoder has three inputs designated as A, B and C and eight outputs designated as D0,
D1, D2, D3, D4, D5, D6 and D7. From the truth table, it is clear that, for any given input
combination, only one of the eight outputs is in logic ‘1’ state. Thus, each output produces
a certain minterm that corresponds to the binary number currently present at the input.
32
From the truth table D0, D1, D2, D3, D4, D5, D6 and D7 respectively represent the following
minterms:
D0 = 𝐴 . 𝐵.𝐶
D1 = 𝐴 . 𝐵. 𝐶
D2 = 𝐴 . 𝐵. 𝐶
D3 = 𝐴 . 𝐵. 𝐶
D4 = 𝐴. 𝐵.𝐶
D5 = 𝐴. 𝐵.c
D6 = A.B. 𝐶
D7 = A.B.C
a) Block symbol
b) Truth table
33
c) Truth table
34