Digital Logic Chapter 4 Combinational Logic Circuits
Digital Logic Chapter 4 Combinational Logic Circuits
Combinational Logic
Circuits
Combinational Circuits
A combinational circuit is a digital logic circuit composed by logic gates whose outputs at any time are
determined directly from the present combination of inputs without any regard to previous inputs. The
digital logic gates are the building block of combinational circuits. A combinational circuit performs a
specific information-processing operation fully specified logically by a set of Boolean functions. Adder,
subtractor, multiplexer, demultiplexer, encoder and decoder are the common example of combinational
logic circuit.
The basic components of a combinational circuit are: input variables, logic gates, and output variables.
The 'n' input variables come from an external source whereas the 'm' output variables go to an external
destination. In many applications, the source or destination is storage registers.
Half Adder
The Half Adder is a type of combinational logic circuit that adds two of the 1-bit binary digits. It
generates carry and sum of both the inputs. The Half Adder does not add the carry obtained from the
previous addition to the next one. Let A and B are the input and carry C and sum S are the output
generated by half adder. The block diagram and truth table of the half adder is shown in figure below:
Inputs Outputs
A B C S
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
Figure – Block diagram of the Half adder Figure – Truth table of half adder
From truth table, Boolean expression for sum and carry is as follows:
⊕
.
Figure – Logic diagram of the half adder
Full Adder
The Full Adder is also a type of combinational logic that adds three of the 1-bit binary digits for
performing an addition operation. It generates a sum of all three inputs along with a carry value. The
Full Adder, along with its current inputs A and B, also adds the previous carry.
Let inputs are A, B and Cin. Where, A & B are the two parallel significant bits and Cin is the carry bit,
which is generated from previous stage. This Full adder also produces two outputs sum S & carry Cout.
The block diagram and truth table of the half adder is shown in figure below:
Inputs Outputs
A B Cin Cout S
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
Figure – Block diagram of the Full adder Figure – Truth table of Full adder
From K-map the Boolean expressions for sum and carry are
⊕ ⨁
⊕ ⊕
Figure – Block diagram of the half subtractor Figure –Truth table of the half subtractor
From the truth table, Boolean expression for sum and carry is as follows:
⊕
Figure – Block diagram of the full subtractor Figure –Truth table of the full subtractor
⊕ ⊕
⊕ ⊕
From K-map the expression for Borrow out is
. . .
The logic circuit for full subtractor is given as
This 4-bit binary subtractor produces an output, which is having at most 5 bits. If Binary number A is
greater than Binary number B, then MSB of the output is zero and the remaining bits hold the magnitude
of A – B. If Binary number A is less than Binary number B, then MSB of the output is one. So, take the
2’s complement of output in order to get the magnitude of A – B.
Controlled inverter
Controlled inverter is a logical circuit, which is used to invert the input. In other word the output of the
controlled inverter is 1’s complement of the input. If the controlled signal C is 1 then the output is
complement of the input. If the controlled signal C is 0 then the output is equal to the input.
The figure shows that the 3 bit controlled inverter, which invert the inputs if c is 1.
If initial carry, 0 is zero, then each full adder gets the normal bits of binary numbers A & B. So, the 4-
bit binary adder / subtractor produces an output, which is the addition of two binary numbers A & B.
The block diagram of 4-bit binary adder / subtractor is shown in the following figure.
Figure –4 Bit Binary Adder/Subtractor
If initial borrow, 0 is one, then each full adder gets the normal bits of binary number A &
complemented bits of binary number B. So, the 4-bit binary adder / subtractor produces an output, which
is the subtraction of two binary numbers A & B.
Therefore, with the help of additional Ex-OR gates, the same circuit can be used for both addition and
subtraction of two binary numbers.
Now consider the full adder to understand the logic of fast adder or Carry lookahead adder. Lets look on
the logic circuit and truth table of full adder as shown in figure.
If we define two variables as carry generate Gi and carry propagate Pi then,
Pi = Ai ⊕ Bi
Gi = Ai Bi
The sum output and carry output can be expressed as
Si = Pi ⊕ Ci
Ci+1 = Gi + Pi Ci
Where Gi is a carry generate which produces the carry when both Ai, Bi are one regardless of the input
carry. Pi is a carry propagate and it is associate with the propagation of carry from Ci to Ci+1.
The carry output Boolean function of each stage in a 4 stage fast adder can be expressed as
C1 = G0 + P0 Cin
C2 = G1 + P1 C1 = G1 + P1 G0 + P1 P0 Cin
C3 = G2 + P2 C2 = G2 + P2 G1+ P2 P1 G0 + P2 P1 P0 Cin
C4 = G3 + P3 C3= G3 + P3 G2+ P3 P2 G1 + P3 P2 P1 G0 + P3 P2 P1 P0 Cin
From the above Boolean equations we can observe that C4 does not have to wait for C3 and C2 to
propagate but actually C4 is propagated at the same time as C3 and C2. Since the Boolean expression for
each carry output is the sum of products so these can be implemented with one level of AND gates
followed by an OR gate. The logic circuit of fat adder or carry lookahead adder for 4 bit is shown in the
figure below:
In this adder, the propagation delay is reduced. The carry output at any stage is dependent only on the
initial carry bit of the beginning stage. Using this adder it is possible to calculate the intermediate
results. This adder is the fastest adder used for computation.
Multiplexer
Multiplexer is a combinational circuit that has maximum of 2n data inputs, ‘n’ selection lines and single
output line. One of these data inputs will be connected to the output based on the values of selection
lines.
Since there are ‘n’ selection lines, there will be 2n possible combinations of zeros and ones. So, each
combination will select only one data input. Multiplexer is also called as Mux or Data selector.
The 8 inputs are derived using the implementation table shown below
̅ ̅ ̅ ̅ ̅
̅ ̅
̅ ̅ ̅ ̅ ̅
! 0
Demultiplexer
De-Multiplexer is a combinational circuit that performs the reverse operation of Multiplexer. It has
single input, ‘n’ selection lines and maximum of 2n outputs. The input will be connected to one of these
outputs based on the values of selection lines.
Since there are ‘n’ selection lines, there will be 2n possible combinations of zeros and ones. So, each
combination can select only one output. De-Multiplexer is also called as De-Mux or Data distributor.
1×4 Demultiplexer:
In 1 to 4 De-multiplexer, there are total of four outputs, i.e., Y0, Y1, Y2, and Y3, 2 selection lines, i.e.,
S0 and S1 and single input, i.e., A. On the basis of the combination of inputs which are present at the
selection lines S0 and S1, the input be connected to one of the outputs. The block diagram, the truth table
and logic circuit diagram of the 1×4 multiplexer are given below.
Basic Encoders
The combinational circuits that change the binary information into N output lines are known as Binary
Encoder or simply Encoders. The binary information is passed in the form of 2N input lines. The output
lines define the N-bit code for the binary information. In simple words, the Encoder performs the reverse
operation of the Decoder. At a time, only one input line is activated for simplicity. The produced N-bit
output code is equivalent to the binary information.
4 to 2 line Encoder
In 4 to 2 line encoder, there are total of four inputs, i.e., Y0, Y1, Y2, and Y3, and two outputs, i.e., A0 and
A1. In 4-input lines, one input-line is set to true at a time to get the respective binary code in the output
side. Below are the block diagram and the truth table of the 4 to 2 line encoder.
Digital Logic: Chapter 4: Combinational Logic Circuits By: MB Sah
Figure- 4 to 2 line encoder
Inputs Outputs
Y3 Y2 Y1 Y0 A1 A0
0 0 0 1 0 0
0 0 1 0 0 1
0 1 0 0 1 0
1 0 0 0 1 1
Figure- Truth table of 4 to 2 line encoder Figure -Logical circuit of 4 to 2 line encoder
8 to 3 line Encoder
The 8 to 3 line Encoder is also known as Octal to Binary Encoder. In 8 to 3 line encoder, there are total
of eight inputs, i.e., Y0, Y1, Y2, Y3, Y4, Y5, Y6, and Y7 and three outputs, i.e., A0, A1, and A2. In 8-input
lines, one input-line is set to true at a time to get the respective binary code in the output side.
Inputs Outputs
Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 A2 A1 A0
0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 1 0 0 0 1
0 0 0 0 0 1 0 0 0 1 0
0 0 0 0 1 0 0 0 0 1 1
0 0 0 1 0 0 0 0 1 0 0
0 0 1 0 0 0 0 0 1 0 1
0 1 0 0 0 0 0 0 1 1 0
1 0 0 0 0 0 0 0 1 1 1
Figure – Truth table of 8 to 3 line Encoder
Digital Logic: Chapter 4: Combinational Logic Circuits By: MB Sah
The logical expression of the output term A0, A1, and A2 are as follows:
A2=Y4+Y5+Y6+Y7
A1=Y2+Y3+Y6+Y7
A0=Y7+Y5+Y3+Y1
Logical circuit of the above expressions is given below.
A 4 to 2 priority encoder has 4 inputs: Y3, Y2, Y1 & Y0, and 2 outputs: A1 & A0. Here, the input, Y3 has
the highest priority, whereas the input, Y0 has the lowest priority. In this case, even if more than one
input is ‘1’ at the same time, the output will be the (binary) code corresponding to the input, which is
having higher priority. V is the valid bit and it is zero when priority is not set and 1 for priority. The
truth table for the priority encoder is as follows.
Inputs Outputs
Y3 Y2 Y1 Y0 A1 A0 V
0 0 0 0 X X 0
0 0 0 1 0 0 1
0 0 1 X 0 1 1
0 1 X X 1 0 1
1 X X X 1 1 1
The logical expression for A1 and A0 are shown below.
Decoder
The combinational circuit that change the binary information into 2N output lines is known
as Decoders. The binary information is passed in the form of N input lines. The output lines define the
2N-bit code for the binary information. In simple words, the Decoder performs the reverse operation of
the Encoder. At a time, only one input line is activated for simplicity. The produced 2N-bit output code is
equivalent to the binary information.
3 to 8 line decoder
The 3 to 8 line decoder is also known as Binary to Octal Decoder. In a 3 to 8 line decoder, there are a
total of eight outputs, i.e., Y0, Y1, Y2, Y3, Y4, Y5, Y6, and Y7 and three inputs, i.e., A0, A1, and A2. This
circuit has an enable input 'E' and when enable 'E' is set to 1, one of these eight outputs will be 1.
The logical expression of the output terms Y0, Y1, Y2, Y3, Y4, Y5, Y6, and Y7 is as follows:
Y0 =E. .* . .+ . ., . Y1 =E. .* . .+ . ., Y2 =E. .* . .+ . ., Y3 =E. .* . .+ . .,
Y4 =E. .* . .+ . ., Y5 =E. .* . .+ . ., Y6 =E. .* . .+ . ., Y7 =E. .* . .+ . .,
BCD-to-Decimal Decoder
The BCD-to-decimal decoder converts each BCD code into one of ten possible decimal digit
indications. The method of implementation is the same as for the 3-of-8 decoder In a BCD to Decimal
decoder, there are a total of ten outputs, i.e., Y0, Y1, Y2, Y3, Y4, Y5, Y6, Y7, Y8 and Y9 and four inputs,
i.e., A0, A1, A2 and A3. This circuit has an enable input 'E' and when enable 'E' is set to 1, one of these
ten outputs will be 1. It is frequently referred as a 4-line-to-10-line decoder or a 1-of-10 decoder.
Digital Logic: Chapter 4: Combinational Logic Circuits By: MB Sah
Figure – BCD to Decimal decoder
Seven segment displays does not work by directly supplying voltage to different segments of LEDs.
First, our decimal number is changed to its BCD equivalent signal then BCD to seven segment
decoder converts that signals to the form which is fed to seven segment display.
This BCD to seven segment decoder has four input lines (A, B, C and D) and 7 output lines (a, b, c, d,
e, f and g), this output is given to seven segment LED display which displays the decimal number
depending upon inputs.
∴2 ⨁
2. For segment ‘b’:
For segment ‘b’, 0, 1, 2, 3, 4, 7, 8, 9 are high
∴3 ⨁
3. For segment ‘c’:
For segment ‘c’, 0, 1, 3, 4, 5, 6, 7, 8, 9 are high
∴5
5. For segment ‘e’:
For segment ‘e’, 0, 2, 6, 8 are high
∴6
6. For segment ‘f’:
For segment ‘f’, 0, 4, 5, 6, 8, 9 are high
∴
Digital Logic: Chapter 4: Combinational Logic Circuits By: MB Sah
7. For segment ‘g’:
For segment ‘g’, 2, 3, 4, 5, 6, 8, 9 are high
∴7 ⨁
Magnitude Comparator
A magnitude Comparator is a combinational circuit that compares two digital or binary numbers in order
to find out whether one binary number is equal, less than, or greater than the other binary number.
Magnitude comparator is also called digital comparator. We logically design a circuit for which we will
have two inputs one for A and the other for B and have three output terminals, one f or A > B condition,
one for A = B condition, and one for A < B condition.
From the above truth table, K-map for each output can be drawn as follows.
/
K-map and logical expressions for Output A=B given below
/
/
/
/ < ⊕ = ⊕
The logic circuit for 2-bit comparator is given below
OR
Figure – Logic circuit for 4-bit Magnitude Comparator
Digital Logic: Chapter 4: Combinational Logic Circuits By: MB Sah