Module-3 Combinational Circuits
Module-3 Combinational Circuits
III Semester
2018 Scheme
Prepared By:
Dr. Jyothi A P
Assistant Professor,
Department of Computer Science and Engineering,
RVITM, Bengaluru – 560076
Email: [email protected]
[email protected]
RV Institute of Technology and Management®
Module 3
Combinational Circuit Design and Simulation Using Gates
Syllabus:
Review of Combinational circuit design, design of circuits with limited Gate Fan-in ,Gate delays and
Timing diagrams, Hazards in combinational Logic, simulation and testing of logic circuits. Multiplexers,
three state buffers, decoders and encoders, Programmable Logic devices, Programmable Logic Arrays,
Programmable Array Logic.
Fig 3.5 Timing diagrams for various signals in the circuit as a function of time
In the circuit given below, each gate has a propagation delay of 20ns. B and C inputs are held constant with
values B=1 and C=0. When input A is changed from 0 to 1 at t=40 ns and 1 to 0 at t=100 ns. The output of
the gate G1 changes after A changes, and the output of gate G2 changes 20 ns after G1 changes as shown in
the below diagram Fig. 3.6.
Hazards when occur in a combinational circuits, may cause a temporary false output value. But when
such combinational circuits are used in the asynchronous sequential circuits, they may result in a
transition to a wrong stable state.
Types of Hazards
1. Static-1 hazard
2. Static-0 hazard
3. Dynamic Hazards
Static-1 Hazard
In a combinational circuit, if output goes momentarily 0 when it should remain a 1, the hazard is known
as static-1 hazard. The same is depicted in Fig 3.8
The following example explains static-1 hazard. If A= C = 1, then F=B + B' = 1, so F should remain
constant 1 when B changes from 1 to 0. But as each gate has a propagation delay of 10ns, E will go to 0
before D goes to 1, resulting in a momentary 0 (glitch caused by 1- hazard) appearing at the output F. As
soon as the B changes to 0, both inverter input (B) and output (B') are 0 until the propagation delay has
elapsed. Hence F momentarily goes to 0.
An A.A' condition should always generate 0 at the output i.e. static-0. But the NOT gate output takes finite
time to become 0 following a 0->1 transition of A. Thus for final AND gate there are two ones appearing at
its input for a small duration resulting a 1 at its output. This Y=1 occurs for a very small duration but may
cause malfunctioning of sequential circuit.
Debugging
The following example depicted in Fig 3.13 shows how to debug the circuit, if we are getting wrong output:
Multiplexers
It is a digital circuit with many inputs but only 1 output. By applying control-signals, we can steer any input
to output. Thus, it is also called a data-selector and control inputs are termed select inputs (Fig 3.1). The
circuit has n input signals, m control signals and 1 output signal. m control signals can select at the most 2m
input signals thus n ≤ 2m .
4:1 Multiplexer
• Depending on control inputs A and B, one of the 4 inputs D0 to D3 is steered to output Y as specified in Fig
3.14.
• The logic equation of the circuit (Fig: 3.1c) gives a SOP representation.
• Here, each AND gate generates a minterm which are finally summed by OR gate.
In other words, for AB=00, the first AND gate to which D0 is connected remains active and equal to D0 and
all other AND gate are inactive with output held at logic 0. If D0=0, Y=0 and if D0=1, Y=1.
Similarly, for AB=01, second AND gate will be active and all other AND gates remain inactive. Thus,
output Y=D1.
Fig 3.14 a) Multiplexer Block Diagram, (b) 4-to-1 multiplexer truth table, (c) Its logic circuit
III- Semester, Analog and Digital Electronics (18CS33) Page 9 of 33
RV Institute of Technology and Management®
Commercial multiplexer ICs come in integer power of 2, e.g. 2-to-1, 4-to-1, 8-to-1, 16-to-1 multiplexers.
16-to-1 multiplexer
Fig 3.15 shows a 16-to-1 multiplexer. The input bits are labeled D0 to D15. Only one of these is transmitted
to the output. It depends on the value of ABCD, the control input. For instance, when ABCD= 0000
the upper AND gate is enabled while all other AND gates are disabled. Therefore, data bit D0 is transmitted
to the output, giving Y=D0. If D0 is low, Y is low; if D0 is high, Y is high. The output can be written as
Multiplexer logic
• Two standard methods for implementing a truth table are SOP and POS solutions. The third method is the
multiplexer solution. For example to use a 74150 to implement Table 3.1, complement each Y output to get
the corresponding data input.
D0=1'=0
D1=0'=1
….
….
D15=1'=0
• D0 is grounded, D1 is connected to +5V, D2 is grounded and so forth (Fig 3.16).
When ABCD=0000, D0 is the selected input. Since D0 is low, Y is high.
When ABCD=0001, D1 is the selected input. Since D1 is high, Y is low.
•The multiplexer is active (enabled) when the STROBE is low and inactive (disabled) when it is high.
Because of this, the STROBE is called an active low signal; it causes something to happen when it is low
rather than when it is high.
Demultiplexers
It is a digital circuit with 1 input and many outputs (Fig: 3.19). By applying control signals, we can steer the
input signal to one of the output lines. The circuit has 1 input signal, m control or select signals and n output
signals where n ≤ 2m.
III- Semester, Analog and Digital Electronics (18CS33) Page 12 of 33
RV Institute of Technology and Management®
1:16 Demultiplexer
The input data bit (D) is transmitted to the data bit of output lines depending on the value of ABCD, the
control input. When ABCD=0000, the upper AND gate is enabled while other AND gates are disabled.
Therefore, data bit D is transmitted only to the Y0 output, giving Y0=D. If D=low, Y0=low. If D=high,
Y0=high. If the control nibble is changed to ABCD=1111, all gates are disabled except the bottom AND
gate. Then, D is transmitted only to the Y15 output and Y15=D.
ABCD= 0111
Then the Y7 output is low, while all other- outputs are high.
LED emits radiation when forward biased. This is because when free electrons recombine with holes near the
junction. As the free electrons fall from a higher energy level to a lower one, they give up energy in the form
of heat and light. The elements like gallium, arsenic, and phosphorus can emit red, green, yellow, blue, orange
and infrared (invisible) light.
Seven Segment Indicator
Fig 3.14 shows a seven segment indicator, i.e seven LEDs labeled a through g. By forward-biasing different
LEDs we can display digits from 0 to 9.
For example, to display 0, we need to light up segments a, b, c, d, e, and f.
To display 5, we need to light up segments a, c, d, f, and g.
Seven segment indicators may be the common-anode type where all anodes are connected together as in fig
3.15a or the common-cathode type where all cathodes are connected together as in fig 3.15b. With common
anode type, a current limiting resistor has to be connected between each LED and ground. The size of the
resistor determines how many current flows through the LED.
The typical LED current is between 1 and 50 mA. The common cathode type uses a current limiting resistor
between each LED and +VCC.
Fig 3.16b shows 7448 driving a common cathode indicator. The internal logic converts the BCD input to the
required output. When the BCD input is 0100, the internal logic forces the LEDs b, c, f, and g to conduct.
The seven segment indicator then displays a 4. 7448 has its own current limiting resistor on the chip.
The 74147 is called a priority encoder because it gives priority to the highest-order input. If all inputs X1
through X9 are low, highest of these, X9 has got highest priority and it is encoded. When X9 is high, X8 has
got next priority; it is encoded, if it is low.
Exclusive-OR Gates
This has a high output only when an odd number of inputs is high (Figure: 3.20).
• The upper AND gate forms the product A'B, while the lower one produces AB'. Therefore, the output of the
OR gate is Y=A'B+AB'
• This gate always produces an output 1 only when n-bit input has an odd number of 1s
• If X7X6X5X4 X3X2X1X0=0110 0001. Now, this has odd parity. In this case, the XOR gate produces an
output 1. But the inverter produces a 0, so that the final 9-bit output is 0 0110 0001. Again, the final output
has odd parity.
• If the 8-bit input has even parity, a 1 comes out of the inverter to produce a final output with odd parity.
On the other hand, if the 8-bit input has odd parity, a 0 comes out of the inverter, and the final 9-bit output
again has odd parity.
Comparator Design
The generic procedure for 2-bit comparator design is given below. This can be easily extended to make any
n-bit magnitude comparator
• Define
1. Bit-wise greater than terms (G):
G1 = X1Y1’ G0 = X0Y0’
2. Bit-wise less than terms (L):
L1 = X1’Y1 L0 = X0’Y0
3. Bit-wise equality terms (E):
E1 = (G1 + L1)’ E0 = (G0 + L0)’
From the definitions of G, L and E, we have 2-bit comparator output as follows:
The 7485 IC
It is a 4-bit magnitude comparator TTL IC. The functional diagram is as shown below:
Fig. 3.34
Programming a PAL
We can burn in the desired fundamental products, which are then ORed by the fixed output connections.
Suppose we want to generate the following Boolean functions:
Y3 = ̅B D̅ + ̅BC ̅+ BCD̅ + ABC ̅
Y2 = ̅BC ̅+ ̅BCD + ABCD
Y1= ̅B ̅+ ̅BC+A ̅C+AB ̅
Y0 = ABCD
To start with ̅B ̅D, on the top input line, remove the first x, the fourth x, the fifth x, and the eight x. Then the
top AND gate has an output of ̅B ̅D.
By removing the xs on the next three input lines, we can make the top four AND gates produce the
fundamental products of Y3. The fixed OR connections on the output side imply that the first OR gate
produces an output of Y3 = B̅ D̅ + ̅BC ̅+ ̅BCD + ABC ̅
Similarly we can get solution for others. The following figure gives the solution
CARRY = AB
General representation of full-adder which adds i-th bit Ai and Bi of two numbers A and B and takes carry
from (i-1)th bit could be represented as below:
Ci = AiBi + BiCi-1 + AiCi-1
Ci = AiBi + (Ai + Bi)Ci-1
Si = Ai ⊕Bi ⊕Ci-1
Controlled Inverter
Fig. 3.42
As represented in Fig 3.42 When Invert = Low, output =
input Example: input = A7…..A0 = 0110 1110
output =Y7…..Y0= 0110 1110
Invert = High, output = 1’s Complement of the input
Example: input = A7…..A0 = 0110 1110
output =Y7…..Y0 = 1001 0001
Arithmetic Logic Unit
Arithmetic Logic Unit, called as ALU is multifunctional device that can perform both arithmetic and logic
function. ALU is an integral part of central processing unit or CPU of a computer. As a arithmetic unit it
performs addition, subtraction, increment, decrement operations etc. As logic unit it performs AND, OR,
NOT, EX-OR and many other complex logic functions. It has PRESET option, invoking which all function
outputs are made 1 and CLEAR option which makes all output as 0’s.
A mode selector input (M) decides whether ALU perform a logic operation or an arithmetic operation. In
each mode different functions are chosen by appropriately activating a set of selection inputs.
IC 74181 (Fig 3.43) is a 4-bit ALU that can generate 16 different kinds of outputs in each mode selected by
four selection inputs S3, S2, S1, S0. Note that carry is inhibited for M=1 mode. The functional diagram of
this IC with pin numbers and corresponding truth table is shown below,
3. Make S3, S2, S1, S0 = 1011 (It performs logical AND operation)
4. The output F3, F2, F1, F1= 0101
Example 2:
To perform ARITHMETIC ADDITION operation
1. Choose M=1 mode
2. Select Cin (active low pin) = 1
3. Select appropriate input A3, A2, A1, A0=0110 and B3, B2, B1, B0= 0100
4. Make S3, S2, S1, S0 = 1001 (It performs addition operation)
5. The output F3, F2, F1, F1= 1010
equivalent.
When the enable input B is 1, the output C equals A; when B is 0, the output C acts like an open circuit (Fig
3.45). In other words, when B is 0, the output C is effectively disconnected from the buffer output so that no
current can flow. This is often referred to as a Hi-Z (high-impedance) state of the output because the circuit
offers a very high resistance or impedance to the flow of current. Three-state buffers are also called tri-state
buffers. The following Fig 3.46 shows the truth tables for four types of three-state buffers.
output is inverted so that C = A’ when the buffer is enabled. The buffers in Figures (c) and (d) operate the
same as in (a) and (b) except that the enable input is inverted, so the buffer is enabled when B = 0. In the
following Figure, the outputs of two three-state buffers are tied together. When B = 0, the top buffer is
enabled, so that D = A; when B = 1, the lower buffer is enabled, so that D = C Fig 3.47. Therefore, = ′ + .
This is logically equivalent to using a 2-to-1 multiplexer to select the A input when B = 0 and the C input
when B = 1.
Fig. 3.49 4-to-1 MUX may be used to select one of the four sources
Integrated circuits are often designed using bi-directional pins for input and output. Bi-directional means
that the same pin can be used as an input pin and as an output pin, but not both at the same time as depicted
in Fig 3.50. To accomplish this, the circuit output is connected to the pin through a three-state buffer, as
shown in the following Figure. When the buffer is enabled, the pin is driven with the output signal. When
the buffer is disabled, an external source can drive the input pin.