BIT DL 4
BIT DL 4
Unit-4
Combinational Logic
Unit-4
Combinational Logic
Combinational circuit is a circuit which consist of logic gates whose outputs at any instant of
time are determined directly from the present combination of inputs without regard to
previous input. The combinational circuit do not use any memory.
- There will be 2𝑛 combination of input variable for 𝑛 inputs.
- A combinational circuit can have 𝑛 number of inputs and 𝑚 number of outputs.
- For e.g. adders, subtractors, decoders, encoders etc.
Adders
Adders are the combinational circuits which is used to add two or more than two bits at a
time.
Types of adders:
- Half Adder
- Full Adder
1. Half Adder:
A combinational circuit that performs the addition of bits is called half adder. This circuit
needs two binary inputs and two binary outputs. The input variables designate the
augend(𝐴) and addend(𝐵) bits; the output variables produce the sum(𝑆) and carry(𝐶).
K-map:
From k-map the logical expression for sum and carry is:
𝐶 = 𝐴𝐵
𝑆 = 𝐴̅𝐵 + 𝐴𝐵̅ = 𝐴⨁𝐵
Logic diagram:
2. Full Adder:
A combinational circuit that performs the addition of three bits at a time is called full
adder. It consists of three inputs and two outputs, two inputs are the bits to be added, the
third input represents the carry from the previous position.
Simplification of carry:
Subtractors
Subtractor is a combinational logic circuit which is used to subtract two or more than two bits
at a time, and provides difference and borrow as an output.
Types of Subtractors:
- Half subtractor
- Full subtractor
1. Half Subtractor:
A half-subtractor is a combinational logic circuit that subtract two bits at a time and
produces their difference.
It has two inputs minuend (A) & subtrahend (B) and two outputs difference and borrow.
The difference is a result of subtraction and borrow is used to indicate borrow from next
most significant bit. The borrow bit is present only when 𝐴 < 𝐵.
Truth table:
K-map:
Logic Diagram:
2. Full Subtractor:
A combinational logic circuit used to subtract three binary digits at a time is called full
subtractor.
This circuit has three input and two outputs. The three inputs are 𝐴, 𝐵 𝑎𝑛𝑑 𝐵𝑖𝑛 , denote the
minuend, subtrahend and previous borrow respectively. The two outputs, 𝐷 𝑎𝑛𝑑 𝐵𝑜𝑢𝑡
represent the difference and output borrow, respectively.
Truth table for full subtractor:
Simplified expression of D and Bout using k-map in SOP can be obtained as;
Implementation of full subtractor using two half subtractor and one OR gate:
̅̅̅̅̅̅̅̅̅̅̅̅
𝐷 = (𝐴⨁𝐵)⨁𝐵𝑖𝑛 = (𝐴̅𝐵 + 𝐴𝐵̅)⨁𝐵𝑖𝑛 = (𝐴 ̅ 𝐵 + 𝐴𝐵̅ )𝐵𝑖𝑛 + (𝐴̅𝐵 + 𝐴𝐵̅)𝐵̅𝑖𝑛
= {(𝐴 + 𝐵̅)(𝐴̅ + 𝐵)}𝐵𝑖𝑛 + 𝐴̅𝐵𝐵̅𝑖𝑛 + 𝐴𝐵̅𝐵̅𝑖𝑛
= 𝐴̅𝐵̅𝐵𝑖𝑛 + 𝐴𝐵𝐵𝑖𝑛 + 𝐴̅𝐵𝐵̅𝑖𝑛 + 𝐴𝐵̅𝐵̅𝑖𝑛
Code Conversion
- The availability of large variety of codes for the same discrete elements of information
results in the use of different codes by the different system.
- A conversion circuit must be inserted between the two systems if each use different codes
for same information.
- Thus a code converter is a circuit that makes the two systems compatible even though
each uses a different binary information.
BCD to excess-3 Code Conversion:
BCD Excess-3 circuit will convert numbers from their binary representation to their excess-3
representation. Since each code uses four bits to represent a decimal digit, there must be four
input variables and four outputs variables. Let the input four binary variables are 𝐴, 𝐵, 𝐶 & 𝐷
and the four output variables are 𝑊, 𝑋, 𝑌 & 𝑍.
Truth table:
The Boolean functions for the outputs lines of the circuit are derived from k-maps
which are:
𝑊 = 𝐴 + 𝐵𝐶 + 𝐵𝐷 = 𝐴 + 𝐵(𝐶 + 𝐷)
𝑋 = 𝐵′ 𝐶 + 𝐵′ 𝐷 + 𝐵𝐶 ′ 𝐷′ = 𝐵′ (𝐶 + 𝐷) + 𝐵(𝐶 + 𝐷)′
𝑌 = 𝐶𝐷 + 𝐶 ′ 𝐷′ = 𝐶𝐷 + (𝐶 + 𝐷)′
𝑍 = 𝐷′
Logic diagram for BCD to excess-3 converter:
Truth table:
K-map:
Logic Diagram:
Analysis Procedure
To obtain the Boolean expressions and truth tables from the combinational logic circuit, we
need to analyse the circuit. First ensure that the circuit is combinational - that is there is no
feedback of an output to an input that the output depends on.
(a) (b)
(c)
Fig: Implementing 𝑭 = (𝑨𝑩 + 𝑬)(𝑪 + 𝑫) with NOR gates
Exclusive-OR (XOR)
The exclusive-OR (XOR) denoted by the symbol ⨁ is a logical operation that performs the
following Boolean operation:
𝑥⨁𝑦 = 𝑥𝑦 ′ + 𝑥 ′ 𝑦
It is equal to 1 if only 𝑥 is equal to 1 or if only 𝑦 is equal to 1 but not when both are equal to
1.
Parity checker:
A circuit that checks the parity in the receiver is called parity checker. The parity checker
circuit checks for possible errors in the transmission.
- Since the information transmitted with even parity, the received must have an even
number of 1’s. If it has odd number of 1’s, it indicates that there is an error occurred
during transmission.
3-bit even parity checker truth table;
The output of the parity checker is denoted by 𝑃𝐸𝐶 (Parity Error Checker). If there is error,
that is, if it has odd number of 1’s, it will indicate 1. If no then 𝑃𝐸𝐶 will indicate 0.
(Here truth
table’s 𝑃 = 𝐷)
In the above calculation 𝑎1 𝑎0 is the multiplicand and 𝑏1 𝑏0 is the multiplier. The first product
obtained from multiplying 𝑏0 with the multiplicand is called as partial product 1. And the second
product obtained from multiplying 𝑏1 with the multiplicand is known as the partial product 2.
Based on the above equation, we can see that we need four AND gates and two half
adders. The AND gate will performs the multiplication, and the half adders will add the partial
product terms. Hence the circuit obtained is as follows:
Q. Design a BCD-to-excess-3 code converter using a 4-bit full adders MSI circuit.
Soln:
𝐸𝑥𝑐𝑒𝑠𝑠 − 3 𝑐𝑜𝑑𝑒 = 𝐵𝐶𝐷 𝑐𝑜𝑑𝑒 + (0011)2
- In examining the content of the table, it is apparent that when the binary sum is equal to
or less than 1001, the corresponding BCD number is identical, and therefore no
conversion is needed.
- When the binary sum is greater than 1001, we obtain a non- valid BCD representation.
The addition of binary 0110 (6 in decimal) to the binary sum converts it to the correct
BCD representation and also produces an output carry.
- It is obvious from the table that a correction is needed when the binary sum has an output
carry 𝑘 = 1.
- The other six combination from 1010 to 1111 that need a correction have a 1 in position
𝑍8 . To distinguish them from binary 1000 and 1001, which also have a 1 in position 𝑍8 ,
we specify further that either 𝑍4 or 𝑍2 must have 1.
- The condition for a correction and an output carry can be expressed by the Boolean
function: 𝑪 = 𝑲 + 𝒁𝟖 𝒁𝟒 + 𝒁𝟖 𝒁𝟐
- When output carry C = 0, nothing is added to the binary sum.
- When output carry C = 1, binary 0110 is added to the binary sum through the bottom 4-
bit binary adder to convert the binary sum into BCD sum. (In fig. below)
Magnitude Comparator
A magnitude comparator is a combinational circuit that compares two numbers 𝐴 & 𝐵 and
determines their relative magnitudes. The outcome of the comparison is specified by three
binary variables that indicate whether 𝐴 > 𝐵, 𝐴 = 𝐵, 𝑜𝑟 𝐴 < 𝐵.
Verification of (𝑨 = 𝑩):
- The equality relation of each pair of bits can be expressed:
𝑥𝑖 = 𝐴𝑖 𝐵𝑖 + 𝐴̅𝑖 𝐵̅𝑖 , 𝑖 = 0, 1, 2, 3
Where 𝑥𝑖 = 1 only if 𝐴𝑖 = 𝐵𝑖 and 𝑥𝑖 = 0 only if 𝐴𝑖 ≠ 𝐵𝑖 .
- For equality condition to exist, all 𝑥𝑖 variables must be equal to 1. 𝐴 & 𝐵 will be equal if
𝑥3 𝑥2 𝑥1 𝑥0 = 1.
∴ (𝑨 = 𝑩) = 𝒙𝟑 𝒙𝟐 𝒙𝟏 𝒙𝟎
In the same manner we can derive the expression for (𝑨 < 𝑩).
̅ 𝟑 𝑩𝟑 + 𝒙𝟑 𝑨
∴ (𝑨 > 𝑩) = 𝑨 ̅ 𝟐 𝑩𝟐 + 𝒙𝟑 𝒙𝟐 𝑨
̅ 𝟏 𝑩𝟏 + 𝒙𝟑 𝒙𝟐 𝒙𝟏 𝑨
̅ 𝟎 𝑩𝟎
Logic Diagram:
Decoders
A decoder is a combinational circuit that converts binary information from 𝑛 input lines to a
maximum of 2𝑛 unique output lines.
- If 𝑛-bit decoded information has unused or don’t care combinations, the decoder output
will have less than 2𝑛 outputs.
- The decoders presented here are called 𝑛 − 𝑡𝑜 − 𝑚 line decoders where 𝑚 ≤ 2𝑛 . Their
purpose is to generate the 2𝑛 (or less) minterms of 𝑛 input variables.
Truth table:
From the truth table it is observed that the output variables are mutually exclusive because
only one output can be equal to 1 at any one time. The output line whose value is equal to 1
represents the minterm equivalent of the binary number presently available in the input lines.
BCD-to-Decimal Decoder
The decoder which convert binary decimal code into decimal values is called BCD to decimal
decoder. The BCD code uses 4-bits and therefore there can be 24 input combinations. This
produces 16-different output signals but the decimal digits are from 0 to 9. Hence six input
combinations are not used in decimal system. Therefore we can use don’t care to represent 10
to 15 and use K-map to simplify the circuit.
Encoder
An encoder is a combinational circuit that performs the inverse operation from that of
decoder. It has 2𝑛 input lines and 𝑛 output lines.
The output lines generate the binary code corresponding to the input value.
Logic circuit:
Limitation: Only one input can be enabled at a time. If two inputs are enabled at the same
time, then output is undefined.
Q. Design a 3 to 8 line decoder using two 2 to 4 line decoder and explain it.
Soln:
X
2×4
Y 𝐷0 − 𝐷3
Decoder
E
2×4
𝐷4 − 𝐷7
Decoder
Truth table:
Inputs Outputs
A B 𝐷0 𝐷1 𝐷2 𝐷3 For the NAND decoder only one output can be
0 0 0 1 1 1 LOW and equal to logic ‘0’ at any given time
0 1 1 0 1 1 with all other outputs being HIGH at logic ‘1’.
1 0 1 1 0 1
1 1 1 1 1 0
Note: Similar method for 3-to-8 line decoder in which 3-lines of input are present and 8
output lines.
Q. Using a decoder and external gates, design the combinational circuit defined by the
following three Boolean functions:
𝑭𝟏 = 𝒙′ 𝒚′ 𝒛 + 𝒙𝒛′
𝑭𝟐 = 𝒙′ 𝒚𝒛′ + 𝒙𝒚′
𝑭𝟑 = 𝒙𝒚𝒛′ + 𝒙𝒚
Soln:
Truth table:
Logic Diagram
Multiplexer (MUX)
- A multiplexer is a combinational circuit that selects binary information from one of many
input lines and directs it to a single output line.
- Multiplexing is the process of transmitting a large number of information over a single
line.
- The selection of a particular input lines is controlled by a set of selection lines. Normally
there are 2𝑛 input lines and 𝑛 selection lines whose bit combinations determine which
input is selected.
- A multiplexer is also called a data selector, since it selects one of many inputs and steers
the binary information to the output line.
Q. Design a 8-to-1 line multiplexer using lower order multiplexers and explain it.
Soln:
The same selection lines, s1 & s0 are applied to both 4x1 Multiplexers. The data inputs of
upper 4x1 Multiplexer are I0 to I3 and the data inputs of lower 4x1 Multiplexer are I 4 to I7.
Therefore, each 4x1 Multiplexer produces an output based on the values of selection lines,
s1 & s0.
The outputs of first stage 4x1 Multiplexers are applied as inputs of 2x1 Multiplexer that is
present in second stage. The other selection line, s2 is applied to 2x1 Multiplexer.
If s2 is zero, then the output of 2x1 Multiplexer will be one of the 4 inputs I 0 to I3 based
on the values of selection lines s1 & s0.
If s2 is one, then the output of 2x1 Multiplexer will be one of the 4 inputs I 4 to I7 based
on the values of selection lines s1 & s0.
Therefore, the overall combination of two 4x1 Multiplexers and one 2x1 Multiplexer performs
as one 8x1 Multiplexer.
Now the implementation table is If the minterms in a column are not circled, then
apply 0 to the corresponding multiplexer unit.
If the 2 minterms are circled, then apply 1 to the
corresponding multiplexer unit.
If the bottom minterm is circled, and top is not circled
then apply 𝐴 to the corresponding multiplexer unit.
If the top minterm is circled, and bottom is not circled
then apply 𝐴′ to the corresponding multiplexer unit.
Multiplexer implementation:
Now the implementation table and multiplexer implementation are given below:
Demultiplexer (DEMUX)
- A decoder with an enable input can function as a de-multiplexer.
- A de-multiplexer is a circuit that receives information on a single line and transmit this
information on one of 2𝑛 possible output lines. The selection for particular output line is
controlled by the bit values of 𝑛 selection lines.
1 to 4 DEMUX:
The 1:4 Demux consists of 1 data input bit, 2 control bits and 4 output bits. I is the input bit,
Y0, Y1, Y2, Y3 are the four output bits and S0 and S1 are the control bits.
The common selection lines, s1 & s0 are applied to both 1x4 De-Multiplexers. The outputs of
upper 1x4 De-Multiplexer are Y7 to Y4 and the outputs of lower 1x4 De-Multiplexer are Y3 to
Y0.
The other selection line, s2 is applied to 1x2 De-Multiplexer. If s2 is zero, then one of the four
outputs of lower 1x4 De-Multiplexer will be equal to input, I based on the values of selection
lines s1 & s0. Similarly, if s2 is one, then one of the four outputs of upper 1x4 De-Multiplexer
will be equal to input, I based on the values of selection lines s1 & s0.
Internally, the ROM is a combinational circuit with AND gates connected as a decoder
and a number of OR gates equal to the number of outputs in the unit.
Soln:
Truth table specifies a combinational circuit with 2 inputs and 2 outputs. The Boolean
function can be represented in SOP as;
Q. Design a combinational circuit using a ROM. The circuit accepts a 3-bit number and
generates an output binary number equal to the square of the input number.
Soln:
First step is to derive the truth table for the combinational circuit
Output B0 is always equal to input A0; so there is no need to generate B0 with a ROM since it
is equal to an input variable. Moreover, output B1 is always 0, so this outputs is always
known.
Implementation by ROM:
Types of ROM:
1. Mask ROM
- Permanent programming done at fabrication time
- Fabrication take place at factory as per customer order
- Very expensive and therefore feasible only for large quantity orders
- Once the memory is programmed during the manufacturing process, the user cannot
alter the programs.
2. PROM (Programmable ROM)
- A blank chip which can be programmed only once using a special device called
programmer.
- Once it’s programmed its content cannot be modified or erased.
3. EPROM (Erasable Programmable ROM)
- Can be programmed multiple times.
- Its content can be erased by using UV (ultra violet) light.
- Exposure to the UV light will erase all contents.
4. EEPROM (Electrically Erasable Programmable ROM)
- Similar to EPROM but its contents can be electrically erased and re-written without
having to remove it from the computer.
So, Programmable Logic Array is a LSI component that can be used in economically as an
alternative to ROM where number of don’t-care conditions is excessive.
PLA does not provide full decoding of the variables and does not generate all the
minterms as in the ROM.
A block diagram is shown in fig. It consists 𝑛 inputs, 𝑚-outputs, 𝑘 product terms and 𝑚 sum
terms. The product terms constitute a group of 𝑘 AND gates and the sum terms constitute a
group of 𝑚 OR gates.
Note: PLA implements the functions in their sum of products form (standard form, not
necessarily canonical as with ROM). Each product term in the expression requires an AND
gate. It is necessary to simplify the function to a minimum number of product terms in order
to minimize the number of AND gates used.
There are six product terms in 𝐹1 and 𝐹2 , but only four product terms are allowed to use.
Now implement 𝐹1′ (𝐴, 𝐵, 𝐶)
𝐹1′ (𝐴, 𝐵, 𝐶 ) = ∑(0, 1, 2, 4)
𝐹2 (𝐴, 𝐵, 𝐶 ) = ∑(0, 2, 4, 7)
From these equation it is clear that the minterms 0, 2 and 4 are common.
Now obtain the minimized expression by using them
𝐹1 = 𝐵′ 𝐶 ′ + 𝐴′ 𝐶 ′ + 𝐴′ 𝐵′
𝐹2 = 𝐵′ 𝐶 ′ + 𝐴𝐵𝐶 + 𝐴′ 𝐶 ′
Note that output 𝐹1 is the normal (or true) output even though a C is marked under it. This is
because 𝐹1′ is generated prior to the output inverter. The inverter complements the function to
produce 𝐹1 in the
output.
Draw PLA circuit yourself.
Reference: