Combinational Circuits Notes PDF
Combinational Circuits Notes PDF
Circuits
orsuvenkatakrishnaiah
• Combinational circuits
• Half & Full adder
• Binary adder/ Subtractor
• CLA & BCD Adder
• Half & Full subtractor
• Binary multipliers
• Magnitude comparator
• Decoder and its applications for logic implementation
• Encoder & Priority encoder
• Multiplexor & De-multiplexer
• Logic diagrams using MUX
• Hazards
orsuvenkatakrishnaiah
1
• Combinational Logic Circuits are memoryless digital logic circuits
whose output at any instant in time depends only on the
combination of its inputs. i.e., the output is dependant at all times on
the combination of its inputs. It is memoryless.
• Combinational circuit is a circuit in which it combine the different
gates in the circuit, for example encoder, decoder, mux and demux.
Some of the characteristics of combinational circuits are following −
• The output of combinational circuit at any instant of time, depends
only on the levels present at input terminals.
• The combinational circuit 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.
orsuvenkatakrishnaiah
2
Half Adder: adds two 1-bit
operands
• Truth table :
X Y HS=(X+Y) CO
0 0 0 0 X
HS
0 1 1 0 Y
1 0 1 0
1 1 0 1 CO
•
HS X Y
CO X Y
orsuvenkatakrishnaiah 3
Full Adders: provide for carries between bit
positions
orsuvenkatakrishnaiah 6
Combinational logic implementation
Realize Full Adder using Decoder
concept.
orsuvenkatakrishnaiah
11
Ripple Adder
orsuvenkatakrishnaiah 8
74x283
4-bit
adder
• Uses carry look-ahead
internally
orsuvenkatakrishnaiah 9
16-
bit
grou
p
rippl
e
adde
r
orsuvenkatakrishnaiah 10
Subtractio
n
• Subtraction is the same as addition of the two’s complement.
• The two’s complement is the bit-by-bit complement plus 1.
• Therefore, X – Y = X + Y’ + 1
orsuvenkatakrishnaiah 11
Full Subtractor = full
adder, almost
orsuvenkatakrishnaiah 13
Using Adder as a
Subtractor
• Ripple Adder can be used as a Subtractor by inverting Y and setting the initial carry (
CIN ) to 1
orsuvenkatakrishnaiah 14
Binary
Multipliers
15
orsuvenkatakrishnaiah
2:2
Multipliers
16
orsuvenkatakrishnaiah
2: 2
multipliers
17
orsuvenkatakrishnaiah
4*4
Multipliers
18
orsuvenkatakrishnaiah
19
orsuvenkatakrishnaiah
20
orsuvenkatakrishnaiah
COMPARATORS
21
orsuvenkatakrishnaiah
Magnitude
comparators
• Magnitude Comparator are digital circuits which have two ports
which accept and have three single bit outputs. It is used to
comparing individual bits, multi-bit comparators can be
constructed to compare whole BCD words to produce an output if
one word is larger, equal to or less than the other.
22
orsuvenkatakrishnaiah
23
orsuvenkatakrishnaiah
1-bit
comparator
24
orsuvenkatakrishnaiah
1- Bit Comparator Logic
diagram
25
orsuvenkatakrishnaiah
2-BIT COMPARATORS
26
orsuvenkatakrishnaiah
2-bit
comparator
27
orsuvenkatakrishnaiah
2-bit Comparator Circuit
diagram
28
orsuvenkatakrishnaiah
4-bit comparator
The condition of A>B can be possible in the
following four cases:
1. If A3 = 1 and B3 = 0
2.If A3 = B3 and A2 = 1 and B2 = 0
3.If A3 = B3, A2 = B2 and A1 = 1 and B1
=0
4.If A3 = B3, A2 = B2, A1 = B1 and A0 = 1
and B0 = 0
29
orsuvenkatakrishnaiah
Similarly the condition for A<B can be
possible in the following four cases:
1.If A3 = 0 and B3 = 1
1.If A3 = B3 and A2 = 0 and B2 = 1
2.If A3 = B3, A2 = B2 and A1 = 0 and B1 = 1
3.If A3 = B3, A2 = B2, A1 = B1 and A0 = 0
and B0 = 1
30
orsuvenkatakrishnaiah
The condition A = B,
The condition of A=B is possible only when all
the individual bits of one number exactly
coincide with corresponding bits of another
number.
31
orsuvenkatakrishnaiah
4-BIT COMPARISION PROCESS
BIT BY BIT
32
orsuvenkatakrishnaiah
4-BIT COMP
33
orsuvenkatakrishnaiah
4-bit
Comparator
34
orsuvenkatakrishnaiah
N- bit
comparator
35
orsuvenkatakrishnaiah
Decoder
s
A decoder is a multiple-input, multiple-output
logic circuit that converts coded inputs into coded
outputs, where the input and output codes are
different. The input code generally has fewer bits
than the output code, and there is one-to-one
mapping from input code words into output code
words.
input
code word output
enable code word
inputs Decoder
Return Next
orsuvenkatakrishnaiah 41
Decoder
s
Binary decoder
The most common decoder circuit is an n-to-2
n
Y 2 I1 I 0 EN Y 3 I1 I 0 EN
Simulation
orsuvenkatakrishnaiah Return Back Next
43
Decoder
s
It is not necessary to use all of the outputs of a
decoder, or even to decode all possible input
combinations, e.g. a decimal or BCD decoder.
Logic Symbols for Lager-Scale Elements
The most basic rule is that logic symbols are
orsuvenkatakrishnaiah 53
Decoder
s
Seven-Segment Decoders
a Seven-segment display normally
output
input code
code ENCODER
orsuvenkatakrishnaiah 50
Encoders vs.
Decoders
Decoder Encoder
Binary decoders/encoders
n-to-2^n 2^n-to-n encoder
Input code : Binary Code Input code : 1-out-of-2^n.
Output code :1-out-of-2^n. Output code : Binary Code
orsuvenkatakrishnaiah 51
Encoders and
Decoders
• The combinational circuits that
modify the binary data into N output
lines are known as Encoders. The
combinational circuits that convert
the binary data into 2N output lines
are called Decoders.
• In digital electronic projects, the
encoder and decoder play an
important role. It is used to convert
the data from one form to another
form.
52
orsuvenkatakrishnaiah
53
orsuvenkatakrishnaiah
4-2
Encoder
54
orsuvenkatakrishnaiah
Binary
Encoder Binary encoder
• 2^n-to-n encoder : 2^n inputs and n outputs. I0
• Input code : 1-out-of-2^n. I1
• Output code : Binary Code
I2 Y0
I3 Y1
I4 Y2
• Example : n=3, 8-to-3 encoder I5
• Inputs Outputs I6
I7
I0 I1 I2 I3 I4 I5 I6 I7 Y2 Y1 Y0
1 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 1 0
0 0 0 1 0 0 0 0 0 1 1
0 0 0 0 1 0 0 0 1 0 0
0 0 0 0 0 1 0 0 1 0 1
0 0 0 0 0 0 1 0 1 1 0
0 0 0 0 0 0 0 1 1 1 1
orsuvenkatakrishnaiah 55
8-to-3 encoder
Implementation
• Simplified implementation: I0
Y2
- From the truth I1
table Y0 = I1 + I3 +
I5 + I7 Y1 = I2 + I3 + I2
I6 + I7 Y2 = I4 + I5 +
Y1
I6 + I7 I3
• Limitations : I4
- I0 has no effect on the output I5
- Only one input can be activated Y0
I6
• Application:
Handling multiple devices requests I7
• But, no simultaneous
Establishing priorities requests
solve the problem of multiple requests
orsuvenkatakrishnaiah 56
Need of Priority
Encoder
57
orsuvenkatakrishnaiah
58
orsuvenkatakrishnaiah
59
orsuvenkatakrishnaiah
4-2 Priority encoder
60
orsuvenkatakrishnaiah
Need priority in most
applications
orsuvenkatakrishnaiah 61
Priority
Encoder
• Assign priorities to the inputs
• When more than one input are asserted, the output generates the code
of the input with the highest priority
• Priority Encoder :
H7=I7 (Highest Priority)
H6=I6.I7’ Priority encoder
H5=I5.I6’.I7’
H4=I4.I5’.I6’.I7’ Priority Circuit Binary encoder
H3=I3.I4’.I5’.I6’.I7’
H2=I2.I3’.I4’.I5’.I6’.I7’ I7 I7 H7 I7
H1=I1. I2’.I3’.I4’.I5’.I6’.I7’ I6 I6 H6 I6
H0=I0.I1’. I2’.I3’.I4’.I5’.I6’.I7’ I5 I5 H5 I5 Y2 A2
IDLE= I0’.I1’. I2’.I3’.I4’.I5’.I6’.I7’
I4 I4 H4 I4 Y1 A1
- Encoder
I3 I3 H3 I3 Y0 A0
A0=Y0 = H1 + H3 + H5 + H7
A1=Y1 = H2 + H3 + H6 + H7 I2 I2 H2 I2
A2=Y2 = H4 + H5 + H6 + H7 I1 I1 H1 I1
I0 I0 H0 I0
IDLE
IDLE
orsuvenkatakrishnaiah 62
8-input priority
encoder
orsuvenkatakrishnaiah 63
74x148 8-input priority
encoder
orsuvenkatakrishnaiah 64
74x148 8-input priority
encoder
• Active-low I/O
• Enable Input
• “Got Something": Group Select
orsuvenkatakrishnaiah
• Enable Output 65
74x148 Truth
Table
orsuvenkatakrishnaiah 66
74x1
48
circui
t
orsuvenkatakrishnaiah 67
Cascading priority
encoders
• 32-input
priority encoder
orsuvenkatakrishnaiah 68
Multiplex
ers
orsuvenkatakrishnaiah 69
Multiplexers or Data
Selectors
orsuvenkatakrishnaiah 70
Multiplexer
s
orsuvenkatakrishnaiah 71
74x151
8-input 1-
bit
multiplexer
orsuvenkatakrishnaiah 72
Multiplexers IC
Specifications
74x151
8-input, 1-bit-wide Multiplexer
8-input, 1-bit Multiplexer
1 bit, 8-to-1 Multiplexer
1, 8-to-1 Multiplexer
1, 1-of-8 Data Selector
Single, 1-of-8 Data Selector
74x157
2input, 4-bit-wide Multiplexer
2-input, 4-bit Multiplexer
4-bit, 2-to-1 Multiplexer
4, 2-to-1 Multiplexer
Quadruple 2-line to 1-line Data Selector/Multiplexer
Quad, 1-of-2 Data Selector
74x153
4-input, 2-bit-wide Multiplexer
2-bit, 4-to-1 Multiplexer
2, 1-of-4 Data Selector
orsuvenkatakrishnaiah 73
74x151 truth
table
orsuvenkatakrishnaiah 74
Other multiplexer
varieties
• 2-input, 4-bit-wide
• 74x157
• 4-input, 2-bit-
wide
– 74x153
orsuvenkatakrishnaiah 75
Multiplexers, De-
multiplexers
• A multiplexer is used to select one of n sources of data to
transmit on a bus.
orsuvenkatakrishnaiah 76
Decoder/Demultipl
exers
orsuvenkatakrishnaiah 77
Binary 2-to-4
decoder
74x85 74x85
A<BIN A<BOUT A<BIN A<BOUT A<B
A=BIN A=B OUT A=BIN A=B OUT A=B
A>BIN A>BOUT A>BIN A>BOUT A>B
A0 A0 A4 A0
B0 B0 B4 B0
A1 A1 A5 A1
B1 B1 B5 B1
A2 A2 A6 A2
B2 B2 B6 B2
A3 A3 A7 A3
B3 B3 B7 B3
Least Significant bits
orsuvenkatakrishnaiah Most Significant bits 80
8-bit Magnitude
Comparator
orsuvenkatakrishnaiah 81
Hazards
• A hazard, if exists, in a digital circuit causes a temporary fluctuation
in output of the circuit or a hazard is a temporary disturbance in
ideal operation of the circuit which if given some time, gets resolved
itself.
• Hazards are unwanted switching transients that appear at the
output of a circuit due to different propagation delays of different
paths. i.e., the unwanted switching which appears in the output, will
be very short in duration, like a glitch that will be removed after
some time. Such a transient is also called a glitch or a spike that
occurs due to the Hazardous behaviour of a circuit.
• Static hazard occur when an input changes and it causes the output
to change at the same moment before output becomes stable.
• Dynamic hazard occur when output changes for two adjacent
inputs while the output should change only once.
orsuvenkatakrishnaiah
82
Types of Hazards in Digital
Electronics
1.Static Hazards
2.Dynamic Hazards
3.Essential Hazards
orsuvenkatakrishnaiah
85
• Static 1 Hazard:
• Static 1 hazard occurs due to different delays experienced by the signal
through the Gates connected in circuits.
• Static 1 hazard always occurs in SOP (Sum of Product) terms.
• Static 0 Hazard:
• Static 0 hazard occurs due to different delays experienced by the signal
through the Gates connected in circuits.
• Static 0 hazard always occurs in POS (Product of Sum) terms.
• Static hazard can be eliminated by adding redundant terms which
increases the hardware but removes the glitch.
orsuvenkatakrishnaiah
86
orsuvenkatakrishnaiah
87
Dynamic
Hazards
• Dynamic Hazard occurs during a multilevel circuit where the output
must make a transition from 0 to 1 or from 1 to 0 but the output
makes multiple transitions then settles to a final value.
• Dynamic hazard occurs when the output changes for 2 adjacent input
combinations while changing, the output should change on just one
occasion . But it’s going to change three or more times briefly
intervals due to different delays in several paths.
• Dynamic hazards occur only in multilevel circuits.
• Dynamic hazards are more complex to resolve but note that if all
static hazards are eliminated from a circuit, then dynamic hazards
cannot occur
orsuvenkatakrishnaiah
88
Static & Dynamic
Hazards
• Static hazard occur when an input changes and it causes the output
to change at the same moment before output becomes stable.
• Dynamic hazard occur when output changes for two adjacent inputs
while the output should change only once.
• A static hazard is a change of a signal state twice in a row when the
signal is expected to stay constant. When one input signal changes,
the output changes momentarily before stabilizing to the correct
value.
• "A dynamic hazard is the possibility of an output changing more
than once as a result of a single input change" Dynamic hazards
often occur in larger logic circuits where there are different routes to
the output (from the input).
orsuvenkatakrishnaiah
89
Essential
Hazards
• This type of hazard is caused by unequal delays along two or more
paths that originate from an equivalent input.
• An excessive delay through an inverter circuit as compared to the
delay related to the feedback path may cause such a hazard.
• Essential hazards can’t be corrected by adding redundant gates as in
static hazards.
• To avoid essential hazards, each feedback circuit must be handled
with individual care to make sure that the delay within the feedback
path is long enough compared with delays of other signals that
originate from the input terminals.
• https://www.allaboutcircuits.com/technical-articles/hazards-in-
combinational-logic/
orsuvenkatakrishnaiah
90
Programmable Logic Devices
(PLD’S)
orsuvenkatakrishnaiah
91
PLD’s
• A programmable logic device (PLD) is an electronic component used
to build reconfigurable digital circuits. Unlike digital logic
constructed using discrete logic gates with fixed functions, a PLD has
an undefined function at the time of manufacture.
orsuvenkatakrishnaiah
92
General Structure of
PLD
• Inputs to the PLD are applied to a set of
buffer/inverters. These devices have both the true
value of the input as well as the complemented value
of the input as its outputs.
• Outputs from these devices are the inputs to an array
of and-gates. The AND array generates a set of p
product terms.
• The product terms are inputs to an array of or-gates to
realize a set of m sum-of-product expressions.
orsuvenkatakrishnaiah
93
General Structure of PLD
orsuvenkatakrishnaiah
94
General Structure of
PLD
• One or both of the gate arrays are programmable.
• The logic designer can specify the connections
within an array.
• PLDs serve as general circuits for the realization of a
set of Boolean functions.
orsuvenkatakrishnaiah
95
Programming a PLD
orsuvenkatakrishnaiah
96
Programming a PLD
• Erasable PLD—connections can be reset to their
original conditions and then reprogrammed.
• Can be achieved by exposing the PLD to ultraviolet light or
using electrical signals
• PLDs programmed by a user are called field
programmable.
• User can also specify the desired connections and
supply the information to the manufacturer.
Manufacturer prepares an overlay that is used to
complete the connections as the last step in the
fabrication process.
• Such PLDs are called mask programmable.
orsuvenkatakrishnaiah
97
PLD Notation
orsuvenkatakrishnaiah
98
PLD
Notation
• Lack of cross indicates the fuse is blown or no connection exists.
orsuvenkatakrishnaiah
99
PLD
Notation
• The occurrence of a hard-wired connection that is not fusible is
indicated by a junction dot.
• For the special case when all the input fuses to a gate are kept
intact, a cross is placed inside the gate symbol.
orsuvenkatakrishnaiah
100
Programmable Read-Only Memory
(PROM)
orsuvenkatakrishnaiah
101
PROM Structure
orsuvenkatakrishnaiah
102
PROM Structure
PLD Notation
orsuvenkatakrishnaiah
103
PROM example: 3-8 Decoder A, B
obtained from fixed AND array
orsuvenkatakrishnaiah
104
NOT, OR, NAND & XOR using PROM
device?
orsuvenkatakrishnaiah
105
orsuvenkatakrishnaiah
106
orsuvenkatakrishnaiah
107
• The first PLDs were Programmable Logic Arrays (PLAs).
• APLAis a combinational, 2-level AND-OR device that can
be programmed to realise any sum-of-products logic
expression.
• APLAis limited by:
• the number of inputs (n)
• the number of outputs (m)
• the number of product terms (p)
• We refer to an “n x mPLAwith p product terms”. Usually,
p << 2 n.
• An n x mPLAwith p product terms contains p 2n-input
ANDgates and mp-input ORgates.
orsuvenkatakrishnaiah
108
• Each inputis connectedto a buffer that producesa true and a
complementedversionof the signal.
A4x3 PLAwith
6 product
terms.
• Compact • O1 = I1·I2 +
representation of the I1’·I2’·I3’·I4’ O2 =
4x3 PLA with 6 I1·I3’ + I1’·I3·I4 + I2
product terms. O3 = I1·I2 + I1·I3’ +
I1’·I2’·I4’
orsuvenkatakrishnaiah
110
PLA
orsuvenkatakrishnaiah
111
orsuvenkatakrishnaiah
112
orsuvenkatakrishnaiah
113
PAL
• Another PLD is PAL
(ProgrammableArray Logic).
orsuvenkatakrishnaiah
115
PAL
orsuvenkatakrishnaiah
116
PAL structure
orsuvenkatakrishnaiah
117
Implement Boolean Functions F, F2 using
PAL?
orsuvenkatakrishnaiah
118
Realize BCD- Gray code converter
using PAL?
orsuvenkatakrishnaiah
119