Unit 2 - Csa
Unit 2 - Csa
The combinational logic circuits are the circuits that contain different
types of logic gates. Simply, a circuit in which different types of logic
gates are combined is known as a combinational logic circuit. The
output of the combinational circuit is determined from the present
combination of inputs, regardless of the previous input. The input
variables, logic gates, and output variables are the basic components of
the combinational logic circuit. There are different types of combinational
logic circuits, such as Adder, Subtractor, Decoder, Encoder, Multiplexer,
and De-multiplexer.
The 'n' input variable comes from the external source while the 'm' output
variable goes to the external destination. In many applications, the source
or destinations are storage registers.
Half Adder in Digital Logic
Introduction:
A half adder is a digital logic circuit that performs binary addition of
two single-bit binary numbers. It has two inputs, A and B, and two
outputs, SUM and CARRY. The SUM output is the least significant bit
(LSB) of the result, while the CARRY output is the most significant bit
(MSB) of the result, indicating whether there was a carry-over from
the addition of the two inputs. The half adder can be implemented
using basic gates such as XOR and AND gates.
Sure, here’s a more in-depth explanation of the half adder circuit:
The half adder is a basic building block for more complex adder
circuits such as full adders and multiple-bit adders. It performs
binary addition of two single-bit inputs, A and B, and provides two
outputs, SUM and CARRY.
The SUM output is the least significant bit (LSB) of the result, which
is the XOR of the two inputs A and B. The XOR gate implements the
addition operation for binary digits, where a “1” is generated in the
SUM output only when one of the inputs is “1”.
The CARRY output is the most significant bit (MSB) of the result,
indicating whether there was a carry-over from the addition of the
two inputs. The CARRY output is the AND of the two inputs A and B.
The AND gate generates a “1” in the CARRY output only when both
inputs are “1”.
Half Adder (HA):
Half adder is the simplest of all adder circuits. Half adder is a
combinational arithmetic circuit that adds two numbers and
produces a sum bit (s) and carry bit (c) both as output. The addition
of 2 bits is done using a combination circuit called a Half adder. The
input variables are augend and addend bits and output variables are
sum & carry bits. A and B are the two input bits.
let us consider two input bits A and B, then sum bit (s) is the X-OR of
A and B. it is evident from the function of a half adder that it
requires one X-OR gate and one AND gate for its construction.
Truth Table:
Here we perform two operations Sum and Carry, thus we need two
K-maps one for each to derive the expression.
Logical Expression:
For Sum:
Sum = A XOR B
For Carry:
Carry = A AND B
Implementation:
Note: Half adder has only two inputs and there is no provision to
add a carry coming from the lower order bits when multi addition is
performed.
Advantages and disadvantages of Half Adder in Digital
Logic :
Courses
Jobs
Full Adder is the adder that adds three inputs and produces two
outputs. The first two inputs are A and B and the third input is an
input carry as C-IN. The output carry is designated as C-OUT and the
normal output is designated as S which is SUM. The C-OUT is also
known as the majority 1’s detector, whose output goes high when
more than one input is high. A full adder logic is designed in such a
manner that can take eight inputs together to create a byte-wide
adder and cascade the carry bit from one adder to another. we use a
full adder because when a carry-in bit is available, another 1-bit
adder must be used since a 1-bit half-adder does not take a carry-in
bit. A 1-bit full adder adds three operands and generates 2-bit
results.
Full Adder Truth Table:
computers, digital
measuring devices, digital processors, etc.
etc.
Logical Expression
Difference = A XOR B
Borrow = \overline{A}B
1. Simplicity: The half adder and half subtractor circuits are simple
and easy to design, implement, and debug compared to other
binary arithmetic circuits.
2. Building blocks: The half adder and half subtractor are basic
building blocks that can be used to construct more complex
arithmetic circuits, such as full adders and subtractors, multiple-
bit adders and subtractors, and carry look-ahead adders.
3. Low cost: The half adder and half subtractor circuits use only a
few gates, which reduces the cost and power consumption
compared to more complex circuits.
4. Easy integration: The half adder and half subtractor can be
easily integrated with other digital circuits and systems.
Disadvantages of Half Adder and Half Subtractor
and “borrow”.
OR
Bout = A’B’Bin + A’BBin’ + A’BBin + ABBin
= Bin (AB + A’B’) + A’B(Bin + Bin’)
= Bin( A XNOR B) + A’B
= Bin (A XOR B)’ + A’B
Logic Circuit for Full Subtractor –
Parallel Adder –
A single full adder performs the addition of two one bit numbers
and an input carry. But a Parallel Adder is a digital circuit capable
of finding the arithmetic sum of two binary numbers that
is greater than one bit in length by operating on corresponding
pairs of bits in parallel. It consists of full adders connected in a
chain where the output carry from each full adder is connected to
the carry input of the next higher order full adder in the chain. A n
bit parallel adder requires n full adders to perform the
operation. So for the two-bit number, two adders are needed
while for four bit number, four adders are needed and so on.
Parallel adders normally incorporate carry lookahead logic to
ensure that carry propagation between subsequent stages of
addition does not limit addition speed.
Binary Adder-Subtractor
A Binary Adder-Subtractor is a special type of circuit that is used to
perform both operations, i.e., Addition and Subtraction. The operation
which is going to be used depends on the values contained by the control
signal. In Arithmetic Logical Unit, it is one of the most important
components.
For example, we will take two 4-bit binary numbers 'X' and 'Y' for the
operation with digits.
X0 X1 X2 X3 for X
Y0 Y1 Y2 Y3 for Y
When the value of K is set to true or 1, the Y 0⨁K produce the complement
of Y0 as the output. So the operation would be X+Y 0', which is the 2's
complement subtraction of X and Y. It means when the value of K is 1; the
subtraction operation is performed by the binary Adder-Subtractor.
In the same way, when the value of K is set to 0, the Y 0⨁K produce Y0 as
the output. So the operation would be X+Y 0, which is the binary addition
of X and Y. It means when the value of K is 0; the addition operation is
performed by the binary Adder-Subtractor.
Multiplexer
A multiplexer is a combinational circuit that has 2 n input lines and a single
output line. Simply, the multiplexer is a multi-input and single-output
combinational circuit. The binary information is received from the input
lines and directed to the output line. On the basis of the values of the
selection lines, one of these data inputs will be connected to the output.
Unlike encoder and decoder, there are n selection lines and 2 n input lines.
So, there is a total of 2N possible combinations of inputs. A multiplexer is
also treated as Mux.
2×1 Multiplexer:
In 2×1 multiplexer, there are only two inputs, i.e., A 0 and A1, 1 selection
line, i.e., S0 and single outputs, i.e., Y. On the basis of the combination of
inputs which are present at the selection line S 0, one of these 2 inputs will
be connected to the output. The block diagram and the truth table of the
2×1 multiplexer are given below.
ADVERTISEMENT
Block Diagram:
Truth Table:
Y=S0'.A0+S0.A1
4×1 Multiplexer:
In the 4×1 multiplexer, there is a total of four inputs, i.e., A 0, A1, A2, and
A3, 2 selection lines, i.e., S0 and S1 and single output, i.e., Y. On the basis
of the combination of inputs that are present at the selection lines S 0 and
S1, one of these 4 inputs are connected to the output. The block diagram
and the truth table of the 4×1 multiplexer are given below.
De-multiplexer
A De-multiplexer is a combinational circuit that has only 1 input line and
2N output lines. Simply, the multiplexer is a single-input and multi-output
combinational circuit. The information is received from the single input
lines and directed to the output line. On the basis of the values of the
selection lines, the input will be connected to one of these outputs. De-
multiplexer is opposite to the multiplexer.
Unlike encoder and decoder, there are n selection lines and 2 n outputs.
So, there is a total of 2 n possible combinations of inputs. De-multiplexer is
also treated as De-mux.
1×2 De-multiplexer:
In the 1 to 2 De-multiplexer, there are only two outputs, i.e., Y 0, and Y1, 1
selection lines, i.e., S0, and single input, i.e., A. On the basis of the
selection value, the input will be connected to one of the outputs. The
block diagram and the truth table of the 1×2 multiplexer are given below.
ADVERTISEMENT
ADVERTISEMENT
Block Diagram:
Truth Table:
The logical expression of the term Y is as follows:
Y0=S0'.A
Y1=S0.A
1×4 De-multiplexer:
In 1 to 4 De-multiplexer, there are total of four outputs, i.e., Y 0, 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 S 0 and
S1, the input be connected to one of the outputs. The block diagram and
the truth table of the 1×4 multiplexer are given below.
Block Diagram:
Truth Table:
ADVERTISEMENT
Y0=S1' S0' A
y1=S1' S0 A
y2=S1 S0' A
y3=S1 S0 A
ADVERTISEMENT
Block Diagram:
Truth Table:
Y0=S0'.S1'.S2'.A
Y1=S0.S1'.S2'.A
Y2=S0'.S1.S2'.A
Y3=S0.S1.S2'.A
Y4=S0'.S1'.S2 A
Y5=S0.S1'.S2 A
Y6=S0'.S1.S2 A
Y7=S0.S1.S3.A
For getting 8 data outputs, we need two 1×4 de-multiplexer. The 1×2 de-
multiplexer produces two outputs. So, in order to get the final output, we
have to pass the outputs of 1×2 de-multiplexer as an input of both the
1×4 de-multiplexer. The block diagram of 1×8 de-multiplexer using 1×4
and 1×2 de-multiplexer is given below.
ADVERTISEMENT
ADVERTISEMENT
1 x 16 De-multiplexer
In 1×16 de-multiplexer, there are total of 16 outputs, i.e., Y 0, Y1, …, Y16, 4
selection lines, i.e., S0, S1, S2, and S3 and single input, i.e., A. On the basis
of the combination of inputs which are present at the selection lines S 0, S1,
and S2, the input will be connected to one of these outputs. The block
diagram and the truth table of the 1×16 de-multiplexer are given below.
Block Diagram:
Truth Table:
Y0=A.S0'.S1'.S2'.S3'
Y1=A.S0'.S1'.S2'.S3
Y2=A.S0'.S1'.S2.S3'
Y3=A.S0'.S1'.S2.S3
Y4=A.S0'.S1.S2'.S3'
Y5=A.S0'.S1.S2'.S3
Y6=A.S0'.S1.S2.S3'
Y7=A.S0'.S1.S2.S3
Y8=A.S0.S1'.S2'.S3'
Y9=A.S0.S1'.S2'.S3
Y10=A.S0.S1'.S2.S3'
Y11=A.S0.S1'.S2.S3
Y12=A.S0.S1.S2'.S3'
Y13=A.S0.S1.S2'.S3
Y14=A.S0.S1.S2.S3'
Y15=A.S0.S1.S2'.S3
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
For getting 16 data outputs, we need two 1×8 de-multiplexer. The 1×8
de-multiplexer produces eight outputs. So, in order to get the final output,
we need a 1×2 de-multiplexer to produce two outputs from a single input.
Then we pass these outputs into both the de-multiplexer as an input. The
block diagram of 1×16 de-multiplexer using 1×8 and 1×2 de-multiplexer
is given below.
Block Diagram:
Truth Table:
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
Truth Table:
The logical expression of the term Y is as follows:
Y=S0'.S1'.S2'.A0+S0.S1'.S2'.A1+S0'.S1.S2'.A2+S0.S1.S2'.A3+S0'.S1'.S2 A4+S0.S1'.S2
A5+S0'.S1.S2 .A6+S0.S1.S3.A7
For getting 8 data inputs, we need two 4×1 multiplexers. The 4×1
multiplexer produces one output. So, in order to get the final output, we
need a 2×1 multiplexer. The block diagram of 8×1 multiplexer using 4×1
and 2×1 multiplexer is given below.
ADVERTISEMENT
ADVERTISEMENT
16 to 1 Multiplexer
In the 16 to 1 multiplexer, there are total of 16 inputs, i.e., A 0, A1, …, A16, 4
selection lines, i.e., S0, S1, S2, and S3 and single output, i.e., Y. On the basis
of the combination of inputs that are present at the selection lines S 0, S1,
and S2, one of these 16 inputs will be connected to the output. The block
diagram and the truth table of the 16×1
Block Diagram:
Truth Table:
ADVERTISEMENT
ADVERTISEMENT
16×1 multiplexer using 8×1 and 2×1 multiplexer
We can implement the 16×1 multiplexer using a lower order multiplexer.
To implement the 8×1 multiplexer, we need two 8×1 multiplexers and
one 2×1 multiplexer. The 8×1 multiplexer has 3 selection lines, 4 inputs,
and 1 output. The 2×1 multiplexer has only 1 selection line.
A multiplexer is a A demultiplexer is a
combinational digital combinational digital
Definition circuit that takes multiple circuit that takes single
data inputs and provides input and provides
only single output. multiple outputs.
Use a 4:1 multiplexer to implement the following two variable logic function.
F(A+B)=∑m(0,1,3)�(�+�)=∑�(0,1,3)
Solution
The truth table of the 4:1 multiplexer for the given logic function is as follows
−
S1 = A S0 = B Y
0 0 1
0 1 1
1 0 0
1 1 1
Using this truth table, we can draw the logic block diagram to realize the
function F using a 4:1 MUX which is shown in Figure-2.
Explanation
Here, the inputs A and B are applied to the select lines S 1, and
S0 respectively. From the truth table, it is clear that the function F = 1, when
AB = 00, 01, 11. Thus, we connect logic 1 to the data input lines I 0, I1, and I3,
and the logic 0 is connected to the data input line I 2.
Example 2
Implement the following two variable logic function by using a 4:1 MUX.
F(A,B)=∑m(1,3)�(�,�)=∑�(1,3)
Solution
The truth table of the 4:1 multiplexer for the given logic function is as follows,
S1 = A S0 = B Y
0 0 0
0 1 1
1 0 0
1 1 1
Using this truth table, we can draw the logic block diagram to realize the
function F using a 4:1 MUX which is shown in Figure-3.
Explanation
Here, the inputs A and B are applied to the select lines S 1, and
S0 respectively. From the truth table, it is clear that the given Boolean
function F = 1, when AB = 01, 11. Hence, we connect logic 1 to the data
input lines I1 and I3, and the logic 0 is connected to the remaining data input
lines, i.e. I0 and I2.
Encoders
The combinational circuits that change the binary information into N
output lines are known as 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.
There are various types of encoders which are as follows:
4 to 2 line Encoder:
In 4 to 2 line encoder, there are total of four inputs, i.e., Y 0, 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.
Block Diagram:
Truth Table:
ADVERTISEMENT
A1=Y3+Y2
A0=Y3+Y1
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 is a total of eight inputs, i.e., Y 0, Y1, Y2, Y3, Y4, Y5,
Y6, and Y7 and three outputs, i.e., A 0, 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. Below are the block diagram and the truth table of the 8 to 3
line encoder.
Block Diagram:
ADVERTISEMENT
Truth Table:
The logical expression of the 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:
ADVERTISEMENT
ADVERTISEMENT
Truth Table:
The logical expression of the term A0, A1, A2, and A3 is as follows:
A3 = Y9 + Y8
A2 = Y7 + Y6 + Y5 +Y4
A1 = Y7 + Y6 + Y3 +Y2
A0 = Y9 + Y7 +Y5 +Y3 + Y1
Logical circuit of the above expressions is given below:
Priority Encoder:
4 to 2 line Priority Encoder:
In this priority encoder, there are total of 4 inputs, i.e., Y 0, Y1, Y2, and Y3,
and two outputs, i.e., A0 and A1. The Y3 has high and Y0 has low priority
inputs. When more than one input is '1' at the same time, the output will
be the (binary) code corresponding to the higher priority input. Below is
the truth table of the 4 to 2 line priority encoder.
Truth Table:
The logical expression of the term A 0 and A1 can be found using K-
map as:
A1=Y3+Y2
A0=Y3+Y2'.Y1
ADVERTISEMENT
ADVERTISEMENT
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 2 N-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.
There are various types of decoders which are as follows:
2 to 4 line decoder:
In the 2 to 4 line decoder, there is a total of three inputs, i.e., A 0, and
A1 and E and four outputs, i.e., Y 0, Y1, Y2, and Y3. For each combination of
inputs, when the enable 'E' is set to 1, one of these four outputs will be 1.
The block diagram and the truth table of the 2 to 4 line decoder are given
below.
Block Diagram:
Truth Table:
The logical expression of the term Y0, Y0, Y2, and Y3 is as follows:
ADVERTISEMENT
Y3=E.A1.A0
Y2=E.A1.A0'
Y1=E.A1'.A0
Y0=E.A1'.A0'
ADVERTISEMENT
Truth Table:
The logical expression of the term Y 0, Y1, Y2, Y3, Y4, Y5, Y6, and Y7 is as
follows:
Y0=A0'.A1'.A2'
Y1=A0.A1'.A2'
Y2=A0'.A1.A2'
Y3=A0.A1.A2'
Y4=A0'.A1'.A2
Y5=A0.A1'.A2
Y6=A0'.A1.A2
Y7=A0.A1.A2
ADVERTISEMENT
4 to 16 line Decoder
In the 4 to 16 line decoder, there is a total of 16 outputs, i.e., Y 0, Y1, Y2,
……, Y16 and four inputs, i.e., A0, A1, A2, and A3. The 3 to 16 line decoder
can be constructed using either 2 to 4 decoder or 3 to 8 decoder. There is
the following formula used to find the required number of lower-order
decoders.
m1 = 8
m2 = 16
Block Diagram:
Truth Table:
The logical expression of the term A0, A1, A2,…, A15 are as follows:
Y0=A0'.A1'.A2'.A3'
Y1=A0'.A1'.A2'.A3
Y2=A0'.A1'.A2.A3'
Y3=A0'.A1'.A2.A3
Y4=A0'.A1.A2'.A3'
Y5=A0'.A1.A2'.A3
Y6=A0'.A1.A2.A3'
Y7=A0'.A1.A2.A3
Y8=A0.A1'.A2'.A3'
Y9=A0.A1'.A2'.A3
Y10=A0.A1'.A2.A3'
Y11=A0.A1'.A2.A3
Y12=A0.A1.A2'.A3'
Y13=A0.A1.A2'.A3
Y14=A0.A1.A2.A3'
Y15=A0.A1.A2'.A3
ADVERTISEMENT
ADVERTISEMENT