Module 2
Module 2
Combinational circuits
A combinational circuit, also called a combinational logic circuit, is a digital electronic circuit
whose output is determined by present inputs only.
The output of a combinational logic circuit does not depend on the history of the circuit
operation.
In other words, a combinational circuit is a digital logic circuit whose output depends only on the
present input values and does not depend on any feedback or previous input or output values.
Combinational circuits are very well-known components in digital electronics, which can provide
an output instantly based on the current input. Unlike sequential circuits, a combinational circuit
listens for input signals and generates output regardless of the past input or state, as it has no
feedback or memory component.
They are specially designed using multiple interconnected logic gates such that the
output will be generated by computing the logical combinations of the present input only.
No clock pulse is present here; moreover, no previously stored value or state is taken
into consideration here.
Combinational circuits are generally grouped into three main types based on their functions:
Applications of Combinational Circuit
In modern technologies, combinational circuits are widely used for its simple functionality and
ability to give instant output. Some of the applications are discussed below:
Traffic Light Control: In traffic lights control mechanism, combinational circuits are
used to instantly determine the timing and sequence of traffic light changes based on the
inputs of timers and sensors.
Analysis and Design procedures
The design procedure starts with a problem statement and creates the circuit:
1. Define the Problem: Clearly state the problem, identifying the number of inputs and
outputs.
2. Assign Variables: Assign letter symbols to all input and output variables.
3. Create Truth Table: Derive a truth table that defines the functional relationship between
inputs and outputs.
4. Simplify Boolean Expressions: Obtain the simplified Boolean functions for each output
using Karnaugh maps (K-maps) or Boolean algebra.
5. Logic Diagram: Draw the logic diagram using appropriate logic gates (AND, OR, NOT,
etc.).
Analysis Procedure
The analysis procedure starts with a circuit diagram and determines its function:
1. Label Gates: Label all gate outputs that are functions of input variables with arbitrary
symbols.
2. Determine Boolean Functions: Find the Boolean functions for these gate outputs.
3. Iterate: If there are multiple levels, continue labeling outputs that depend on previous
outputs until all output expressions are defined.
4. Obtain Output Expressions: Derive the final output functions in terms of input variables
by substituting previously defined functions.
5. Create Truth Table: Create the final truth table based on the derived Boolean
expressions.
6. Summary Table
Step Design Procedure Analysis Procedure
Adder
A binary adder is a combinational circuit that performs the addition of binary digits or bits.
Depending on the design and configuration, there are two types of binary adders namely, Half
Adder and Full Adder.
Half Adder
half adder is a basic combinational circuit that adds two single-bit binary inputs (A and B) to
produce a SUM using an XOR gate and a CARRY using an AND gate, without considering any
carry-in from a previous stage.
Performs binary addition of two 1-bit inputs, generating a SUM (A ⊕ B) and CARRY (A ·
B).
Cannot handle carry-in from a previous stage, making it suitable only for the first stage of
multi-bit addition.
Here we perform two operations Sum and Carry, thus we need two K-maps one for each to
derive the expression.
For Sum
Sum = A XOR B
For Carry
Carry = A AND B
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.
Limited Usefulness: The half adder can add two single-piece numbers and produce a
total and a convey bit. It can't perform expansion of multi-bit numbers, which requires the
utilization of additional intricate circuits like full adders.
Lack of Convey Info: The half adder doesn't have a convey input, which restricts its
value in more mind boggling expansion tasks. A convey input is important to perform
expansion of multi-bit numbers and to chain numerous adders together.
Propagation Deferral: The half adder circuit has a proliferation delay, which is the time
it takes for the result to change in light of an adjustment of the info. This can cause
timing issues in computerized circuits, particularly in fast frameworks.
Arithmetic circuits: Half adders are utilized in number-crunching circuits to add double
numbers. At the point when different half adders are associated in a chain, they can add
multi-bit double numbers.
Data handling: Half adders are utilized in information handling applications like
computerized signal handling, information encryption, and blunder adjustment.
Address unraveling: In memory tending to, half adders are utilized in address
deciphering circuits to produce the location of a particular memory area.
Encoder and decoder circuits: Half adders are utilized in encoder and decoder circuits
for computerized correspondence frameworks.
Counters: Half adders are utilized in counters to augment the count by one.
Full Adder
Full Adder is a combinational circuit 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
A (first bit)
B (second bit)
Sum (S)
INPUT OUTPUT
A B C-IN SUM C-OUT
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
From the truth table, the logical expression for the sum (S) in a full adder is:
S = A ⊕ B ⊕ C-IN
From the truth table, the logical expression for C-OUT (carry-out) in a full adder is:
Since C-IN' + C-IN =1 and A'B + AB' =A ⊕ B. Thus, the final simplified expression is:
C-OUT = A B + C-IN (A ⊕ B)
Carry (C-Out) is implemented using XOR,AND and OR gates:Finally, the two outputs from the
AND gates are combined using an OR gate to generate the final C-OUT output.
Second AND gate: This gate calculates C-IN AND (A ⊕ B). To do this, you need the result of
the first XOR gate (A ⊕ B) as an input to the second AND gate.
Subtractor
A binary subtractor is a combinational logic circuit used to subtract one binary number from
another. Similar to binary adder, there are two types of binary subtractors namely, half
subtractor and full-subtractor.
A half subtractor is a digital logic circuit that performs the binary subtraction of two single-bit
binary numbers. It has two inputs, A and B, and two outputs, Difference and Borrow.
The Difference output represents the result of subtracting B from A, while the Borrow output
indicates whether a borrow is needed when A is smaller than B.
The half subtractor can be implemented using basic logic gates such as XOR, AND, and
NOT gates. It is a fundamental building block for more complex arithmetic circuits like full
subtractors and multi-bit subtractors.
For difference,
The SOP form of the Difference is as follows:
Difference = A'B+AB'
For borrow,
Borrow = A'B
Simplicity: The half subtractor circuits are simple and easy to design, implement, and
debug compared to other binary arithmetic circuits.
Building blocks: The half subtractor is basic building block that can be used to
construct more complex arithmetic circuits, such as full subtractors, multiple-bit
subtractors.
Low cost: The half subtractor circuits use only a few gates, which reduces the cost and
power consumption compared to more complex circuits.
Easy integration: The half subtractor can be easily integrated with other digital circuits
and systems.
Limited functionality: The half subtractor can only perform binary subtraction of two
single-bit numbers, respectively, and not suitable for more complex arithmetic
operations.
Inefficient for multi-bit numbers: For multi-bit numbers, multiple half subtractors need
to be cascaded, which increases the complexity and decreases the efficiency of the
circuit.
High propagation delay: When cascaded for multi-bit operations, the cumulative
propagation delay of half subtractors becomes higher compared to dedicated multi-bit
subtractors (e.g., using look-ahead borrow).
A (Minuend)
B (Subtrahend)
The full subtractor is essential because a half-subtractor can only subtract the least significant
bit (LSB) of binary numbers. However, if a borrow is generated during the subtraction of the
LSBs, it will affect the subtraction in the next stages. A full subtractor handles this situation by
considering the borrow from the previous stage, ensuring accurate subtraction even when a
borrow is present.
The full subtractor is used to subtract binary numbers with borrow handling, making it suitable
for multi-bit subtraction in digital circuits like Arithmetic Logic Units (ALUs).
A B B-IN D B-OUT
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
From above table we can draw the K-Map as shown for "difference" and "borrow"
A'B' + AB = A XNOR B
AB' + A'B = A XOR B
D = Bin ⊕ (A ⊕ B)
D = (A ⊕ B) ⊕ Bin
Thus, the final simplified expression for the difference in a full subtractor is:
Simplifying:
AB + A'B' = A XNOR B
Thus, the final simplified expression for borrow in a full subtractor is:
Logic Circuit for Full Subtractor
Magnitude Comparator
What is Magnitude Comparator?
The circuit works by comparing the bits of the two numbers starting from the most significant bit
(MSB) and moving toward the least significant bit (LSB). At each bit position, the two
corresponding bits of the numbers are compared. If the bit in the first number is greater than the
corresponding bit in the second number, the A>B output is set to 1,and the circuit immediately
determines that the first number is greater than the second. Similarly, if the bit in the second
number is greater than the corresponding bit in the first number, the A<B output is set to 1,
and the circuit immediately determines that the first number is less than the second.
If the two corresponding bits are equal, the circuit moves to the next bit position and compares
the next pair of bits. This process continues until all the bits have been compared. If at any point
in the comparison, the circuit determines that the first number is greater or less than the second
number, the comparison is terminated, and the appropriate output is generated.
If all the bits are equal, the circuit generates an A=B output, indicating that the two numbers
are equal.
There are different ways to implement a magnitude comparator, such as using a combination of
XOR, AND, and OR gates, or by using a cascaded arrangement of full adders. The choice of
implementation depends on factors such as speed, complexity, and power consumption.
A comparator used to compare two bits is called a single-bit comparator. It consists of two inputs
each for two single-bit numbers and three outputs to generate less than, equal to, and greater
than between two binary numbers.
From the above truth table logical expressions for each output can be expressed as follows.
A>B: AB'
A<B: A'B
0 0 0 0 0 1 0
0 0 0 1 1 0 0
0 0 1 0 1 0 0
0 0 1 1 1 0 0
0 1 0 0 0 0 1
0 1 0 1 0 1 0
0 1 1 0 1 0 0
0 1 1 1 1 0 0
1 0 0 0 0 0 1
1 0 0 1 0 0 1
1 0 1 0 0 1 0
1 0 1 1 1 0 0
1 1 0 0 0 0 1
1 1 0 1 0 0 1
1 1 1 0 0 0 1
1 1 1 1 0 1 0
From the above truth table, K-map for each output can be drawn as follows.
From the above K-maps logical expressions for each output can be expressed as
follows.
By using these Boolean expressions, we can implement a logic circuit for this
comparator as given below.
Applications of Comparators
Comparators are used in central processing units (CPU s) and microcontrollers (MCUs).
These are used in control applications in which the binary numbers representing
physical variables such as temperature, position, etc. are compared with a reference
value.
Comparators are also used as process controllers and for Servo motor control.
Advantage of Comparator
This comparator can be easily integrated in to complex systems like processors and
arithmetic units.
Design of comparator are modular, which allow them to scale solutions for comparing
multi-bit numbers
Disadvantages of Comparator
Encoders convert 2N lines of input into a code of N bits and Decoders decode the N bits into
2N lines.
1. Encoders - An encoder is a combinational circuit that converts binary information in the form
of a 2N input lines into N output lines, which represent N bit code for the input. For simple
encoders, it is assumed that only one input line is active at a time. As an example, let’s
consider Octal to Binary encoder. As shown in the following figure, an octal-to-binary encoder
takes 8 input lines and generates 3 output lines.
Truth Table –
D7 D6 D5 D4 D3 D2 D1 D0 X Y Z
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
D7 D6 D5 D4 D3 D2 D1 D0 X Y Z
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
As seen from the truth table, the output is 000 when D0 is active; 001 when D1 is active; 010
when D2 is active and so on.
Implementation -
From the truth table, the output line Z is active when the input octal digit is 1, 3, 5 or 7. Similarly,
Y is 1 when input octal digit is 2, 3, 6 or 7 and X is 1 for input octal digits 4, 5, 6 or 7. Hence, the
Boolean functions would be:
X = D4 + D5 + D6 + D7
Y = D2 +D3 + D6 + D7
Z = D1 + D3 + D5 + D7
One limitation of this encoder is that only one input can be active at any given time. If more than
one inputs are active, then the output is undefined. For example, if D6 and D3 are both active,
then, our output would be 111 which is the output for D7. To overcome this, we use Priority
Encoders. Another ambiguity arises when all inputs are 0. In this case, encoder outputs 000
which actually is the output for D0 active. In order to avoid this, an extra bit can be added to the
output, called the valid bit which is 0 when all inputs are 0 and 1 otherwise.
Priority Encoder -
A priority encoder is an encoder circuit in which inputs are given priorities. When more than one
inputs are active at the same time, the input with higher priority takes precedence and the
output corresponding to that is generated. Let us consider the 4 to 2 priority encoder as an
example. From the truth table, we see that when all inputs are 0, our V bit or the valid bit is zero
and outputs are not used. The x’s in the table show the don’t care condition, i.e, it may either be
0 or 1. Here, D3 has highest priority, therefore, whatever be the other inputs, when D3 is high,
output has to be 11. And D0 has the lowest priority, therefore the output would be 00 only when
D0 is high and the other input lines are low. Similarly, D2 has higher priority over D1 and D0 but
lower than D3 therefore the output would be 010 only when D2 is high and D3 are low (D0 & D1
are don’t care).
2. Decoders
A decoder is a combinational circuit that performs the reverse operation of an encoder,
converting n input lines into 2ⁿ output lines, with only one output active for each input
combination.
Truth Table -
X Y Z D0 D1 D2 D3 D4 D5 D6 D7
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0
X Y Z D0 D1 D2 D3 D4 D5 D6 D7
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
Implementation -
D0 = X’ Y’ Z’
Similarly,
D1 = X’ Y’ Z
D2 = X’ Y Z’
D3 = X’ Y Z
D4 = X Y’ Z’
D5 = X Y’ Z
D6 = X Y Z’
D7 = X Y Z
Hence,
Multiplexer
What is a Multiplexer?
As already mentioned, a multiplexer, also referred to as MUX, is a combination logic circuit that
is designed to accept multiple input signals and transfer only one of them through the output
line. In simple words, a multiplexer is a digital logic device that selects one-out-of-N (N = 2 n)
input data sources and transmits the selected data to a single output line.
The multiplexer is also called data selector as it selects one from several. The block diagram of
a typical 2n:1 multiplexer is shown in Figure 1.
In the case of multiplexer, the selection of desired data input to flow through the output line is
controlled with the help of SELECT lines. In the block diagram of mux in Figure 1, I0, I1,... In-1,
i.e., (2n) are the input lines, and "n" be the select lines. These select lines will determine which
input is to be routed to the output.
Hence, the multiplexer works as a multi-position switch whose operation is controlled by digital
signals. These digital control signals are applied to the select lines to determine which data
input will be switched to the output line
Function of Multiplexer
Multiplexer is a digital logic device which is used to perform multiplexing of data. Where,
multiplexing simply means sharing of data. Technically, when a particular data is selected from
multiple input data sources and transmitted the selected data to a single output channel, it is
called multiplexing.
There are two types of multiplexing namely, frequency multiplexing and time multiplexing.
When multiple devices are connected to a single transmission line in a system. At any point of
time, only one device is using the line to transmit data, then this is called time multiplexing. On
the other hand, when multiple devices share a common line to transmit data but at different
frequencies, it is called frequency multiplexing.
Types of Multiplexers
Based on input data lines and select lines, the multiplexer can be of several types. But, in this
article, we will discuss only the following three types of multiplexers −
2×1 Multiplexer
4×1 Multiplexer
2×1 Multiplexer
The block diagram of a 2×1 multiplexer is shown in Figure 2. The 2×1 multiplexer is basic two
input multiplexer which has two data input lines designated as I0 and I1, one data select line
denoted by S and one output line denoted by Y. The 2×1 mux is used to connect two 1-bit data
sources to a common designation.
In the 2×1 multiplexer, the logic level of the digital signal applied to the select line S determines
which data input will pass through the output line. The operation of the 2×1 multiplexer can be
understood from the following truth table.
0 I0
1 I1
4×1 Multiplexer
4×1 Multiplexer has four data inputs I3, I2, I1 & I0, two selection lines s1 & s0 and one output Y.
The block diagram of 4×1 Multiplexer is shown in the following figure.
One of these 4 inputs will be connected to the output based on the combination of inputs
present at these two selection lines. Truth table of 4×1 Multiplexer is shown below.
S1 S0 Y
0 0 I0
0 1 I1
1 0 I2
1 1 I3
From Truth table, we can directly write the Boolean function for output, Y as
We can implement this Boolean function using Inverters, AND gates & OR gate. The circuit
diagram of 4×1 multiplexer is shown in the following figure.
We can easily understand the operation of the above circuit. Similarly, you can implement 8×1
Multiplexer and 16×1 multiplexer by following the same procedure.
Applications of Multiplexers
In digital electronics, multiplexers have numerous applications in almost all types of digital
systems. Some important applications of multiplexers are as follows −
What is a Demultiplexer?
A Demultiplexer is a combinational logic circuit that accepts a single input and distributes it
over several output lines. Demultiplexer is also termed as DEMUX in short. As Demultiplexer is
used to transmit the same data to different destinations, hence it is also known as data
distributor.
There is another combinational logic circuit named multiplexer which performs opposite
operation of the Demultiplexer, i.e. accepts several inputs and transmits one of them at time to
the output line.
From the definition, we can state that a Demultiplexer is a 1-to-2n device. The functional block
diagram of a typical 1×2n Demultiplexer is shown in Figure-1.
It can be seen that the Demultiplexer has only one data input line, 2n output lines, and n select
lines. The logic level applied to select lines of the Demultiplexer determines the output channel
to which the input data will be transmitted.
Demultiplexer circuit are the combinational logic circuit widely used in digital decoders and
Boolean function generator circuits.
Advertisement
Types of Demultiplexer
Based on the number of output lines (2n), Demultiplexers can be classified into several types.
Some commonly used types of Demultiplexers are −
1×2 Demultiplexer
1×4 Demultiplexer
1×2 Demultiplexer
The functional block diagram of a 1×2 Demultiplexer is shown in Figure-2.
The 1×2 Demultiplexer consists of 1 input line (I), 1 select line (S), and 2 output lines (Y 0 and
Y1). The logic level applied at the select line determines the output line to which the input data
will be transmitted.
The operation of the 1×2 Demultiplexer can be analyzed with the help of its function table given
below.
S Y1 Y0
0 0 I
1 I 0
From this function table of 1×2 Demultiplexer, we can directly derive the Boolean expression for
each output as follow.
1×4 Demultiplexer
The functional block diagram of 1×4 Demultiplexer is shown in Figure-3.
The 1×4 Demultiplexer has 1 input line (I), 2 select line (S0 and S1), and 4 output lines (Y0, Y1,
Y2, and Y3). The logic level applied to the select lines determines the output line to which the
input data (I) will be transmitted.
The operation of the 1×4 Demultiplexer can be understood with the help of its function table
given below.
S1 S0 Y3 Y2 Y1 Y0
0 0 0 0 0 I
0 1 0 0 I 0
1 0 0 I 0 0
1 1 I 0 0 0
From this truth table of 1×4 Demultiplexer, we can directly write the Boolean expression for each
output as follow.
We can easily understand the operation of the above circuit. Similarly, you can implement 1×8
Demultiplexer and 1×16 Demultiplexer by following the same procedure.
Applications of Demultiplexer
Demultiplexer are used in several input and output devices for data routing.
Demultiplexer are used in digital control systems to select one signal from a mutual
stream of signals.
Abbreviated The abbreviation used to represent the The abbreviation used to represent
name multiplexer is MUX. the demultiplexer is DEMUX.
Usage in time- A multiplexer is used at the transmitter The demultiplexer is used at the
division end in the time-division multiplexing receiver end in the time-division
multiplexing (TDM). multiplexing.
Gate-Level Modeling: Directly maps the physical schematic using logic gates
(and, or, xor, not) and predefined primitives to define circuit structure. Example: xor g1(s,
a, b);.
Dataflow Modeling: Uses the assign keyword to describe circuit function with Boolean
equations rather than specific gates. It is efficient for describing logical operations.
Example: assign Y = (A & S) | (B & ~S);.
Behavioral Modeling: Uses always blocks and procedural assignments to describe the
high-level functionality. For combinational logic, this requires a sensitivity list containing
all inputs or a sensitivity list (*) for automatic detection.
User-Defined Primitives (UDP): Defines custom logic gates or small modules when
standard primitives are insufficient.
Key Considerations
Sensitivity Lists: In always blocks, omitting inputs can lead to mismatched simulation
and synthesis results (creating unintended latches).
Propagation Delay: HDL can model gate delays (#delay) to simulate real-world timing
behavior.
Synthesis: Dataflow and behavioral styles are generally preferred for RTL (Register
Transfer Level) design as they are easier to synthesize into gate-level netlists.