Logic Gates
Logic Gates
Logic Gates
Overview:
All digital electronic circuits and microprocessor based systems contain hardware
elements called Digital Logic Gates that perform the logical operations of AND, OR and
NOT on binary numbers. In digital logic only two voltage levels or states are allowed and
these states are generally referred to as Logic "1" or Logic "0", High or Low, True or
False and which are represented in Boolean Algebra and Truth Tables by the numbers "1"
and "0" respectively. A good example of a digital logic level is a simple light as it is
"ON" or "OFF".
Logic operations can be performed using any non-linear device that has at least
two distinct regions of operation. Obvious choices for the electrical engineer are the
semiconductor diode and the bipolar junction transistor. Particular voltage levels are
assigned to logic levels 0 and 1.
While many voltage level assignments are possible, one common assignment is:
logic 1 (HIGH)---- ~ 5 V
logic 0 (LOW) ---- ~ 0 V.
This is known as "Positive logic" system. There is also a complementary "Negative
Logic" system in which the values and the rules of a logic "0" and a logic "1" are
reversed. But, unless stated otherwise, we shall only refer to the Positive Logic
convention for all the experiments. It is important to note that noise, power source
fluctuations, loading by other circuits, and other factors will cause the logic level voltages
to vary over some range.
Simple digital logic gates can be made by combining transistors, diodes and resistors as
discrete components. Let us investigate some of such circuits using Diode-Resistor Logic
(DRL), Diode-Transistor Logic (DTL) and Transistor-Transistor Logic (TTL) as
described below.
(i) Diode-Resistor Logic (DRL)
Diode logic gates use diodes to perform OR and AND logic functions as shown in the
circuit diagram. Connection of the LED at the output is optional which simply displays
the logical state of the output, i.e. the logic state of output is 0 or 1, if LED is off or on,
respectively. Diodes have the property of easily passing an electrical current in one
direction, but not the other. Thus, diodes can act as a logical switch. Diode logic gates are
very simple and inexpensive, and can be used effectively in limited space. However, they
cannot be used extensively due to the obvious logic level shift when gates are connected
in series. In addition, they cannot perform a NOT function, so their usefulness is quite
limited. This type of logic circuit is rarely found in integrated form.
Circuit Components/Equipments:
Circuit Diagram:
DRL OR gate
Truth Tables:
A B Q = A+B A B Q = A.B
0 0 0 0 0 0
0 1 1 0 1 0
1 0 1 1 0 0
1 1 1 1 1 1
Observations:
Input Output
A B Q = A+B
0 0
0 1
1 0
1 1
Input Output
A B Q = A.B
0 0
0 1
1 0
1 1
Discussions:
Precautions:
________________________________________________________________________
The simple 2-input Diode-Resistor gate can be converted into a NAND/NOR universal
gate by the addition of a single transistor inverting (NOT) stage employing DTL. Diode-
Transistor Logic, or DTL, refers to the technology for designing and fabricating digital
circuits wherein logic gates employ diodes in the input stage and bipolar junction
transistors at the output stage. The output BJT switches between its cut-off and saturation
regions to create logic 1 and 0, respectively. The logic level shift problem of DRL gates
is not present in DTL and TTL gates so that gates may be connected in series indefinitely.
If a gate drives several similar gates in parallel problems may occur: the maximum
number of gates that can be driven in parallel is identified as the "fanout" of a gate. DTL
offers better noise margins and greater fan-outs than RTL (Resistor- Transistor Logic),
but suffers from low speed, especially in comparison to TTL. Diodes take up far less
room than resistors, and can be constructed easily. In addition, the internal resistance of a
diode is small when the diode is forward biased, thus allowing for faster switching action.
As a result, gates built with diodes in place of most resistors can operate at higher
frequencies. Because of this diode-transistor logic (DTL) rapidly replaced RTL in most
digital applications.
The DTL inverter uses a transistor and a collector load resistor as shown in the circuit
diagram. The input is connected through a pair of diodes in series with the base of the
transistor. The diode connected directly to the transistor base serves to raise the input
voltage required to turn the transistor on to about 1.3 to 1.4 volts. Any input voltage
below this threshold will hold the transistor off. The base resistor is also connected which
should be sufficient to turn the transistor on and off quickly thus enabling higher
switching speeds.
Circuit Components/Equipments:
The DTL NAND gate combines the DTL inverter with a simple Diode-Resistor Logic
(DRL) AND gate as shown in its circuit diagram. Thus, any number of inputs can be
added simply by adding input diodes to the circuit. The problem of signal degradation
caused by Diode Logic is overcome by the transistor, which amplifies the signal while
inverting it. This means DTL gates can be cascaded to any required extent, without losing
the digital signal.
Circuit Components:
Circuit Diagram:
Similar to DTL NAND circuit one can construct the NOR gate by using a DRL OR gate
followed by a transistor inverter, as shown in circuit diagram (i). One can also construct a
DTL NOR more elegantly by combining multiple DTL inverters with a common output
as shown in the schematic diagram (ii). Any number of inverters may be combined in this
fashion to allow the required number of inputs to the NOR gate. (You should try both the
circuits!)
Circuit Components:
1. All the components from the DTL Inverter circuit, except power
supply and 4.7 K resistor
2. 1N914/1N4148 silicon diodes (1No.,in addition to the previous two)
Or
Circuit Diagram:
(i)
(ii)
Procedure:
Truth Tables:
A Q = A’ A B Q = (A+B)’ A B Q = (A.B)’
0 1 0 0 1 0 0 1
1 0 0 1 0 0 1 1
1 0 0 1 0 1
1 1 0 1 1 0
Observations:
Input Output
A Q = A’
0
1
Input Output
A B Q = (A+B)’
0 0
0 1
1 0
1 1
(III) DTL NAND gate:
Input Output
A B Q = (A.B)’
0 0
0 1
1 0
1 1
Discussions:
Precautions:
________________________________________________________________________
Transistor-transistor logic uses bipolar transistors in the input and output stages. TTL is
commonly found in relatively low speed applications. Thus before using commercial ICs
that uses TTL, let’s first understand the circuit in discrete form.
Looking at the DTL inverter circuit, one can note that the two diodes are opposed to each
other in direction. That is, their P-type anodes are connected together and to the pull-up
resistor, while one cathode is the signal input and the other is connected to the transistor's
base. Thus, one can replace these two diodes with a single NPN transistor as shown in the
circuit diagram. This makes lot of sense owing to the fact that the amount of space
required by a transistor in an IC is essentially the same as the space required by a diode
and by eliminating the space required by one diode at the same time.
Circuit Components/Equipments:
TTL integrated circuits provide multiple inputs to NAND gates by designing transistors
with multiple emitters on the chip. Unfortunately, we can't very well simulate that on a
breadboard socket. However, a NOR gate can be designed using an extra inverter
transistors just as in the case of DTL NOR gate.
Circuit Components/Equipments:
Circuit Diagram:
Procedure:
1. Assemble the circuit on your breadboard for TTL NOT/NOR operation. First,
start with the inverter circuit. Keep this circuit in tact to use it further in NOR
circuit.
2. Turn on power to your experimental circuit. Apply all four possible combinations
of inputs at A and B from the power supply using dip switch.
3. For each input combination, note the logic state of the output, Q, as indicated by
the LED (ON = 1; OFF = 0), and record that result in the table.
4. Compare your results with the truth table of a logic NOT/NOR operation.
5. When you have completed your observations, turn off the power supply.
Truth Tables:
Input Output
A Q = A’
0
1
Input Output
A B Q = (A+B)’
0 0
0 1
1 0
1 1
Discussions:
Precautions:
Boolean Logic Operations using Digital ICs
Objective: To study and verify various Boolean logic operations and the De Morgan’s
laws using digital ICs.
Overview:
Standard commercially available Digital Logic Gates are available in two basic forms,
TTL which stands for Transistor-Transistor Logic such as the 7400 series, and CMOS
which stands for Complementary Metal-Oxide-Silicon which is the 4000 series of
Integrated Circuits, (IC) or "chips" as it is commonly called. Generally speaking, TTL
IC's use NPN type Bipolar Junction Transistors while CMOS IC's use Field Effect
Transistors or FET's for both their input and output circuitry.
There are a large variety of logic gate types in both the Bipolar and CMOS families of
digital logic gates such as 74L, 74LS, 74ALS, 74HC, 74HCT, 74ACT etc, with each one
having its own distinct advantages and disadvantages and the exact voltages required to
produce a logic "0" or logic "1" depends upon the specific logic group or family.
However, when using a standard +5 volt supply any TTL voltage input between 2.0V and
5V is considered to be a logic "1" or "HIGH" while any voltage input below 0.8v is
recognized as a logic "0" or "LOW". TTL outputs are typically restricted to narrower
limits of between 0 V and 0.4 V for a "low" and between 2.7 V and 5 V. The voltage
region between the maximum voltage of logic “0” and minimum voltage of logic “1” of
either input or output is called the Indeterminate Region. CMOS logic uses a different
level of voltages with a logic "1" level operating between 3 and 15 volts.
1
There are several simple gates that you need to learn about. With these simple gates you
can build combinations that will implement any digital component you can imagine.
• The simplest possible gate is called an "inverter," or a NOT gate. It takes one bit as
input and produces output as its opposite. The logic table for NOT gate and its
symbol are shown below.
NOT Gate
A Q
0 1
1 0
• The AND gate performs a logical "and" operation on two inputs, A and B:
AND Gate
A B Q
0 0 0
0 1 0
1 0 0
1 1 1
OR Gate
A B Q
0 0 0
0 1 1
1 0 1
1 1 1
• It is quite common to recognize two others as well: the NAND and the NOR gate.
These two gates are simply combinations of an AND or an OR gate with a NOT gate.
NAND Gate
A B Q
0 0 1
0 1 1
1 0 1
1 1 0
2
NOR Gate
A B Q
0 0 1
0 1 0
1 0 0
1 1 0
• The final two gates that are sometimes added to the list are the XOR and XNOR
gates, also known as "exclusive or" and "exclusive nor" gates, respectively. Here are
their tables:
XOR Gate
A B Q
0 0 0
0 1 1
1 0 1
1 1 0
XNOR Gate
A B Q
0 0 1
0 1 0
1 0 0
1 1 1
Circuit Components/Equipments:
(i) Digital ICs, (ii) Resistors, (iii) DIP switch, (iv) D.C. Power supply (5V), (v)
LEDs, (vi) Breadboard, (vii) Connecting wires.
3
തതതതതതതതതത
De Morgan’s law: ( ഥ ∙
+ ) = ഥ
Procedure:
4
7. For verification of De Morgan’s laws, follow the respective circuit diagrams using
appropriate ICs. Follow the general circuit diagram for connections for input and
output using dip switch and LEDs.
8. Monitor the outputs Y and Z using LEDs and confirm that Y and Z are the same
for any states of A and B.
9. When you are done, turn off the power to your experimental circuit.
Gate # 1/2/../6
Gate # 1/2/../4
5
(IV) 2-input EX-OR gate: IC 7486LS
Gate # 1/2/../4
Gate # 1/2/../4
തതതതതതതതതത
( + ) = ഥ ∙
ഥ
6
തതതതതത
( ഥ +
∙ ) = ഥ
Discussions:
Precautions:
7
Multiplexor and Demultiplexor circuits
Objectives:
Overview:
Multiplexers:
A multiplexer (or MUX) is a circuit with many inputs but only one output and
acts like a very fast acting rotary switch. It selects one of many analog or digital input
signals (2, 4, 8, 16 and so on) and forwards the selected input into a single line output.
The selection of a particular input channel is controlled by a set of select inputs. A digital
multiplexer of 2n input channels can be controlled by n number of select lines.
A 4-to-1 line multiplexer, for example, consists of 4 input channels and 2
selection inputs. Its circuit diagram and truth table are shown below. The data input
channels D0 to D3 are selected by combinations of select inputs A and B. To understand
its operation, let us consider that the select input combination AB is 01. The AND gate
associated with D1 will have two inputs of logic 1 and the third input is D1. Thus the
output of this AND gate will follow D1. The other three AND gates have at least one of
their inputs at logic 0 to make their output 0, irrespective of the rest of the data inputs X
(0 or 1). Hence the OR output will follow D1 only.
Circuit Diagram:
D0
D1
D2
D3
1
Characteristic Table:
X = 0 or 1
Selection Input Channels Output
Inputs
A B D0 D1 D2 D3 Y
0 0 0 X X X 0
0 0 1 X X X 1
0 1 X 0 X X 0
0 1 X 1 X X 1
1 0 X X 0 X 0
1 0 X X 1 X 1
1 1 X X X 0 0
1 1 X X X 1 1
The multiplexer is a very useful combinational device that has uses in many different
applications such as signal routing, data communications and data bus control.
Demultiplexers:
Circuit Diagram:
2
Characteristic Table:
D = 0 or 1
Selection inputs Output Channels
A B Y0 Y1 Y2 Y3
0 0 D 0 0 0
0 1 0 D 0 0
1 0 0 0 D 0
1 1 0 0 0 D
Circuit components/Equipments:
3
Procedure:
1. Assemble the circuits one after another on your breadboard as per the circuit
diagrams.
2. Connect the ICs properly to power supply and ground following the pin
configurations for different ICs.
3. Using dip switch and resistors, facilitate all possible combinations of data and
select inputs from the power supply.
4. Turn on power to your experimental circuit.
5. For each select and data input combination, note the logic state of the outputs as
indicated by the LEDs (ON = 1; OFF = 0), and record the result in the table.
6. Compare your results with the truth table for operation.
7. When you are done, turn off the power to your experimental circuit.
Observations:
Discussions:
Precautions:
________________________________________________________________________