Professional Documents
Culture Documents
Me 2255 - Electronics and Microprocessors
Me 2255 - Electronics and Microprocessors
Me 2255 - Electronics and Microprocessors
com powers Engineers, Doctors, Managers & Lawyers in India by providing 'free'
resources for aspiring students of these courses as well as students in colleges.
You get FREE Lecture notes, Seminar presentations, guides, major and minor projects.
Also, discuss your career prospects and other queries with an ever-growing community.
ALL FILES ON STUDYNAMA.COM ARE UPLOADED BY RESPECTIVE USERS WHO MAY OR MAY NOT BE THE OWNERS OF THESE FILES. FOR ANY SUGGESTIONS OR FEEDBACK, EMAIL US AT INFO@STUDYNAMA.COM
EC1265 – ELECTRONICS AND MICROPROCESSORS
Bipolar junction transistor – CB, CE, CC configuration and characteristics – Biasing circuits –
Class A, B and C amplifiers – Field effect transistor –Configuration and characteristic of FET
amplifier –SCR, diac, triac, UJT – Characteristics and simple applications – Switching
transistors –Concept of feedback –Negative feedback – Application in temperature and motor
speed control.
Binary number system – AND, OR, NOT, NAND, NOR circuits – Boolean algebra –
Exclusive ORgate – Flip flops – Half and full adders – Registers – Counters –A/D and D/A
conversion.
Total: 45
TEXT BOOKS
REFERENCES
1. Malvino and Leach, ―Digital Principles and Applications‖, Tata McGraw-Hill, 1996.
2. Mehta, V.K., ―Principles of Electronics‖, S. Chand and Company Ltd, 1994.
3 Dougles V. Hall, ―Microprocessor and Interfacing, Programming and Hardware‖, Tata
McGraw-Hill, 1999.
UNIT I: SEMICONDUCTORS AND RECTIFIERS
Semiconductor diodes
A modern semiconductor diode is made of a crystal of semiconductor like silicon that has
impurities added to it to create a region on one side that contains negative charge
carriers (electrons), called n-type semiconductor, and a region on the other side that contains
positive charge carriers (holes), called p-type semiconductor. The diode's terminals are
attached to each of these regions. The boundary within the crystal between these two regions,
called a PN junction, is where the action of the diode takes place. The crystal
conducts conventional current in a direction from the p-type side (called the anode) to the n-
type side (called the cathode), but not in the opposite direction.
Another type of semiconductor diode, the Schottky diode, is formed from the contact between
a metal and a semiconductor rather than by a p-n junction.
Current–voltage characteristic
A semiconductor diode‘s behavior in a circuit is given by its current–voltage characteristic, or
I–V graph (see graph below). The shape of the curve is determined by the transport of charge
carriers through the so-called depletion layer or depletion region that exists at the p-n
junction between differing semiconductors. When a p-n junction is first created, conduction
band (mobile) electrons from the N-doped region diffuse into the P-doped region where there
is a large population of holes (vacant places for electrons) with which the electrons
―recombine‖. When a mobile electron recombines with a hole, both hole and electron vanish,
leaving behind an immobile positively charged donor (dopant) on the N-side and negatively
charged acceptor (dopant) on the P-side. The region around the p-n junction becomes depleted
of charge carriers and thus behaves as an insulator.
However, the width of the depletion region (called the depletion width) cannot grow without
limit. For each electron-hole pair that recombines, a positively charged dopant ion is left
behind in the N-doped region, and a negatively charged dopant ion is left behind in the P-
doped region. As recombination proceeds more ions are created, an increasing electric field
develops through the depletion zone which acts to slow and then finally stop recombination.
At this point, there is a ―built-in‖ potential across the depletion zone.
If an external voltage is placed across the diode with the same polarity as the built-in
potential, the depletion zone continues to act as an insulator, preventing any significant
electric current flow (unless electron/hole pairs are actively being created in the junction by,
for instance, light. see photodiode). This is the reverse bias phenomenon. However, if the
polarity of the external voltage opposes the built-in potential, recombination can once again
proceed, resulting in substantial electric current through the p-n junction (i.e. substantial
numbers of electrons and holes recombine at the junction). For silicon diodes, the built-in
potential is approximately 0.7 V (0.3 V for Germanium and 0.2 V for Schottky). Thus, if an
external current is passed through the diode, about 0.7 V will be developed across the diode
such that the P-doped region is positive with respect to the N-doped region and the diode is
said to be ―turned on‖ as it has a forward bias.
A diode‘s 'I–V characteristic' can be approximated by four regions of operation.
I–V characteristics of a P-N junction diode
At very large reverse bias, beyond the peak inverse voltage or PIV, a process called
reverse breakdown occurs which causes a large increase in current (i.e. a large number of
electrons and holes are created at, and move away from the pn junction) that usually damages
the device permanently. The avalanche diode is deliberately designed for use in the avalanche
region. In the zener diode, the concept of PIV is not applicable. A zener diode contains a
heavily doped p-n junction allowing electrons to tunnel from the valence band of the p-type
material to the conduction band of the n-type material, such that the reverse voltage is
―clamped‖ to a known value (called the zener voltage), and avalanche does not occur. Both
devices, however, do have a limit to the maximum current and power in the clamped reverse
voltage region. Also, following the end of forward conduction in any diode, there is reverse
current for a short time. The device does not attain its full blocking capability until the reverse
current ceases.
The second region, at reverse biases more positive than the PIV, has only a very small reverse
saturation current. In the reverse bias region for a normal P-N rectifier diode, the current
through the device is very low (in the µA range). However, this is temperature dependent, and
at sufficiently high temperatures, a substantial amount of reverse current can be observed (mA
or more).
The third region is forward but small bias, where only a small forward current is conducted.
As the potential difference is increased above an arbitrarily defined ―cut-in voltage‖ or ―on-
voltage‖ or ―diode forward voltage drop (Vd)‖, the diode current becomes appreciable (the
level of current considered ―appreciable‖ and the value of cut-in voltage depends on the
application), and the diode presents a very low resistance. The current–voltage curve
is exponential. In a normal silicon diode at rated currents, the arbitrary ―cut-in‖ voltage is
defined as 0.6 to 0.7 volts. The value is different for other diode types — Schottky diodes can
be rated as low as 0.2 V, Germanium diodes 0.25-0.3 V, and red or blue light-emitting
diodes (LEDs) can have values of 1.4 V and 4.0 V respectively.
At higher currents the forward voltage drop of the diode increases. A drop of 1 V to 1.5 V is
typical at full rated current for power diodes.
Shockley diode equation
The Shockley ideal diode equation or the diode law (named after transistor co-
inventor William Bradford Shockley, not to be confused with tetrode inventor Walter H.
Schottky) gives the I–V characteristic of an ideal diode in either forward or reverse bias (or no
bias). The equation is:
where
I is the diode current,
IS is the reverse bias saturation current (or scale current),
VD is the voltage across the diode,
VT is the thermal voltage, and
n is the ideality factor, also known as the quality factor or sometimes emission coefficient.
The ideality factor n varies from 1 to 2 depending on the fabrication process and
semiconductor material and in many cases is assumed to be approximately equal to 1 (thus the
notation n is omitted).
The thermal voltage VT is approximately 25.85 mV at 300 K, a temperature close to ―room
temperature‖ commonly used in device simulation software. At any temperature it is a known
constant defined by:
where k is the Boltzmann constant, T is the absolute temperature of the p-n junction, and q is
the magnitude of charge on an electron (the elementary charge).
The Shockley ideal diode equation or the diode law is derived with the assumption that the
only processes giving rise to the current in the diode are drift (due to electrical field),
diffusion, and thermal recombination-generation. It also assumes that the recombination-
generation (R-G) current in the depletion region is insignificant. This means that the Shockley
equation doesn‘t account for the processes involved in reverse breakdown and photon-assisted
R-G. Additionally, it doesn‘t describe the ―leveling off‖ of the I–V curve at high forward bias
due to internal resistance.
Under reverse bias voltages (see Figure 5) the exponential in the diode equation is negligible,
and the current is a constant (negative) reverse current value of −IS. The reverse breakdown
region is not modeled by the Shockley diode equation.
For even rather small forward bias voltages (see Figure 5) the exponential is very large
because the thermal voltage is very small, so the subtracted ‗1‘ in the diode equation is
negligible and the forward diode current is often approximated as
The use of the diode equation in circuit problems is illustrated in the article on diode
modeling.
Several types of junction diodes
There are several types of junction diodes, which either emphasize a different physical aspect
of a diode often by geometric scaling, doping level, choosing the right electrodes, are just an
application of a diode in a special circuit, or are really different devices like the Gunn and
laser diode and the MOSFET:
Normal (p-n) diodes, which operate as described above, are usually made of doped silicon or,
more rarely, germanium. Before the development of modern silicon power rectifier
diodes, cuprous oxide and later selenium was used; its low efficiency gave it a much higher
forward voltage drop (typically 1.4–1.7 V per ―cell‖, with multiple cells stacked to increase
the peak inverse voltage rating in high voltage rectifiers), and required a large heat sink (often
an extension of the diode‘s metal substrate), much larger than a silicon diode of the same
current ratings would require. The vast majority of all diodes are the p-n diodes found
inCMOS integrated circuits, which include two diodes per pin and many other internal diodes.
Avalanche diodes
Diodes that conduct in the reverse direction when the reverse bias voltage exceeds the
breakdown voltage. These are electrically very similar to Zener diodes, and are often
mistakenly called Zener diodes, but break down by a different mechanism, the avalanche
effect. This occurs when the reverse electric field across the p-n junction causes a wave of
ionization, reminiscent of an avalanche, leading to a large current. Avalanche diodes are
designed to break down at a well-defined reverse voltage without being destroyed. The
difference between the avalanche diode (which has a reverse breakdown above about 6.2 V)
and the Zener is that the channel length of the former exceeds the ―mean free path‖ of the
electrons, so there are collisions between them on the way out. The only practical difference is
that the two types have temperature coefficients of opposite polarities.
Constant current diodes
These are actually a JFET with the gate shorted to the source, and function like a two-
terminal current-limiter analog to the Zener diode, which is limiting voltage. They allow a
current through them to rise to a certain value, and then level off at a specific value. Also
called CLDs, constant-current diodes, diode-connected transistors, or current-regulating
diodes.
Esaki or tunnel diodes
These have a region of operation showing negative resistance caused by quantum tunneling,
thus allowing amplification of signals and very simple bistable circuits. These diodes are also
the type most resistant to nuclear radiation.
Gunn diodes
These are similar to tunnel diodes in that they are made of materials such as GaAs or InP that
exhibit a region of negative differential resistance. With appropriate biasing, dipole domains
form and travel across the diode, allowing high frequency microwave oscillators to be built.
Light-emitting diodes (LEDs)
In a diode formed from a direct band-gap semiconductor, such as gallium arsenide, carriers
that cross the junction emit photons when they recombine with the majority carrier on the
other side. Depending on the material, wavelengths (or colors)[11] from the infrared to the
near ultraviolet may be produced.[12] The forward potential of these diodes depends on the
wavelength of the emitted photons: 1.2 V corresponds to red, 2.4 V to violet. The first LEDs
were red and yellow, and higher-frequency diodes have been developed over time. All LEDs
produce incoherent, narrow-spectrum light; ―white‖ LEDs are actually combinations of three
LEDs of a different color, or a blue LED with a yellow scintillator coating. LEDs can also be
used as low-efficiency photodiodes in signal applications. An LED may be paired with a
photodiode or phototransistor in the same package, to form an opto-isolator.
Laser diodes
When an LED-like structure is contained in a resonant cavity formed by polishing the parallel
end faces, a laser can be formed. Laser diodes are commonly used in optical storage devices
and for high speed optical communication.
Thermal diodes
This term is used both for conventional PN diodes used to monitor temperature due to their
varying forward voltage with temperature, and for Peltier heat pumps for thermoelectric
heating and cooling.. Peltier heat pumps may be made from semiconductor, though they do
not have any rectifying junctions, they use the differing behaviour of charge carriers in N and
P type semiconductor to move heat.
Photodiodes
All semiconductors are subject to optical charge carrier generation. This is typically an
undesired effect, so most semiconductors are packaged in light blocking material. Photodiodes
are intended to sense light(photodetector), so they are packaged in materials that allow light to
pass, and are usually PIN (the kind of diode most sensitive to light).[13] A photodiode can be
used in solar cells, in photometry, or in optical communications. Multiple photodiodes may be
packaged in a single device, either as a linear array or as a two-dimensional array. These
arrays should not be confused with charge-coupled devices.
Point-contact diodes
These work the same as the junction semiconductor diodes described above, but their
construction is simpler. A block of n-type semiconductor is built, and a conducting sharp-
point contact made with some group-3 metal is placed in contact with the semiconductor.
Some metal migrates into the semiconductor to make a small region of p-type semiconductor
near the contact. The long-popular 1N34 germanium version is still used in radio receivers as
a detector and occasionally in specialized analog electronics.
PIN diodes
A PIN diode has a central un-doped, or intrinsic, layer, forming a p-type/intrinsic/n-type
structure.[14] They are used as radio frequency switches and attenuators. They are also used as
large volume ionizing radiation detectors and as photodetectors. PIN diodes are also used
in power electronics, as their central layer can withstand high voltages. Furthermore, the PIN
structure can be found in many power semiconductor devices, such as IGBTs,
power MOSFETs, and thyristors.
Schottky diodes
Schottky diodes are constructed from a metal to semiconductor contact. They have a lower
forward voltage drop than p-n junction diodes. Their forward voltage drop at forward currents
of about 1 mA is in the range 0.15 V to 0.45 V, which makes them useful in voltage clamping
applications and prevention of transistor saturation. They can also be used as low
loss rectifiers although their reverse leakage current is generally higher than that of other
diodes. Schottky diodes are majority carrier devices and so do not suffer from minority carrier
storage problems that slow down many other diodes — so they have a faster ―reverse
recovery‖ than p-n junction diodes. They also tend to have much lower junction capacitance
than p-n diodes which provides for high switching speeds and their use in high-speed circuitry
and RF devices such as switched-mode power
varactor diodes
Varactors are operated reverse-biased so no current flows, but since the thickness of
the depletion zone varies with the applied bias voltage, the capacitance of the diode can be
made to vary. Generally, the depletion region thickness is proportional to the square root of
the applied voltage; andcapacitance is inversely proportional to the depletion region thickness.
Thus, the capacitance is inversely proportional to the square root of applied voltage.
All diodes exhibit this phenomenon to some degree, but specially made varactor diodes
exploit the effect to boost the capacitance and variability range achieved - most diode
fabrication attempts to achieve the opposite.
In the figure we can see an example of a crossection of a varactor with the depletion layer
formed of a p-n-junction. But the depletion layer can also be made of a MOS-diode or
a Schottky diode. This is very important in CMOS and MMIC technology.
Zener diodes
Diodes that can be made to conduct backwards. This effect, called Zener breakdown, occurs at
a precisely defined voltage, allowing the diode to be used as a precision voltage reference. In
practical voltage reference circuits Zener and switching diodes are connected in series and
opposite directions to balance the temperature coefficient to near zero. Some devices labeled
as high-voltage Zener diodes are actually avalanche diodes (see above). Two (equivalent)
Zeners in series and in reverse order, in the same package, constitute a transient absorber
(or Transorb, a registered trademark). The Zener diode is named for Dr. Clarence Melvin
Zener of Carnegie Mellon University, inventor of the device.
Other uses for semiconductor diodes include sensing temperature, and computing
analog logarithms (see Operational amplifier applications#Logarithmic).
Zener diode is a type of diode that permits current not only in the forward direction like a
normal diode, but also in the reverse direction if the voltage is larger than the breakdown
voltage known as "Zener knee voltage" or "Zener voltage". The device was named
after Clarence Zener, who discovered this electrical property.
A conventional solid-state diode will not allow significant current if it is reverse below its
reverse breakdown voltage. When the reverse bias breakdown voltage is exceeded, a
conventional diode is subject to high current due to avalanche breakdown. Unless this current
is limited by circuitry, the diode will be permanently damaged. In case of large forward bias
(current in the direction of the arrow), the diode exhibits a voltage drop due to its junction
built-in voltage and internal resistance. The amount of the voltage drop depends on the
semiconductor material and the doping concentrations.
A Zener diode exhibits almost the same properties, except the device is specially designed so
as to have a greatly reduced breakdown voltage, the so-called Zener voltage. By contrast with
the conventional device, a reverse-biased Zener diode will exhibit a controlled breakdown and
allow the current to keep the voltage across the Zener diode at the Zener voltage. For example,
a diode with a Zener breakdown voltage of 3.2 V will exhibit a voltage drop of 3.2 V even if
reverse bias voltage applied across it is more than its Zener voltage. The Zener diode is
therefore ideal for applications such as the generation of a reference voltage (e.g. for
an amplifier stage), or as a voltage stabilizer for low-current applications.
The Zener diode's operation depends on the heavy doping of its p-n
junction allowing electrons to tunnel from the valence band of the p-type material to the
conduction band of the n-type material. In the atomic scale, this tunneling corresponds to the
transport of valence band electrons into the empty conduction band states; as a result of the
reduced barrier between these bands and high electric fields that are induced due to the
relatively high levels of dopings on both sides.[1] The breakdown voltage can be controlled
quite accurately in the doping process. While tolerances within 0.05% are available, the most
widely used tolerances are 5% and 10%. Breakdown voltage for commonly available zener
diodes can vary widely from 1.2 volts to 200 volts.
Another mechanism that produces a similar effect is the avalanche effect as in the avalanche
diode. The two types of diode are in fact constructed the same way and both effects are
present in diodes of this type. In silicon diodes up to about 5.6 volts, the Zener effect is the
predominant effect and shows a marked negative temperature coefficient. Above 5.6 volts,
the avalanche effect becomes predominant and exhibits a positive temperature coefficient[1].
In a 5.6 V diode, the two effects occur together and their temperature coefficients neatly
cancel each other out, thus the 5.6 V diode is the component of choice in temperature-critical
applications. Modern manufacturing techniques have produced devices with voltages lower
than 5.6 V with negligible temperature coefficients, but as higher voltage devices are
encountered, the temperature coefficient rises dramatically. A 75 V diode has 10 times the
coefficient of a 12 V diode.
All such diodes, regardless of breakdown voltage, are usually marketed under the umbrella
term of "Zener diode".
1. R must be small enough that the current through D keeps D in reverse breakdown. The
value of this current is given in the data sheet for D. For example, the common
BZX79C5V6[2] device, a 5.6 V 0.5 W Zener diode, has a recommended reverse
current of 5 mA. If insufficient current exists through D, then UOUT will be
unregulated, and less than the nominal breakdown voltage (this differs to voltage
regulator tubes where the output voltage will be higher than nominal and could rise as
high as UIN). When calculating R, allowance must be made for any current through the
external load, not shown in this diagram, connected across UOUT.
2. R must be large enough that the current through D does not destroy the device. If the
current through D is ID, its breakdown voltage VB and its maximum power
dissipation PMAX, then IDVB < PMAX.
A load may be placed across the diode in this reference circuit, and as long as the zener stays
in reverse breakdown, the diode will provide a stable voltage source to the load.
Shunt regulators are simple, but the requirements that the ballast resistor be small enough to
avoid excessive voltage drop during worst-case operation (low input voltage concurrent with
high load current) tends to leave a lot of current flowing in the diode much of the time,
making for a fairly wasteful regulator with high quiescent power dissipation, only suitable for
smaller loads.
Zener diodes in this configuration are often used as stable references for more advanced
voltage regulator circuits.
These devices are also encountered, typically in series with a base-emitter junction, in
transistor stages where selective choice of a device centered around the avalanche/Zener point
can be used to introduce compensating temperature co-efficient balancing of the transistor PN
junction. An example of this kind of use would be a DC error amplifier used in a regulated
power supply circuit feedback loop system.
Zener diodes are also used in surge protectors to limit transient voltage spikes.
Another notable application of the zener diode is the use of noise caused by its avalanche
breakdown in a random number generator that never repeats.
UNIT II: TRANSISTORS AND AMPLIFIERS
Bipolar junction transistor – CB, CE, CC configuration and characteristics – Biasing circuits –
Class A, B and C amplifiers – Field effect transistor –Configuration and characteristic of FET
amplifier –SCR, diac, triac, UJT – Characteristics and simple applications – Switching
transistors –Concept of feedback –Negative feedback – Application in temperature and motor
speed control.
In the Diode tutorials we saw that simple diodes are made up from two pieces of
semiconductor material, either Silicon or Germanium to form a simple PN-junction and we
also learnt about their properties and characteristics. If we now join together two individual
diodes end to end giving two PN-junctions connected together in series, we now have a three
layer, two junction, three terminal device forming the basis of a Bipolar Junction
Transistor, or BJT for short. This type of transistor is generally known as a Bipolar
Transistor, because its basic construction consists of two PN-junctions with each terminal or
connection being given a name to identify it and these are known as the Emitter, Base and
Collector respectively.
The word Transistor is an acronym, and is a combination of the words Transfer Varistor used
to describe their mode of operation way back in their early days of development. There are
two basic types of bipolar transistor construction, NPN and PNP, which basically describes
the physical arrangement of the P-type and N-type semiconductor materials from which they
are made. Bipolar Transistors are "CURRENT" Amplifying or current regulating devices that
control the amount of current flowing through them in proportion to the amount of biasing
current applied to their base terminal. The principle of operation of the two transistor types
NPN and PNP, is exactly the same the only difference being in the biasing (base current) and
the polarity of the power supply for each type.
There are basically three possible ways to connect a Bipolar Transistor within an electronic
circuit with each method of connection responding differently to its input signal as the static
characteristics of the transistor vary with each circuit arrangement.
As its name suggests, in the Common Base or Grounded Base configuration, the BASE
connection is common to both the input signal AND the output signal with the input signal
being applied between the base and the emitter terminals. The corresponding output signal is
taken from between the base and the collector terminals as shown with the base terminal
grounded or connected to a fixed reference voltage point. The input current flowing into the
emitter is quite large as its the sum of both the base current and collector current respectively
therefore, the collector current output is less than the emitter current input resulting in a
Current Gain for this type of circuit of less than "1", or in other words it "Attenuates" the
signal.
The Common Base Amplifier Circuit
This type of amplifier configuration is a non-inverting voltage amplifier circuit, in that the
signal voltages Vin and Vout are In-Phase. This type of arrangement is not very common due
to its unusually high voltage gain characteristics. Its Output characteristics represent that of a
forward biased diode while the Input characteristics represent that of an illuminated photo-
diode. Also this type of configuration has a high ratio of Output to Input resistance or more
importantly "Load" resistance (RL) to "Input" resistance (Rin) giving it a value of "Resistance
Gain". Then the Voltage Gain for a common base can therefore be given as:
The Common Base circuit is generally only used in single stage amplifier circuits such as
microphone pre-amplifier or RF radio amplifiers due to its very good high frequency
response.
In the Common Emitter or Grounded Emitter configuration, the input signal is applied
between the base, while the output is taken from between the collector and the emitter as
shown. This type of configuration is the most commonly used circuit for transistor based
amplifiers and which represents the "normal" method of connection. The common emitter
amplifier configuration produces the highest current and power gain of all the three bipolar
transistor configurations. This is mainly because the input impedance is LOW as it is
connected to a forward-biased junction, while the output impedance is HIGH as it is taken
from a reverse-biased junction.
The Common Emitter Amplifier Circuit
In this type of configuration, the current flowing out of the transistor must be equal to the
currents flowing into the transistor as the emitter current is given as Ie = Ic + Ib. Also, as the
load resistance (RL) is connected in series with the collector, the Current gain of the Common
Emitter Transistor Amplifier is quite large as it is the ratio of Ic/Ib and is given the symbol of
Beta, (β). Since the relationship between these three currents is determined by the transistor
itself, any small change in the base current will result in a large change in the collector
current. Then, small changes in base current will thus control the current in the
Emitter/Collector circuit.
By combining the expressions for both Alpha, α and Beta, β the mathematical relationship
between these parameters and therefore the current gain of the amplifier can be given as:
Where: "Ic" is the current flowing into the collector terminal, "Ib" is the current flowing into
the base terminal and "Ie" is the current flowing out of the emitter terminal.
Then to summarise, this type of bipolar transistor configuration has a greater input impedance,
Current and Power gain than that of the common Base configuration but its Voltage gain is
much lower. The common emitter is an inverting amplifier circuit resulting in the output
signal being 180o out of phase with the input voltage signal.
In the Common Collector or Grounded Collector configuration, the collector is now common
and the input signal is connected to the Base, while the output is taken from the Emitter load
as shown. This type of configuration is commonly known as a Voltage Follower or Emitter
Follower circuit. The Emitter follower configuration is very useful for impedance matching
applications because of the very high input impedance, in the region of hundreds of thousands
of Ohms, and it has relatively low output impedance.
The Common Collector Amplifier Circuit
The Common Emitter configuration has a current gain equal to the β value of the transistor
itself. In the common collector configuration the load resistance is situated in series with the
emitter so its current is equal to that of the emitter current. As the emitter current is the
combination of the collector AND base currents combined, the load resistance in this type of
amplifier configuration also has both the collector current and the input current of the base
flowing through it. Then the current gain of the circuit is given as:
This type of bipolar transistor configuration is a non-inverting amplifier circuit in that the
signal voltages of Vin and Vout are "In-Phase". It has a voltage gain that is always less than
"1" (unity). The load resistance of the common collector amplifier configuration receives both
the base and collector currents giving a large current gain (as with the Common Emitter
configuration) therefore, providing good current amplification with very little voltage gain.
The behaviour of the bipolar transistor in each one of the above circuit configurations is very
different and produces different circuit characteristics with regards to Input impedance,
Output impedance and Gain and this is summarised in the table below.
Transistor Characteristics
The static characteristics for Bipolar Transistor amplifiers can be divided into the following
main groups.
Input Characteristics:- Common Base - IE ÷ VEB
Common Emitter - IB ÷ VBE
with the characteristics of the different transistor configurations given in the following table:
Transistor as a switch
Transistors are commonly used as electronic switches, for both high power applications
including switched-mode power supplies and low power applications such as logic gates.
In a grounded-emitter transistor circuit, such as the light-switch circuit shown, as the base
voltage rises the base and collector current rise exponentially, and the collector voltage drops
because of the collector load resistor. The relevant equations:
VRC = ICE × RC, the voltage across the load (the lamp with resistance RC)
VRC + VCE = VCC, the supply voltage shown as 6V
If VCE could fall to 0 (perfect closed switch) then Ic could go no higher than VCC / RC, even
with higher base voltage and current. The transistor is then said to be saturated. Hence, values
of input voltage can be chosen such that the output is either completely off,[13] or completely
on. The transistor is acting as a switch, and this type of operation is common in digital circuits
where only "on" and "off" values are relevant.
Transistor as an amplifier
The common-emitter amplifier is designed so that a small change in voltage in (Vin) changes
the small current through the base of the transistor and the transistor's current amplification
combined with the properties of the circuit mean that small swings in Vin produce large
changes in Vout.
Various configurations of single transistor amplifier are possible, with some providing current
gain, some voltage gain, and some both.
From mobile phones to televisions, vast numbers of products include amplifiers for sound
reproduction, radio transmission, and signal processing. The first discrete transistor audio
amplifiers barely supplied a few hundred milliwatts, but power and audio fidelity gradually
increased as better transistors became available and amplifier architecture evolved.
Modern transistor audio amplifiers of up to a few hundred watts are common and relatively
inexpensive
Voltage divider bias
The voltage divider is formed using external resistors R1 and R2. The voltage across R2
forward biases the emitter junction. By proper selection of resistors R1 and R2, the operating
point of the transistor can be made independent of β. In this circuit, the voltage divider holds
the base voltage fixed independent of base current provided the divider current is large
compared to the base current. However, even with a fixed base voltage, collector current
varies with temperature (for example) so an emitter resistor is added to stabilize the Q-point,
similar to the above circuits with emitter resistor.
voltage across
provided .
Also
Merits:
As β-value is fixed for a given transistor, this relation can be satisfied either by
keeping RE fairly large, or making R1||R2 very low.
AC as well as DC feedback is caused by RE, which reduces the AC voltage gain of the
amplifier. A method to avoid AC feedback while retaining DC feedback is discussed
below.
Base Bias
The simplest biasing applies a base-bias resistor between the base and a base battery VBB. It is
convenient to use the existing VCC supply instead of a new bias supply. An example of an
audio amplifier stage using base-biasing is ―Crystal radio with one transistor . . . ‖ crystal
radio, Ch 9 . Note the resistor from the base to the battery terminal. A similar circuit is shown
in Figure below.
Write a KVL (Krichhoff's voltage law) equation about the loop containing the battery, R B, and
the VBE diode drop on the transistor in Figure below. Note that we use VBB for the base
supply, even though it is actually VCC. If β is large we can make the approximation that IC =IE.
For silicon transistors VBE≅0.7V.
Base-bias
Silicon small signal transistors typically have a β in the range of 100-300. Assuming that we
have a β=100 transistor, what value of base-bias resistor is required to yield an emitter current
of 1mA?
Solving the IE base-bias equation for RB and substituting β, VBB, VBE, and IE yields 930kΩ.
The closest standard value is 910kΩ.
What is the the emitter current with a 910kΩ resistor? What is the emitter current if we
randomly get a β=300 transistor?
The emitter current is little changed in using the standard value 910kΩ resistor. However,
with a change in β from 100 to 300, the emitter current has tripled. This is not acceptable in a
power amplifier if we expect the collector voltage to swing from near VCC to near ground.
However, for low level signals from micro-volts to a about a volt, the bias point can be
centered for a β of square root of (100·300)=173. The bias point will still drift by a
considerable amount . However, low level signals will not be clipped.
Base-bias by its self is not suitable for high emitter currents, as used in power amplifiers. The
base-biased emitter current is not temperature stable. Thermal run away is the result of high
emitter current causing a temperature increase which causes an increase in emitter current,
which further increases temperature.
Collector-feedback bias
Variations in bias due to temperature and beta may be reduced by moving the V BB end of the
base-bias resistor to the collector as in Figure below. If the emitter current were to increase,
the voltage drop across RC increases, decreasing VC, decreasing IB fed back to the base. This,
in turn, decreases the emitter current, correcting the original increase.
Write a KVL equation about the loop containing the battery, RC , RB , and the VBE drop.
Substitute IC≅IE and IB≅IE/β. Solving for IE yields the IE CFB-bias equation. Solving for IB
yields the IB CFB-bias equation.
Collector-feedback bias.
Find the required collector feedback bias resistor for an emitter current of 1 mA, a 4.7K
collector load resistor, and a transistor with β=100 . Find the collector voltage VC. It should be
approximately midway between VCC and ground.
The closest standard value to the 460k collector feedback bias resistor is 470k. Find the
emitter current IE with the 470 K resistor. Recalculate the emitter current for a transistor with
β=100 and β=300.
We see that as beta changes from 100 to 300, the emitter current increases from 0.989mA to
1.48mA. This is an improvement over the previous base-bias circuit which had an increase
from 1.02mA to 3.07mA. Collector feedback bias is twice as stable as base-bias with respect
to beta variation.
Emitter-bias
Inserting a resistor RE in the emitter circuit as in Figure below causes degeneration, also
known as negative feedback. This opposes a change in emitter current IE due to temperature
changes, resistor tolerances, beta variation, or power supply tolerance. Typical tolerances are
as follows: resistor— 5%, beta— 100-300, power supply— 5%. Why might the emitter
resistor stabilize a change in current? The polarity of the voltage drop across RE is due to the
collector battery VCC. The end of the resistor closest to the (-) battery terminal is (-), the end
closest to the (+) terminal it (+). Note that the (-) end of RE is connected via VBB battery and
RB to the base. Any increase in current flow through RE will increase the magnitude of
negative voltage applied to the base circuit, decreasing the base current, decreasing the emitter
current. This decreasing emitter current partially compensates the original increase.
Emitter-bias
Note that base-bias battery VBB is used instead of VCC to bias the base in Figure above. Later
we will show that the emitter-bias is more effective with a lower base bias battery.
Meanwhile, we write the KVL equation for the loop through the base-emitter circuit, paying
attention to the polarities on the components. We substitute IB≅IE/β and solve for emitter
current IE. This equation can be solved for RB , equation: RB emitter-bias, Figure above.
Before applying the equations: RB emitter-bias and IE emitter-bias, Figure above, we need to
choose values for RC and RE . RC is related to the collector supply VCC and the desired
collector current IC which we assume is approximately the emitter current IE. Normally the
bias point for VC is set to half of VCC. Though, it could be set higher to compensate for the
voltage drop across the emitter resistor RE. The collector current is whatever we require or
choose. It could range from micro-Amps to Amps depending on the application and transistor
rating. We choose IC = 1mA, typical of a small-signal transistor circuit. We calculate a value
for RC and choose a close standard value. An emitter resistor which is 10-50% of the collector
load resistor usually works well.
Figure 1 (top right) shows a bipolar amplifier with feedback bias resistor Rf driven by a
Norton signal source. Figure 2 (left panel) shows the corresponding small-signal circuit
obtained by replacing the transistor with its hybrid-pi model. The objective is to find the
return ratio of the dependent current source in this amplifier.[9] To reach the objective, the
steps outlined above are followed. Figure 2 (center panel) shows the application of these steps
up to Step 4, with the dependent source moved to the left of the inserted source of value it, and
the leads targeted for cutting marked with an x. Figure 2 (right panel) shows the circuit set up
for calculation of the return ratio T, which is
Consequently,
This expression can be rewritten in the form used by the asymptotic gain model, which
expresses the overall gain of a feedback amplifier in terms of several independent factors that
are often more easily derived separately than the overall gain itself, and that often provide
insight into the circuit. This form is:
where the so-called asymptotic gain G∞ is the gain at infinite gm, namely:
and the so-called feed forward or direct feedthrough G0 is the gain for zero gm, namely:
1. DC Biasing Circuits
2. The ac operation of an amplifier depends on the initial dc values of IB, IC, and VCE.
3. By varying IB around an initial dc value, IC and VCE are made to vary around their
initial dc values.
4. DC biasing is a static operation since it deals with setting a fixed (steady) level of
current (through the device) with a desired fixed voltage drop across the device.
+VCC
RC
RB
v out
v in vce
ib
ic
Voltage-Divider Bias
• The voltage – divider (or potentiometer) bias circuit is by far the most commonly used.
• RB1, RB2
voltage-divider to set the value of VB , IB +VCC
• C3
to short circuit ac signals to ground, while not effect the DC operating (or biasing)
of a circuit
RC
R1
(RE stabilizes the ac signals)
Bypass Capacitor
+VCC
IC RC
R1
R2
IE
RE
VCC ICRC VCE IERE 0
for I C IE
1 VCC
IC VCE
RC RE RC RE
Point - slope form of straight line equation :
y mx IC(sat)
c = VCC/(RC+RE)
DC Load Line
IC
(mA)
VCE(off) = VCC
• The straight line is know as the DC load line
• Its significance is that regardless of the behavior of the transistor, the collector current
IC and the collector-emitter voltage VCE must always lie on the load line, depends
ONLY on the VCC, RC and RE
• (i.e. The dc load line is a graph that represents all the possible combinations of IC
and VCE for a given amplifier. For every possible value of IC, and amplifier will
have a corresponding value of VCE.)
• It must be true at the same time as the transistor characteristic. Solve two condition
using simultaneous equation
graphically Q-point !!
DC Biasing + AC signal
• When an ac signal is applied to the base of the transistor, IC and VCE will both vary
around their Q-point values.
• When the Q-point is centered, IC and VCE can both make the maximum possible
transitions above and below their initial dc values.
• When the Q-point is above the center on the load line, the input signal may cause the
transistor to saturate. When this happens, a part of the output signal will be clipped
off.
• When the Q-point is below midpoint on the load line, the input signal may cause the
transistor to cutoff. This can also cause a portion of the output signal to be clipped.
+VCC
+VCC
RC
R1 IC RC
R1
R
rC
vin vce
R1//R2
• The ac load line of a given amplifier will not follow the plot of the dc load line.
• This is due to the dc load of an amplifier is different from the ac load.
ac load line
IC Q - point
dc load line
VCE
Since the transistor is a three-terminal device, any one of the three terminals may be used as a
common terminal to both input and output. In most transistor circuits the emitter is used as the
common terminal, and this common emitter, or grounded emitter, is indicated in illus. a. If the
transistor is to used as a linear device, such as an audio amplifier, it must be biased to operate
in the active region. In this region the collector is biased in the reverse direction and the
emitter in the forward direction. The area in the common-emitter transistor characteristics to
the right of the ordinate VCE = 0 and above IC = 0 is the active region. Two more biasing
regions are of special interest for those cases in which the transistor is intended to operate as a
switch. These are the saturation and cutoffregions. The saturation region may be defined as
the region where the collector current is independent of base current for given values
of VCC and RL. Thus, the onset of saturation can be considered to take place at the knee of the
common-emitter transistor curves. See also Amplifier; Transistor.
In a fixed-bias circuit, the operating point for the circuit of illus. a can be established by
noting that the required current IB is constant, independent of the quiescent collector
current IC, which is why this circuit is called the fixed-bias circuit. Transistor biasing circuits
are frequently compared in terms of the value of the stability factor S = ∂IC/∂ICO, which is the
rate of change of collector current with respect to reverse saturation current. The smaller the
value of S, the less likely the circuit will exhibit thermal runaway. S, as defined here, cannot
be smaller than unity. Other stability factors are defined in terms of dc current gain hFE as
∂IC/∂hFE, and in terms of base-to-emitter voltage as ∂IC/∂VBE. However, bias circuits with
small values of S will also perform satisfactorily for transistors that have large variations
of hFE and VBE. For the fixed-bias circuit it can be shown that S = hFE + 1, and if hFE = 50,
thenS = 51. Such a large value of S makes thermal runaway a definite possibility with this
circuit.
1.
This value is smaller than hFE + 1, which is the value obtained for the fixed-bias case.
If the load resistance RL is very small, as in a transformer-coupled circuit, then the previous
expression for S shows that there would be no improvement in the stabilization in the
collector-to-base bias circuit over the fixed-bias circuit. A circuit that can be used even if there
is zero dc resistance in series with the collector terminal is the self-biasing configuration of
illus. c. The current in the resistance RE in the emitter lead causes a voltage drop which is in
the direction to reverse-bias the emitter junction. Since this junction must be forward-biased
(for active region bias), the bleeder R1-R2 has been added to the circuit.
2.
better the stabilization. Even if RB approaches zero, the value of S cannot be reduced below
unity.
In order to avoid the loss of signal gain because of the degeneration caused by RE, this resistor
is often bypassed by a very large capacitance, so that its reactance at the frequencies under
consideration is very small.
The selection of an appropriate operating point (ID, VGS, VDS) for a field-effect transistor (FET)
amplifier stage is determined by considerations similar to those given to transistors, as
discussed previously. These considerations are output-voltage swing, distortion, power
dissipation, voltage gain, and drift of drain current. In most cases it is not possible to satisfy
all desired specifications simultaneously.
PART-B
UNIT III: DIGITAL ELECTRONICS
Binary number system – AND, OR, NOT, NAND, NOR circuits – Boolean algebra –
Exclusive OR gate – Flip flops – Half and full adders – Registers – Counters –A/D and D/A
conversion.
1.1 Introduction:
The English mathematician George Boole (1815-1864) sought to give symbolic form
to Aristotle‘s system of logic. Boole wrote a treatise on the subject in 1854, titled An
Investigation of the Laws of Thought, on Which Are Founded the Mathematical Theories of
Logic and Probabilities, which codified several rules of relationship between mathematical
quantities limited to one of two possible values: true or false, 1 or 0. His mathematical system
became known as Boolean algebra.
All arithmetic operations performed with Boolean quantities have but one of two possible
Outcomes: either 1 or 0. There is no such thing as ‖2‖ or ‖-1‖ or ‖1/2‖ in the Boolean world.
It is a world in which all other possibilities are invalid by fiat. As one might guess, this is not
the kind of math you want to use when balancing a checkbook or calculating current through a
resistor.
However, Claude Shannon of MIT fame recognized how Boolean algebra could be applied to
on-and-off circuits, where all signals are characterized as either ‖high‖ (1) or ‖low‖ (0).
His1938 thesis, titled A Symbolic Analysis of Relay and Switching Circuits, put Boole‘s
theoretical work to use in a way Boole never could have imagined, giving us a powerful
mathematical tool for designing and analyzing digital circuits.
Like ‖normal‖ algebra, Boolean algebra uses alphabetical letters to denote variables.
Unlike ‖normal‖ algebra, though, Boolean variables are always CAPITAL letters, never
lowercase.
Because they are allowed to possess only one of two possible values, either 1 or 0, each and
every variable has a complement: the opposite of its value. For example, if variable ‖A‖ has a
value of 0, then the complement of A has a value of 1. Boolean notation uses a bar above the
variable character to denote complementation, like this:
In written form, the complement of ‖A‖ denoted as ‖A-not‖ or ‖A-bar‖. Sometimes a ‖prime‖
symbol is used to represent complementation. For example, A‘ would be the complement of
A, much the same as using a prime symbol to denote differentiation in calculus rather than the
fractional notation dot. Usually, though, the ‖bar‖ symbol finds more widespread use than the
‖prime‖ symbol, for reasons that will become more apparent later in this chapter.
Boolean complementation finds equivalency in the form of the NOT gate, or a normally
closed switch or relay contact:
In mathematics, an identity is a statement true for all possible values of its variable or
variables. The algebraic identity of x + 0 = x tells us that anything (x) added to zero equals the
original ‖anything,‖ no matter what value that ‖anything‖ (x) may be. Like ordinary algebra,
Boolean algebra has its own unique identities based on the bivalent states of Boolean
variables.
The first Boolean identity is that the sum of anything and zero is the same as the original
‖anything.‖ This identity is no different from its real-number algebraic equivalent:
No matter what the value of A, the output will always be the same: when A=1, the output
will also be 1; when A=0, the output will also be 0.
The next identity is most definitely different from any seen in normal algebra. Here we
discover that the sum of anything and one is one:
No matter what the value of A, the sum of A and 1 will always be 1. In a sense, the ‖1‖
signal overrides the effect of A on the logic circuit, leaving the output fixed at a logic level of
1.
Next, we examine the effect of adding A and A together, which is the same as connecting
both inputs of an OR gate to each other and activating them with the same signal:
In real-number algebra, the sum of two identical variables is twice the original variable‘s
value (x + x = 2x), but remember that there is no concept of ‖2‖ in the world of Boolean math,
only 1 and 0, so we cannot say that A + A = 2A. Thus, when we add a Boolean quantity to
itself, the sum is equal to the original quantity: 0 + 0 = 0, and 1 + 1 = 1.
Introducing the uniquely Boolean concept of complementation into an additive identity, we
find an interesting effect. Since there must be one ‖1‖ value between any variable and its
complement, and since the sum of any Boolean quantity and 1 is 1, the sum of a variable and
its complement must be 1:
Four multiplicative identities: Ax0, Ax1, AxA, and AxA‘. Of these, the first two are no
different from their equivalent expressions in regular algebra:
The third multiplicative identity expresses the result of a Boolean quantity multiplied by
itself. In normal algebra, the product of a variable and itself is the square of that variable (3x 3
= 32 = 9). However, the concept of ‖square‖ implies a quantity of 2, which has no meaning in
Boolean algebra, so we cannot say that A x A = A2. Instead, we find that the product of a
Boolean quantity and itself is the original quantity, since 0 x 0 = 0 and
1 x 1 = 1:
The fourth multiplicative identity has no equivalent in regular algebra because it uses the
complement of a variable, a concept unique to Boolean mathematics. Since there must be
one ‖0‖ value between any variable and its complement, and since the product of any Boolean
quantity and 0 is 0, the product of a variable and its complement must be 0:
It states that every algebraic expression is deducible from the postulates of Boolean
algebra, and it remains valid if the operators & identity elements are interchanged. If the
inputs of a NOR gate are inverted we get a AND equivalent circuit. Similarly when the inputs
of a NAND gate are inverted, we get a OR equivalent circuit.
This property is called DUALITY.
The theorems of Boolean algebra can be used to simplify many a complex Boolean
expression and also to transform the given expression into a more useful and meaningful
equivalent expression. The theorems are presented as pairs, with the two theorems in a given
pair being the dual of each other. These theorems can be very easily verified by the method of
‗perfect induction‘. According to this method, the validity of the expression is tested for all
possible combinations of values of the variables involved. Also, since the validity of the
theorem is based on its being true for all possible combinations of values of variables, there is
no reason why a variable cannot be replaced with its complement, or vice versa, without
disturbing the validity. Another important point is that, if a given expression is valid, its dual
will also be valid
1.5.1 Theorem 1 (Operations with ‗0‘ and ‗1‘)
Theorem 1(a) can be proved by substituting all possible values of X, that is, 0 and 1, into the
given expression and checking whether the LHS equals the RHS:
For example: 0. (A.B+B.C +C.D) = 0 and 1+ (A.B+B.C +C.D) = 1, where A, B and C are
Boolean variables.
where X could be a variable, a term or even a large expression. According to this theorem,
ANDing a Boolean expression to ‗1‘ or ORing ‗0‘ to it makes no difference to the expression:
For example,
1.(A+B.C +C.D) = 0+(A+B.C +C.D) = A+B.C +C.D
Theorems 3(a) and (b) are known by the name of idempotent laws, also known as identity
laws.
Theorem 3(a) is a direct outcome of an AND gate operation, whereas theorem 3(b) represents
an OR gate operation when all the inputs of the gate have been tied together. The scope of
idempotent laws can be expanded further by considering X to be a term or an expression. For
example, let us apply idempotent laws to simplify the following Boolean expression:
Hence, theorem 4(a) is proved. Since theorem 4(b) is the dual of theorem 4(a), its proof is
implied.
The example below further illustrates the application of complementation laws:
1.5.5 Theorem 5 (Commutative property)
The Associative Property, again applying equally well to addition and multiplication.
This property tells us we can associate groups of added or multiplied variables together with
parentheses without altering the truth of the equations.
Theorem 8(b) is the dual of theorem 8(a) and hence stands proved.
The crux of this simplification theorem is that, if a smaller term appears in a larger term, then
the larger term is redundant. The following examples further illustrate the underlying concept:
It States that ―The complement of the sum of the variables is equal to the product of the
complement of each variable‖. This theorem may be expressed by the following Boolean
expression.
1.5.9.2 De-Morgan‘s Second Theorem
It states that the ―Complement of the product of variables is equal to the sum of complements
of each individual variables‖. Boolean expression for this theorem is
• A minterm is the product of N distinct literals where each literal occurs exactly once.
• A maxterm is the sum of N distinct literals where each literal occurs exactly once.
Product-of-Sums Expressions
There are several methods for simplification of Boolean logic expressions. The process is
usually called logic minimization‖ and the goal is to form a result which is efficient. Two
methods we will discuss are algebraic minimization and Karnaugh maps. For very
complicated problems the former method can be done using special software analysis
programs. Karnaugh maps are also limited to problems with up to 4 binary inputs. The Quine–
McCluskey tabular method is used for more than 4 binary inputs.
An n-variable Karnaugh map has 2n squares, and each possible input is allotted a
square. In the case of a minterm Karnaugh map, ‗1‘ is placed in all those squares for which
the output is ‗1‘, and ‗0‘ is placed in all those squares for which the output is ‗0‘. 0s are
omitted for simplicity. An ‗X‘ is placed in squares corresponding to ‗don‘t care‘ conditions. In
the case of a maxterm Karnaugh map, a ‗1‘ is placed in all those squares for which the output
is ‗0‘, and a ‗0‘ is placed for input entries corresponding to a ‗1‘ output. Again, 0s are omitted
for simplicity, and an ‗X‘ is placed in squares corresponding to ‗don‘t care‘ conditions. The
choice of terms identifying different rows and columns of a Karnaugh map is not unique for a
given number of variables. The only condition to be satisfied is that the designation of
adjacent rows and adjacent columns should be the same except for one of the literals being
complemented. Also, the extreme rows and extreme columns are considered adjacent.
Some of the possible designation styles for two-, three- and four-variable minterm Karnaugh
maps are shown in the figure below.
The style of row identification need not be the same as that of column identification as long as
it meets the basic requirement with respect to adjacent terms. It is, however, accepted practice
to adopt a uniform style of row and column identification. Also, the style shown in the figure
below is more commonly used. A similar discussion applies for maxterm Karnaugh maps.
Having drawn the Karnaugh map, the next step is to form groups of 1s as per the following
guidelines:
1. Each square containing a ‗1‘ must be considered at least once, although it can be
considered as often as desired.
2. The objective should be to account for all the marked squares in the minimum number
of groups.
3. The number of squares in a group must always be a power of 2, i.e. groups can have
1,2, 4_ 8, 16, squares.
4. Each group should be as large as possible, which means that a square should not be
accounted for by itself if it can be accounted for by a group of two squares; a group of
two squares should not be made if the involved squares can be included in a group of
four squares and so on.
5. ‗Don‘t care‘ entries can be used in accounting for all of 1-squares to make optimum
groups. They are marked ‗X‘ in the corresponding squares. It is, however, not
necessary to account for all ‗don‘t care‘ entries. Only such entries that can be used to
advantage should be used.
Minterm Karnaugh map and Maxterm Karnaugh map of the three variable Boolean function
The truth table, Minterm Karnaugh map and Maxterm Karnaugh map of the four variable
Boolean function
To illustrate the process of forming groups and then writing the corresponding minimized
Boolean expression, The below figures respectively show minterm and maxterm Karnaugh
maps for the Boolean functions expressed by the below equations. The minimized expressions
as deduced from Karnaugh maps in the two cases are given by Equation in the case of the
minterm Karnaugh map and Equation in the case of the maxterm Karnaugh map:
1.10 Quine–McCluskey Tabular Method
The Quine–McCluskey tabular method of simplification is based on the
complementation theorem, which says that
The reverse is true in the case of a product-of-sums expression. The groups are then arranged,
beginning with the group having the least number of 1s in its included terms. Terms within the
same group are arranged in ascending order of the decimal numbers represented by these
terms. As an illustration, consider the expression
It may be mentioned here that the Boolean expressions that we have considered above did not
contain any optional terms. If there are any, they are also considered while forming groups.
This completes the first table.
3. The terms of the first group are successively matched with those in the next adjacent higher
order group to look for any possible matching and consequent reduction. The terms are
considered matched when all literals except for one match. The pairs of matched terms are
replaced with a single term where the position of the unmatched literals is replaced with a
dash (—). These new terms formed as a result of the matching process find a place in the
second table. The terms in the first table that do not find a match are called the prime
implicants and are marked with an asterisk (∗). The matched terms are ticked (_).
4. Terms in the second group are compared with those in the third group to look for a possible
match.
Again, terms in the second group that do not find a match become the prime implicants.
5. The process continues until we reach the last group. This completes the first round of
matching.
The terms resulting from the matching in the first round are recorded in the second table.
6. The next step is to perform matching operations in the second table. While comparing the
terms for a match, it is important that a dash (—) is also treated like any other literal, that is,
the dash signs also need to match. The process continues on to the third table, the fourth table
and so on until the terms become irreducible any further.
7. An optimum selection of prime implicants to account for all the original terms constitutes
the terms for the minimized expression. Although optional (also called ‗don‘t care‘) terms are
considered for matching, they do not have to be accounted for once prime implicants have
been identified.
Let us consider an example. Consider the following sum-of-products expression:
The second round of matching begins with the table shown on the previous page. Each term in
the first group is compared with every term in the second group. For instance, the first term in
the first group 00−1 matches with the second term in the second group 01−1 to yield 0−−1,
which is recorded in the table shown below. The process continues until all terms have been
compared for a possible match. Since this new table has only one group, the terms contained
therein are all prime implicants. In the present example, the terms in the first and second
tables have all found a match. But that is not always the case.
The next table is what is known as the prime implicant table. The prime implicant table
contains all the original terms in different columns and all the prime implicants recorded in
different rows as shown below:
Each prime implicant is identified by a letter. Each prime implicant is then examined one by
one and the terms it can account for are ticked as shown. The next step is to write a product-
of-sums expression using the prime implicants to account for all the terms. In the present
illustration, it is given as follows.
Obvious simplification reduces this expression to PQRS which can be interpreted to mean that
all prime implicants, that is, P, Q, R and S, are needed to account for all the original terms.
Therefore, the minimized expression =
What has been described above is the formal method of determining the optimum set of prime
implicants. In most of the cases where the prime implicant table is not too complex, the
exercise can be done even intuitively. The exercise begins with identification of those terms
that can be accounted for by only a single prime implicant. In the present example, 0011,
0110, 1001 and 1100 are such terms. As a result, P, Q, R and S become the essential prime
implicants. The next step is to find out if any terms have not been covered by the essential
prime implicants. In the present case, all terms have been covered by essential prime
implicants. In fact, all prime implicants are essential prime implicants in the present example.
As another illustration, let us consider a product-of-sums expression given by
The procedure is similar to that described for the case of simplification of sum-of-products
expressions.
The resulting tables leading to identification of prime implicants are as follows:
The prime implicant table is constructed after all prime implicants have been identified to
look for the optimum set of prime implicants needed to account for all the original terms. The
prime implicant table shows that both the prime implicants are the essential ones:
1.11 Universal Gates
OR, AND and NOT gates are the three basic logic gates as they together can be used
to construct the logic circuit for any given Boolean expression. NOR and NAND gates have
the property that they individually can be used to hardware-implement a logic circuit
corresponding to any given Boolean expression. That is, it is possible to use either only
NAND gates or only NOR gates to implement any Boolean expression. This is so because a
combination of NAND gates or a combination of NOR gates can be used to perform functions
of any of the basic logic gates. It is for this reason that NAND and
NOR gates are universal gates. As an illustration, Fig. 4.24 shows how two-input NAND
gates can be used to construct a NOT circuit, a two-input AND gate and a two-input OR gate.
Figure shows the same using NOR gates. Understanding the conversion of NAND to OR and
NOR to AND requires the use of DeMorgan‘s theorem, which is discussed in Chapter 6 on
Boolean algebra.
These are gates where we need to connect an external resistor, called the pull-up resistor,
between the output and the DC power supply to make the logic gate perform the intended
logic function. Depending on the logic family used to construct the logic gate, they are
referred to as gates with open collector output (in the case of the TTL logic family) or open
drain output (in the case of the MOS logic family). Logic families are discussed in detail in
Chapter 5. The advantage of using open collector/open drain gates lies in their capability of
providing an ANDing operation when outputs of several gates are tied together through a
common pull-up resistor,
Fig 1.11.1 Implementation of basic logic gates using only NAND gates.
without having to use an AND gate for the purpose. This connection is also referred to as
WIRE-AND connection. Figure shows such a connection for open collector NAND gates. The
output in this case would be
WIRE-AND connection with open collector/drain devices.
The disadvantage is that they are relatively slower and noisier. Open collector/drain devices
are therefore not recommended for applications where speed is an important consideration.
This symbol is seldom used in Boolean expressions because the identities, laws, and rules
of simplification involving addition, multiplication, and complementation do not apply to it.
However, there is a way to represent the Exclusive-OR function in terms of OR and AND, as
has been shown in previous chapters: AB‘ + A‘B.
Introduction
The term ‖combinational‖ comes to us from mathematics. In mathematics a
combination is an unordered set, which is a formal way to say that nobody cares which order
the items came in. Most games work this way, if you rolled dice one at a time and get a 2
followed by a 3 it is the same as if you had rolled a 3 followed by a 2. With combinational
logic, the circuit produces
the same output regardless of the order the inputs are changed. There are circuits which
depend on the when the inputs change, these circuits are called sequential logic. Even though
you will not find the term ‖sequential logic‖ in the chapter titles, the next several chapters will
discuss sequential logic. Practical circuits will have a mix of combinational and sequential
logic, with sequential logic making sure everything happens in order and combinational logic
performing functions like arithmetic, logic, or conversion.
A combinational circuit is one where the output at any time depends only on the
present combination of inputs at that point of time with total disregard to the past state of the
inputs. The logic gate is the most basic building block of combinational logic. The logical
function performed by a combinational circuit is fully defined by a set of Boolean
expressions. The other category of logic circuits, called sequential logic circuits, comprises
both logic gates and memory elements such as flip-flops. Owing to the presence of memory
elements, the output in a sequential circuit depends upon not only the present but also the past
state of inputs.
The Fig 3.1 shows the block schematic representation of a generalized combinational circuit
having n input variables and m output variables or simply outputs. Since the number of input
variables is
Fig 3.1 Generalized Combinational Circuit
n, there are 2n possible combinations of bits at the input. Each output can be expressed in
terms of input variables by a Boolean expression, with the result that the generalized system
of above fig can be expressed by m Boolean expressions. As an illustration, Boolean
expressions describing the function of a four-input OR/NOR gate are given as
….. Eq – 1
Addition and subtraction are the two most commonly used arithmetic operations, as
the other two, namely multiplication and division, are respectively the processes of repeated
addition and repeated subtraction, as was outlined in Chapter 2 dealing with binary arithmetic.
We will begin with the basic building blocks that form the basis of all hardware used to
perform the aforesaid arithmetic operations on binary numbers. These include half-adder, full
adder, half-subtractor, full subtractor and controlled inverter.
3.3.1 Half-Adder
A half-adder is an arithmetic circuit block that can be used to add two bits. Such a
circuit thus has two inputs that represent the two bits to be added and two outputs, with one
producing the SUM output and the other producing the CARRY. Figure 3.2 shows the truth
table of a half-adder, showing all possible input combinations and the corresponding outputs.
The Boolean expressions for the SUM and CARRY outputs are given by the equations below
An examination of the two expressions tells that there is no scope for further simplification.
While the first one representing the SUM output is that of an EX-OR gate, the second one
representing the CARRY output is that of an AND gate. However, these two expressions can
certainly be represented in different forms using various laws and theorems of Boolean
algebra to illustrate the flexibility that the designer has in hardware-implementing as simple a
combinational function as that of a half-adder.
Fig 3.3 Logic Implementation of Half Adder
Although the simplest way to hardware-implement a half-adder would be to use a two-input
EX-OR gate for the SUM output and a two-input AND gate for the CARRY output, as shown
in Fig. 3.3, it could also be implemented by using an appropriate arrangement of either NAND
or NOR gates.
A full adder circuit is an arithmetic circuit block that can be used to add three bits to produce a
SUM and a CARRY output. Such a building block becomes a necessity when it comes to
adding binary numbers with a large number of bits. The full adder circuit overcomes the
limitation of the half-adder, which can be used to add two bits only. Let us recall the
procedure for adding larger binary numbers. We begin with the addition of LSBs of the two
numbers. We record the sum under the LSB column and take the carry, if any, forward to the
next higher column bits. As a result, when we add the next adjacent higher column bits, we
would be required to add three bits if there were a carry from the previous addition. We have a
similar situation for the other higher column bits. Also until we reach the MSB. A full adder is
therefore essential for the hardware implementation of an adder circuit capable of adding
larger binary numbers. A half-adder can be used for addition of LSBs only.
Figure 3.4 shows the truth table of a full adder circuit showing all possible input combinations
and corresponding outputs. In order to arrive at the logic circuit for hardware implementation
of a full adder, we will firstly write the Boolean expressions for the two output variables, that
is, the SUM and CARRY outputs, in terms of input variables. These expressions are then
simplified by using any of the simplification techniques described in the previous chapter. The
Boolean expressions for the two output variables are given in Equation below for the SUM
output (S) and in above Equation for the CARRY output (Cout):
The next step is to simplify the two expressions. We will do so with the help of the Karnaugh
mapping technique. Karnaugh maps for the two expressions are given in Fig. 3.5(a) for the
SUM output and Fig. 3.5(b) for the CARRY output. As is clear from the two maps, the
expression for the SUM (S) output cannot be simplified any further, whereas the simplified
Boolean expression for Cout is given by the equation
Figure 3.6 shows the logic circuit diagram of the full adder. A full adder can also be seen to
comprise two half-adders and an OR gate. The expressions for SUM and CARRY outputs can
be rewritten as follows:
Fig 3.5 Karnaugh Map for the sum and carry out of a full adder
Fig 3.6 Logic circuit diagram of full adder
Boolean expression above can be implemented with a two-input EX-OR gate provided that
one of the inputs is Cin and the other input is the output of another two-input EX-OR gate
with A and B as its inputs. Similarly, Boolean expression above can be implemented by
ORing two minterms. One of them is the AND output of A and B. The other is also the output
of an AND gate whose inputs are Cin and the output of an EX-OR operation on A and B. The
whole idea of writing the Boolean expressions in this modified form was to demonstrate the
use of a half-adder circuit in building a full adder. Figure 3.7(a) shows logic implementation
of Equations above. Figure 3.7(b) is nothing but Fig. 3.7(a) redrawn with the portion of the
circuit representing a half-adder replaced with a block. The full adder of the type described
above forms the basic building block of binary adders. However, a single full adder circuit can
be used to add one-bit binary numbers only. A cascade arrangement of these adders can be
used to construct adders capable of adding binary numbers with a larger number of bits. For
example, a four-bit binary adder would require four full adders of the type shown in Fig. 3.7
to be connected in cascade. Figure 3.8 shows such an arrangement. (A3A2A1A0) and
(B3B2B1B0) are the two binary numbers to be added, with A0 and B0 representing LSBs and
A3 and B3 representing MSBs of the two numbers.
Fig 3.7 Logic Implementation of a full adder with Half Adders
3.4 Half-Subtractor
We will study the use of adder circuits for subtraction operations in the following pages.
Before we do that, we will briefly look at the counterparts of half-adder and full adder circuits
in the half-subtractor and full subtractor for direct implementation of subtraction operations
using logic gates.
A half-subtractor is a combinational circuit that can be used to subtract one binary digit from
another to produce a DIFFERENCE output and a BORROW output. The BORROW output
here specifies whether a ‗1‘ has been borrowed to perform the subtraction. The truth table of a
half-subtractor, as shown in Fig. 3.9, explains this further. The Boolean expressions for the
two outputs are given by the equations
Fig 3.9 Half Subtractor
It is obvious that there is no further scope for any simplification of the Boolean expressions
given by above equations. While the expression for the DIFFERENCE (D) output is that of
an EX-OR gate, the expression for the BORROW output (Bo) is that of an AND gate with
input
A complemented before it is fed to the gate. Figure 3.10 shows the logic implementation of a
half-subtractor. Comparing a half-subtractor with a half-adder, we find that the expressions
for the SUM and DIFFERENCE outputs are just the same. The expression for BORROW in
the case of the half-subtractor is also similar to what we have for CARRY in the case of the
half-adder. If
the input A, that is, the minuend, is complemented, an AND gate can be used to implement
the
BORROW output. Note the similarities between the logic diagrams of Fig. 3.3 (half-adder)
and Fig. 3.10 (half-subtractor).
A full subtractor performs subtraction operation on two bits, a minuend and a subtrahend, and
also takes into consideration whether a ‗1‘ has already been borrowed by the previous
adjacent lower minuend bit or not. As a result, there are three bits to be handled at the input of
a full subtractor, namely the two bits to be subtracted and a borrow bit designated as Bin .
There are two outputs, namely the DIFFERENCE output D and the BORROW output Bo. The
BORROW output bit tells whether the minuend bit needs to borrow a ‗1‘ from the next
possible higher minuend bit. Figure 3.11 shows the truth table of a full subtractor.
The Boolean expressions for the two output variables are given by the equations
Fig 3.11 Truth Table of Full Subtractor
The Karnaugh maps for the two expressions are given in Fig. 3.12(a) for DIFFERENCE
output D and in Fig. 3.12(b) for BORROW output Bo. As is clear from the two Karnaugh
maps, no simplification is possible for the difference output D. The simplified expression for
Bo is given by the equation
If we compare these expressions with those derived earlier in the case of a full adder, we find
that the expression for DIFFERENCE output D is the same as that for the SUM output. Also,
the expression for BORROW output Bo is similar to the expression for CARRY-OUT Co. In
the case of a half-subtractor, the A input is complemented. By a similar analysis it can be
shown that a full subtractor can be implemented with half-subtractors in the same way as a
full adder was constructed using half-adders. Relevant logic diagrams are shown in Figs 3.7(a)
and (b) corresponding to Figs 3.7(a) and (b) respectively for a full adder. Again, more than
one full subtractor can be connected in cascade to perform subtraction on two larger binary
numbers. As an illustration, Fig. 3.13 shows a four-bit subtractor.
Fig 3.13 Four Bit Subtractor
Multipliers
Many microprocessors do not have in their ALU the hardware that can perform multiplication
or other complex arithmetic operations such as division, determining the square root,
trigonometric functions, etc. These operations in these microprocessors are executed through
software. For example, a multiplication operation may be accomplished by using a software
program that does multiplication through repeated execution of addition and shift instructions.
Other complex operations mentioned above can also be executed with similar programs.
Although the use of software reduces the hardware needed in the microprocessor, the
computation time in general is higher in the case of software-executed operations when
compared with the use of hardware to perform those operations.
MULTIPLEXERS
It is clear from Figures 13 and 14 that the structure of a multiplexer is that of a two-
level AND-OR logic circuit, with each AND gate having n + 1 inputs, where n is the number
of select inputs. It appears that the multiplexer would constitute a canonic sum-of-products
implementation of a switching function if all the data lines together represent just one
switching variable (or its complement) and each of the select inputs represents a switching
variable.
Let‘s work backward from a specified function of m switching variables for which we have
written a canonic sum-of-products expression. The size of multiplexer needed (number of
select inputs) is not evident. Suppose we choose a multiplexer that has m − 1 select inputs,
leaving only one other variable to accommodate all the data inputs.We write an output
function of these select inputs and the 2m–1 data inputs Di. Now we plan to assign m − 1 of
these variables to the select inputs; but how to make the assignment?4 There are really no
restrictions, so it can be done arbitrarily. The next step is to write the multiplexer output after
replacing the select inputs
with m − 1 of the variables of the given function. By comparing the two expressions term by
term, the Di inputs can be determined in terms of the remaining variable.
Demultiplexers
The demultiplexer shown there is a single-input, multiple-output circuit. However, in
addition to the data input, there must be other inputs to control the transmission of the data to
the appropriate data output line at any given time. Such a demultiplexer circuit having eight
output lines is shown in Figure 16a. It is instructive to compare this demultiplexer circuit with
the multiplexer circuit in Figure 13. For the same number of control (select) inputs, there are
the same number of AND gates. But now each AND gate output is a circuit output. Rather
than each gate having its own separate data input, the single data line now forms one of the
inputs to each AND gate, the other AND inputs being control inputs.
When the word formed by the control inputs C2C1C0 is the binary equivalent of
decimal k, then the data input x is routed to output Dk. Viewed in another way, for a
demultiplexer with n control inputs, each AND gate output corresponds to a minterm of n
variables. For a given combination of control inputs, only one minterm can take on the value
1; the data input is routed to the AND gate corresponding to this minterm. For example, the
logical expression for the output D3 is xC2'C1C0. Hence, when C2C1C0 = 011, then D3 = x
and all other Di are 0. The complete truth table for the eight-output demultiplexer.
PART -A
1) Define binary logic?
Binary logic consists of binary variables and logical operations. The variables are
designated by the alphabets such as A, B, C, x, y, z, etc., with each variable having
only two distinct values: 1 and 0. There are three basic logic operations: AND, OR,
and NOT.
15) Find the excess -3 code and 9‘s complement of the number 403 10
403
010000000011
001100110011+
0 1 1 1 0 0 1 1 0 1 1 0 ----- excess 3 code
9‘s complement 1 0 0 0 1 1 0 0 1 0 0 1
22) Given the two binary numbers X = 1010100 and Y = 1000011, perform the subtraction
(a) X -Y and (b) Y - X using 1's complements.
a) X - Y = 1010100 - 1000011
X = 1010100
1's complement of Y = + 0111100
--------------
Sum = 10010000
End -around carry = + 1
--------------
Answer: X - Y = 0010001
b) Y - X = 1000011 - 1010100
Y = 1000011
1's complement of X = + 0101011
-----------
Sum = + 1101110
There is no end carry.
Therefore the answer is Y - X = -(1's complement of 1101110) = -0010001
23) Write the names of basic logical operators.
1. NOT / INVERT
2. AND
3. OR
24) What are basic properties of Boolean algebra?
The basic properties of Boolean algebra are commutative property, associative
property and distributive property.
Control Unit
Generates signals within uP to carry out the instruction, which has been
decoded. In
reality causes certain connections between blocks of the uP to be opened or
closed, so
that data goes where it is required, and so that ALU operations occur.
Arithmetic Logic Unit
The ALU performs the actual numerical and logic operation such as ‗add‘,
‗subtract‘,
‗AND‘, ‗OR‘, etc. Uses data from memory and from Accumulator to perform
arithmetic. Always stores result of operation in Accumulator.
Registers
The 8085/8080A-programming model includes six registers, one accumulator,
and
one flag register, as shown in Figure. In addition, it has two 16-bit registers: the
stack
pointer and the program counter. They are described briefly as follows.
The 8085/8080A has six general-purpose registers to store 8-bit data; these are
identified as B,C,D,E,H, and L as shown in the figure. They can be combined as
register pairs - BC, DE, and HL - to perform some 16-bit operations. The
programmer can use these registers to store or copy data into the registers by
using
data copy instructions.
Accumulator
The accumulator is an 8-bit register that is a part of arithmetic/logic unit (ALU).
This
register is used to store 8-bit data and to perform arithmetic and logical
operations.
The result of an operation is stored in the accumulator. The accumulator is also
identified as register A.
Flags
The ALU includes five flip-flops, which are set or reset after an operation
according
to data conditions of the result in the accumulator and other registers. They are
called
Zero(Z), Carry (CY), Sign (S), Parity (P), and Auxiliary Carry (AC) flags; they
are
listed in the Table and their bit positions in the flag register are shown in the
Figure
below. The most commonly used flags are Zero, Carry, and Sign. The
microprocessor
uses these flags to test data conditions.
For example, after an addition of two numbers, if the sum in the accumulator id
larger than eight bits,
the flip-flop uses to indicate a carry -- called the Carry flag (CY) – is set to one.
When an arithmetic
operation results in zero, the flip-flop called the
Zero(Z) flag is set to one. The first Figure shows an 8-bit register, called the flag
register, adjacent to the accumulator. However, it is not used as a register; five
bit
positions out of eight are used to store the outputs of the five flip-flops. The
flags are
stored in the 8-bit register so that the programmer can examine these flags (data
conditions) by accessing the register through an instruction.
These flags have critical importance in the decision-making process of the
microprocessor.
The conditions (set or reset) of the flags are tested through the software
instructions. For example, the instruction JC (Jump on Carry) is implemented to
change the sequence of a program when CY flag is set. The thorough
understanding
of flag is essential in writing assembly language programs.
Program Counter (PC)
This 16-bit register deals with sequencing the execution of instructions. This
register
is a memory pointer. Memory locations have 16-bit addresses, and that is why
this is a
16-bit register.
The microprocessor uses this register to sequence the execution of the
instructions.
The function of the program counter is to point to the memory address from
which the
next byte is to be fetched. When a byte (machine code) is being fetched, the
program
counter is incremented by one to point to the next memory location
Stack Pointer (SP)
The stack pointer is also a 16-bit register used as a memory pointer. It points to a
memory location in R/W memory, called the stack. The beginning of the stack is
defined by loading 16-bit address in the stack pointer. The stack concept is
explained
in the chapter "Stack and Subroutines."
Instruction Register/Decoder
Temporary store for the current instruction of a program. Latest instruction sent
here
from memory prior to execution. Decoder then takes instruction and ‗decodes‘
or
interprets the instruction. Decoded instruction then passed to next stage.
Memory Address Register
Holds address, received from PC, of next program instruction. Feeds the address
bus
with addresses of location of the program under execution.
Control Generator
Generates signals within uP to carry out the instruction which has been decoded.
In
reality causes certain connections between blocks of the uP to be opened or
closed, so
that data goes where it is required, and so that ALU operations occur.
Register Selector
This block controls the use of the register stack in the example. Just a logic
circuit
which switches between different registers in the set will receive instructions
from
Control Unit.
General Purpose Registers
uP requires extra registers for versatility. Can be used to store additional data
during a
program. More complex processors may have a variety of differently named
registers.
Microprogramming
How does the μP knows what an instruction means, especially when it is only a
binary number? The microprogram in a uP/uC is written by the chip designer
and tells
the uP/uC the meaning of each instruction uP/uC can then carry out operation.
that it will relinquish the buses in the next clock cycle. HLDA goes low after the Hold
request is removed. The CPU takes the buses one half clock cycle after HLDA
goes
low.
INTR (Input)
INTERRUPT REQUEST; is used as a general purpose interrupt. It is sampled
only
during the next to the last clock cycle of the instruction. If it is active, the
Program
Counter (PC) will be inhibited from incrementing and an INTA will be issued.
During
this cycle a RESTART or CALL instruction can be inserted to jump to the
interrupt
service routine. The INTR is enabled and disabled by software. It is disabled by
Reset
and immediately after an interrupt is accepted.
INTA (Output)
INTERRUPT ACKNOWLEDGE; is used instead of (and has the same timing
as) RD
during the Instruction cycle after an INTR is accepted. It can be used to activate
the
8259 Interrupt chip or some other interrupt port.
RST 5.5
RST 6.5 - (Inputs)
RST 7.5
RESTART INTERRUPTS;
These three inputs have the same timing as I NTR except
they cause an internal RESTART to be automatically inserted.
RST 7.5 ~~ Highest Priority
RST 6.5
RST 5.5 o Lowest Priority
The priority of these interrupts is ordered as shown above. These interrupts have
a
higher priority than the INTR.
TRAP (Input)
Trap interrupt is a nonmaskable restart interrupt. It is recognized at the same
time as
INTR. It is unaffected by any mask or Interrupt Enable. It has the highest
priority of
any interrupt.
RESET IN (Input)
Reset sets the Program Counter to zero and resets the Interrupt Enable and
HLDA
flipflops. None of the other flags or registers (except the instruction register) are
affected The CPU is held in the reset condition as long as Reset is applied.
RESET OUT (Output)
Indicates CPlJ is being reset. Can be used as a system RESET. The signal is
synchronized to the processor clock.
X1, X2 (Input)
Crystal or R/C network connections to set the internal clock generator X1 can
also be
an external clock input instead of a crystal. The input frequency is divided by 2
to
give the internal operating frequency.
CLK (Output)
Clock Output for use as a system clock when a crystal or R/ C network is used as
an
input to the CPU. The period of CLK is twice the X1, X2 input period.
IO/M (Output)
IO/M indicates whether the Read/Write is to memory or l/O Tristated during
Hold and
Halt modes.
SID (Input)
Serial input data line The data on this line is loaded into accumulator bit 7
whenever a
RIM instruction is executed.
SOD (output)
Serial output data line. The output SOD is set or reset as specified by the SIM
instruction.
Vcc
+5 volt supply.
Vss
Ground Reference.
{The instructions MOV B, A or MVI A, 82H are to copy data from a source into a
destination. In these instructions the source can be a register, an input port, or an 8-bit
number (00H to FFH). Similarly, a destination can be a register or an output port. The
sources and destination are operands. The various formats for specifying operands are
called the ADDRESSING MODES. For 8085, they are:
1. Immediate addressing.
2. Register addressing.
3. Direct addressing.
4. Indirect addressing.
Immediate addressing
Data is present in the instruction. Load the immediate data to the destination
provided.
Example: MVI R,data
Register addressing
Data is provided through the registers.
Example: MOV Rd, Rs
Direct addressing
Used to accept data from outside devices to store in the accumulator or send the
data
stored in the accumulator to the outside device. Accept the data from the port
00H and
store them into the accumulator or Send the data from the accumulator to the
port 01H.
Example: IN 00H or OUT 01H
Indirect Addressing
This means that the Effective Address is calculated by the processor. And the
contents of the address (and the one following) is used to form a second address.
The
second address is where the data is stored. Note that this requires several
memory
accesses; two accesses to retrieve the 16-bit address and a further access (or
accesses)
to retrieve the data which is to be loaded into the register.}
7. Instruction Set Classification
An instruction is a binary pattern designed inside a microprocessor to perform a
specific function. The entire group of instructions, called the instruction set,
determines what functions the microprocessor can perform. These instructions can be
classified into the following five functional categories: data transfer (copy)
operations, arithmetic operations, logical operations, branching operations, and
machine-control operations.
Data Transfer (Copy) Operations
This group of instructions copy data from a location called a source to another
location called a destination, without modifying the contents of the source. In
technical manuals, the term data transfer is used for this copying function. However,
the term transfer is misleading; it creates the impression that the contents of the
source are destroyed when, in fact, the contents are retained without any modification.
The various types of data transfer (copy) are listed below together with examples of
each type:
Types
Examples
1. Between Registers.
Copy the contents of the register B into register D.
2. Specific data byte to a register or a memory location.
Load register B with the data byte 32H.
3. Between a memory location and a register.
From a memory location 2000H to register B.
4. Between an I/O device and the accumulator.
From an input keyboard to the accumulator.
Arithmetic Operations
These instructions perform arithmetic operations such as addition, subtraction,
increment, and decrement.
Logical Operations
These instructions perform various logical operations with the contents of the
accumulator.
AND, OR Exclusive-OR - Any 8-bit number, or the contents of a register, or of
a memory location can be logically ANDed, Ored, or Exclusive-ORed with the
contents of the accumulator. The results are stored in the accumulator.
Rotate- Each bit in the accumulator can be shifted either left or right to the next
position.
Compare- Any 8-bit number, or the contents of a register, or a memory location can
be compared for equality, greater than, or less than, with the contents of the
accumulator.
Complement - The contents of the accumulator can be complemented. All 0s are
replaced by 1s and all 1s are replaced by 0s.
Branching Operations
This group of instructions alters the sequence of program execution either
conditionally or unconditionally.
Call, Return, and Restart - These instructions change the sequence of a program
either by calling a subroutine or returning from a subroutine. The conditional Call and
Return instructions also can test condition flags.
Features 8085
8080
Separate
Multiplexed address
4. Address/Data bus address and
and data
data busses
1. What are the various registers in 8085? - Accumulator register, Temporary register,
Instruction register, Stack Pointer, Program Counter are the various registers in 8085 .
2. In 8085 name the 16 bit registers? - Stack pointer and Program counter all have 16
bits.
3. What are the various flags used in 8085? - Sign flag, Zero flag, Auxillary flag, Parity
flag, Carry flag.
4. What is Stack Pointer? - Stack pointer is a special purpose 16-bit register in the
Microprocessor, which holds the address of the top of the stack.
5. What is Program counter? - Program counter holds the address of either the first byte
of the next instruction to be fetched for execution or the address of the next byte of a
multi byte instruction, which has not been completely fetched. In both the cases it gets
incremented automatically one by one as the instruction bytes get fetched. Also Program
register keeps the address of the next instruction.
6. Which Stack is used in 8085? - LIFO (Last In First Out) stack is used in 8085.In this
type of Stack the last stored information can be retrieved first.
7. What happens when HLT instruction is executed in processor? - The Micro Processor
enters into Halt-State and the buses are tri-stated.
8. What is meant by a bus? - A bus is a group of conducting lines that carriers data,
address, & control signals.
9. What is Tri-state logic? - Three Logic Levels are used and they are High, Low, High
impedance state. The high and low are normal logic levels & high impedance state is
electrical open circuit conditions. Tri-state logic has a third line called enable line.
10. Give an example of one address microprocessor? - 8085 is a one address
microprocessor.
11. In what way interrupts are classified in 8085? - In 8085 the interrupts are classified as
Hardware and Software interrupts.
12. What are Hardware interrupts? - TRAP, RST7.5, RST6.5, RST5.5, INTR.
13. What are Software interrupts? - RST0, RST1, RST2, RST3, RST4, RST5, RST6,
RST7.
14. Which interrupt has the highest priority? - TRAP has the highest priority.
15. Name 5 different addressing modes? - Immediate, Direct, Register, Register indirect,
Implied addressing modes.
16. How many interrupts are there in 8085? - There are 12 interrupts in 8085.
17. What is clock frequency for 8085? - 3 MHz is the maximum clock frequency for 8085.
18. What is the RST for the TRAP? - RST 4.5 is called as TRAP.
19. In 8085 which is called as High order / Low order Register? - Flag is called as Low
order register & Accumulator is called as High order Register.
20. What are input & output devices? - Keyboards, Floppy disk are the examples of input
devices. Printer, LED / LCD display, CRT Monitor are the examples of output devices.
21. Can an RC circuit be used as clock source for 8085? - Yes, it can be used, if an
accurate clock frequency is not required. Also, the component cost is low compared to
LC or Crystal.
22. Why crystal is a preferred clock source? - Because of high stability, large Q (Quality
Factor) & the frequency that doesn‘t drift with aging. Crystal is used as a clock source
most of the times.
23. Which interrupt is not level-sensitive in 8085? - RST 7.5 is a raising edge-triggering
interrupt.
24. What does Quality factor mean? - The Quality factor is also defined, as Q. So it is a
number, which reflects the lossness of a circuit. Higher the Q, the lower are the losses.
25. What are level-triggering interrupt? - RST 6.5 & RST 5.5 are level-triggering
interrupts.
7. What is an Opcode?
Ans: The part of the instruction that specifies the operation to be performed is
called the operation code or opcode.
9. What is an Operand?
Ans: The data on which the operation is to be performed is called as an Operand.
10. How many operations are there in the instruction set of 8085 microprocessor?
Ans: There are 74 operations in the 8085 microprocessor.
11. List out the five categories of the 8085 instructions. Give examples of
the instructions for each group.
Ans:
12. Explain the difference between a JMP instruction and CALL instruction.
Ans: A JMP instruction permanently changes the program counter. A CALL
instruction leaves information on the stack so that the original program
execution sequence can be resumed.
14. What is the difference between the shift and rotate instructions?
Ans: A rotate instruction is a closed loop instruction. That is, the data moved
out at one end is put back in at the other end. The shift instruction loses the data
that is moved out of the last bit locations.
16. What are the Control signals used for DMA operation?
Ans:-HOLD & HLDA.
17. What is meant by Wait State?
Ans:-This state is used by slow peripheral devices. The peripheral devices can transfer
the data to or from the microprocessor by using READY input line. The microprocessor
remains in wait state as long as READY line is low. During the wait state, the contents
of the address, address/data and control buses are held constant.
18. List the four instructions which control the interrupt structure of the 8085
microprocessor.
Ans:-
DI ( Disable Interrupts )
EI ( Enable Interrupts )
RIM ( Read Interrupt Masks )
SIM ( Set Interrupt Masks )
Ans:-The 8085 microprocessor has five interrupt inputs. They are TRAP, RST 7.5, RST
6.5, RST 5.5, and INTR. These interrupts have a fixed priority of interrupt service. If
two or more interrupts go high at the same time, the 8085 will service them on priority
basis. The TRAP has the highest priority followed by RST 7.5, RST 6.5, RST 5.5. The
priority of interrupts in 8085 is shown in the table.
TRAP 1
RST 7.5 2
RST 6.5 3
RST 5.5 4
INTR 5
22. What is a microcomputer?
Ans:-A computer that is designed using a microprocessor as its CPU is called
Microcomputer
23. What is the signal classification of 8085
Ans:-All the signals of 8085 can be classified into 6 groups
Address bus
Data bus
Control and status signals
Power supply and frequency signals
Externally initiated signals
Serial I/O ports
24. What are operations performed on data in 8085
Ans:- The various operations performed are Store 8-bit data Perform arithmetic and
logical operationsTest for conditions Sequence the execution of instructions Store data
temporarily during execution in the defined R/W memory locations called the stack
Ans:-The ALE is used to latch the lower order address so that it can be available in T2
and T3 and used for identifying the memory address. During T1 the ALE goes high, the
latch is transparent ie, the output changes according to the input data, so the output of
the latch is the lower order address. When ALE goes low the lower order address is
latched until the next ALE.
31. How many machine cycles does 8085 have, mention them
Ans:The 8085 have seven machine cycles. They are
Opcode fetch
Memory read
Memory write
I/O read
I/O write
Interrupt acknowledge
Bus idle
33. Mention the categories of instruction and give two examples for each category.
Ans:The instructions of 8085 can be categorized into the following five
categories
Ans:LDA copies the data byte into accumulator from the memory location specified by
the 16-bit address. STA copies the data byte from the accumulator in the memory
location specified by 16-bit address. DAA changes the contents of the accumulator from
binary to 4-bit BCD digits.
36. What is the use of addressing modes, mention the different types
Ans:The various formats of specifying the operands are called addressing modes, it is
used to access the operands or data. The different types are as follows
Immediate addressing
Register addressing
Direct addressing
Indirect addressing
Implicit addressing
37. What is the use of bi-directional buffers?
Ans:It is used to increase the driving capacity of the data bus. The data bus of a
microcomputer system is bi-directional, so it requires a buffer that allows the data to
flow in both directions.
38. Give the register organization of 8085
Ans:
W(8) Temp. Reg
Z(8) Temp. Reg
B(8) Register
C(8) Register
D(8) Register
E(8) Register
H(8) Register
L(8) Register
Stack Pointer (16)
Program Counter (16)
39. Define stack and explain stack related instructions
Ans:The stack is a group of memory locations in the R/W memory that is used for the
temporary storage of binary information during the execution of the program. The stack
related instructions are PUSH & POP
Ans:The flags are used to reflect the data conditions in the accumulator. The 8085 flags
are S-Sign flag, Z-Zero flag, AC-Auxiliary carry flag, P-Parity flag, CYCarry flag, D7
D6 D5 D4 D3 D2 D1 D0
44. How does the microprocessor differentiate between data and instruction?
Ans:When the first m/c code of an instruction is fetched and decoded in the instruction
register, the microprocessor recognizes the number of bytes required to fetch the entire
instruction. For example MVI A, Data, the second byte is always considered as data. If
the data byte is omitted by mistake whatever is in that memory location will be
considered as data & the byte after the ―data‖ will be treated as the next instruction.
1.RET transfers the contents of the top two locations of the stack to the PC
2.When RET is executed the SP is incremented by two
3.Has 8 conditional RETURN instructions
1.POP transfers the contents of the top two locations of the stack to the specified
register pair
2. When POP is executed the SP is incremented by two
3.No conditional POP instructions
PART—B
1. Draw the functional block diagram of 8085, and explain in brief. (16)
2. What are the different addressing modes used in 8085. Explain with an example. (16)
3. Discuss the interrupt system in 8085. (16)
4. What are the memories mapped I/O, I/O mapped & I/O explain. (16)
5. Draw the timing diagram for IN & OUT instructions of 8085. (16)
7. a. Draw the block diagram of 8085 mp and explain? (12)
b. Write an assembly language program to add two 2-digits BCD Number? (4)
8. a. Explain the instruction set of 8085? (10)
b. Write notes on status flag? (6)
9. a. Explain the architecture of Intel 8085 with the help of a block diagram? (12)
b. Explain the similarities diff b/w subtract and compare instructions in 8085? (4) 10
10. a. Describe the sequence of event that may occur during the different T state in the opcode
Fetch machine cycle of 8085? (8)
b. Write an assembly language program to convert on array of ASCII code to corresponding
Binary (hex) value. The ASCII array is stored starting from 4200H.The first element of the
number of elements in the array. (8)
11. a. With neat block diagram explain the architecture of 8085? (10)
b. List out the maskable and non maskable interrupts available in 8085? (6)
12. a. How do the instructions of 8085 is classified based on their function and word length?
Give
an example? (8)
b. Write an ALP to Add two 8bit numbers? (8)
13. (a)Specify the contents of the registers and the flag status as the following instructions are
executed.(8)
i. MVI A, 00H
ii. MVI B, F8H
iii. MOV C, A
iv. MOV D, B
v. HLT
(b)Write instructions to load the hexadecimal number 65H in register C and 92H in
accumulator A. Display the number 65H at PORT0 and 92H at PORT1.(8)
14. (a)Why the lower order address bus is multiplexed with data bus? How they will be de
multiplexed? (8) (b) Differentiate between maskable and non-maskable interrupts.(8)
15 .(a)Write an 8085 assembly language program using minimum number of instructions to
add the 16 bit no. in BC, DE & HL. Store the 16 bit result in DE pair. (8)
b) Explain the similarities diff b/w subtract and compare instructions in 8085? (8)
16. (a)Explain in detail the following instructions:- (i) ADC (ii) LHLD (iii) RLC (iv) DI
(b) Define & explain the term addressing modes.
UNIT V: INTERFACING AND APPLICATIONS OF
MICROPROCESSOR
Basic interfacing concepts – Interfacing of Input and output devices –
Applications of microprocessor temperature control – Stepper motor control –
Traffic light control.
UART Functionality
The UART is a universal asynchronous receiver/transmitter, which is modeled on the
real-world. Intel® 8251 peripheral interface adapter component. In the model we are
considering, the UART consists of three main blocks.
• a serial transmit block
• a serial receive block and
• a CPU Interface (I/F) block.
The serial transmit block has two buffers (FIFO) into which data is written by
the CPU I/F block. After the data is written into the buffers it is transmitted serially onto
TXD. As long as the FIFO is not full the serial transmit block sets the signal TX_RDY
high.
The serial receive block has four buffers (FIFO). The block checks for the parity
and the validity of the data frame on the RXD input and then writes correct data into its
buffers. It also sets the signal RX_RDY low if its FIFO is empty.
The CPU I/F block is responsible for reading the status register, data register and
writing data into interrupt enable register and data register. It receives control signals
from the CPU for
performing certain tasks. The different functions for the set of control signals is given in
a
tabular form below.
The XINT is asserted when there is an interrupt factor, i.e. atleast one of status
register bits is asserted, and is also not masked by a corresponding bit in the interrupt
enable register. Bits 0, 1, 2 of the interrupt enable register mask the bits 0, 1,2 of the
status register. The block diagram for the UART with its I/O ports and three main
blocks is given below in Figure1
The timing chart for the reading and writing operations, and the serial data
format, are given below in Figure 2 (2.1 through 2.3).
2. System partitioning and Component Description
The UART can be divided into several sub-components, according to different
functionality. The description of each of these components is given next section. The
block diagram depicting the more detailed component partitioning is shown in Figures 3
and 4.
The block diagram shows the different components. The D_XS, XCS, DATA,
XWR, XRD inputs are synchronized with the clock by their respective synchronizing
blocks each of which register the signals twice.
The CPU I/F registers the status register, interrupt enable register, and data
register are modeled separately. Each of these components have DXS1, X_WR/X_RD
as control signals. The transmit and receive FIFO‘s are separated from their
corresponding control blocks the transmit and receive blocks. The RXD is passed
through an IFF and the TXD goes through an OFF before being output. The data goes
through an OFF before being written onto DATA output.
2.1. The Components
XCSSynch: This component registers the XCS signal twice so as to synchronize it with
the
system clock CLK16M. The synchronized output is XCS1.
XRDSynch: This component registers the XRD signal twice so as to synchronize it with
the
system clock CLK16M. The synchronized output is X_RD.
RXDIFF: The RXD input is synchronized with the clock before being read by the
receive block.
The synchronized output is r_xd.
DATAOFF: The data from the data register/status register is registered once before
being
written onto DATA output.
Data Tristate Buffer: This component drives the data bus output. It sets it to data_bus2
when
the XRD is asserted and to high impedance otherwise.
XINTOFF: The interrupt factor signal xintd is registered once before being output as
XINT.
TXDOFF: The transmit data signal from the serial transmit block txd is synchronized
with the
clock before being output onto TXD output.
Status Register: This component represents the status of the UART. The register has
TX_RDY,
RX_RDY, PERR as its contents corresponding to bits 0, 1, 2 respectively. Its data is
used to
generate the interrupt factor xintd.
Interrupt Enable Register: The contents of this register are used to mask the interrupts
the CPU
does not want to process. Data on the data_bus1 bus (bits 2 downto 0) is written into
this register
when both DXS1 and X_WR are low. The XINT generator uses this register contents to
mask
the unwanted interrupts.
XINT Generator: This component generates the interrupt from the status register data
and the
interrupt enable register data. The equation for the interrupt signal xintd generation is as
given
below.
Transmit FIFO: The FIFO is 8-bit by 2-word. It receives control signals from the serial
transmit
block. The data on signal data_bus1 is written into its buffer when WRP is asserted. At
the same
time the write pointer is incremented. The data is read onto the stb_fifo_data signal
when the
stb_fifo_read is asserted. The stb_fifo_read_inc asserted at the same time as
stb_fifo_read,
increments the read pointer by one. The read pointer is reset when the read pointer has
reached
its maximum. The write pointer is cleared when the write pointer has reached its
maximum. The
TX_RDY is set low when the FIFO is full.
Receive FIFO: The FIFO is 8-bit by 4-word. It receives control signals from the serial
receive
block. The data received from the receive block, rec_data is written into its buffer when
srb_fifo_write is asserted. The srb_fifo_write_inc asserted at the same time as
srb_fifo_write,
increments the write pointer by one.
The data is read onto the data_bus2 signal when the XRD is asserted. The
srb_fifo_read_inc
asserted at the same time as srb_fifo_read increments the read pointer by one. The read
pointer is
reset when the read pointer has reached its maximum value. The write pointer is cleared
when
the write pointer reaches its maximum limit before further increment. The RX_RDY is
asserted
low when the FIFO is empty.
Serial Transmit Block: This component is responsible for serial transmission of data
onto TXD.
It generates the requisite control signals for reading and writing the transmit FIFO. This
component can be divided into sub-components to make modeling easier. The block
diagram for
this is given below in Figure 3.
All the sub-components have XCS1 as chip enable and XRST as reset signals. The
transmit
clock counter counts the CLK16M clock cycles and sets the stb_clk16 high after every
16 clock
cycles. This signal is used as a enable by the transmit data counter, and the transmit
block. The
transmit data counter keeps count of the number of data bits transmitted onto tx_d. The
data
count is incremented when stb_dci is asserted and cleared when stb_dcc is asserted.
These
signals are provided by the transmit control block. The parity counter counts the number
of bits
that were high in the eight bits of data being transmitted. The parity count is
incremented on
assertion of stb_pci and cleared on assertion of stb_pcc. These two signals are provided
by the
transmit block.
The transmit control block controls the whole process of transmission. It is
modeled in the form of a state machine. The state machine has three states namely:
IDLE, FIFO_READ,
DATA_TRANSMIT. Initially the machine is in the IDLE state. When DXS1 is high and
XWR is
low it jumps to FIFO_READ state. In the FIFO_READ state the data in the FIFO is read
onto its
output stb_fifo_data by setting stb_fifo_read and stb_fifo_read_inc high. It then jumps
to
DATA_TRANSMIT state. In DATA_TRANSMIT state the transmit and the stb_dci
signals are
asserted. The machine waits in this state until the signal transmitted is asserted by the
transmit
block and upon which it asserts stb_dcc and goes back to IDLE state. When XRST is
asserted it
resets all its output signals.
The transmit block has stb_clk_16 as clock and XRST as asynchronous reset. It
is enabled when transmit signal is asserted. It then transmits data serially onto the tx_d
depending upon the value of the stb_data _count. It sends the start bit when the count is
less than 1. It then transmits the data bit by bit on every stb_clk16 high until the count
reaches 9. After this it sends the parity bit corresponding to the parity count
stb_par_count. When the count becomes greater than 10 it transmits stop bit and asserts
transmitted signal.
Serial Receive Block: This component is responsible for serial receiving of data on
RXD. It
generates the requisite control signals for reading and writing the receive FIFO. This
component
can be further divided into sub-components to make modeling easier. The block
diagram for this
is given below in Figure 4.
All the sub-components have XCS1 as chip enable and XRST as reset signals. The
receive clock
counter counts the CLK16M clock cycles. It at first counts upto 8 clock cycles when the
start bit
is received. It then starts counting and sets the srb_clk16 high after every 16 clock
cycles. This
signal is used as a clock by the transmit data counter, transmit parity counter, and the
transmit
block. The transmit data counter keeps count of the number of data bits received from
rx_d. The
data count is incremented when srb_dci is asserted and cleared when srb_dcc is
asserted. These
signals are provided by the receive control block. The parity counter counts the number
of bits
that were high in the eight bits of data being recieved. The parity count is incremented
on
assertion of srb_pci and cleared on assertion of srb_pcc. These two signals are provided
by the
receive block.
The receive control block controls the whole receiving process. It is modeled in the
form of a
state machine. The state machine has four states namely: IDLE, FIFO_WRITE,
FIFO_READ,
DATA_RECEIVE. Initially the machine is in the IDLE state. In this state when the start
bit is
received on rx_d it jumps to DATA_RECEIVE state. In the DATA_RECEIVE state,
receive and
the srb_dci signals are asserted. The machine waits in this state until the signal received
is
asserted by the receive block. When received is asserted it checks for PERR and x_fre
before it
asserts srb_dcc and jumps to FIFO_WRITE state. If PERR is high or x_fre is low it
jumps to
IDLE state instead. In the FIFO_WRITE state it asserts the srb_fifo_write and
srb_fifo_write_inc
signals and then jumps to IDLE state so that it remains in the FIFO_WRITE state for
only one
clock cycle. This ensures that the data is written in only one of the buffers, as the FIFO
read and
write processes are clock sensitive.
The receive block has srb_clk_16 as clock and XRST as asynchronous reset. It is
enabled when
receive signal is asserted. It then receives data serially from rx_d depending upon the
value of
the srb_data _count. It receives data bit by bit into rec_data on every srb_clk16 high
until the
data count reaches 8. After this it receives the parity bit. When the count becomes
greater than 8
it checks for the stop bit.
The Intel 8255 (or i8255) Programmable Peripheral Interface chip is a peripheral chip
originally developed for the Intel 8085 microprocessor, and as such is a member of a
large array of such chips, known as the MCS-85 Family. This chip was later also used
with the Intel 8086 and its descendants. It was later made (cloned) by many other
manufacturers. It is made in DIP 40 and PLCC 44 pins encapsulated versions.
This chip is used to give the CPU access to programmable parallel I/O, and is similar to
other such chips like the Motorola 6520 PIA (Peripheral Interface Adapter) the MOS
Technology 6522 (Versatile Interface Adapter) and the MOS Technology CIA
(Complex Interface Adapter) all developed for the 6502 family. Other such chips are the
2655 Programmable Peripheral Interface from the Signetics 2650 family of
microprocessors, the 6820 PIO (Peripheral Input/Output) from the Motorola 6800
family, the Western Design Center WDC 65C21, an enhanced 6520, and many others.
The 8255 has 24 input/output pins in all. These are divided into three 8-bit ports. Port A
and port B can be used as 8-bit input/output ports. Port C can be used as an 8-bit
input/output port or as two 4-bit input/ouput ports or to produce handshake signals for
ports A and B.
Eight data lines (D0 - D7) are available (with an 8-bit data buffer) to read/write data into
the ports or control register under the status of the "RD" (pin 5) and WR" (pin 36),
which are active low signals for read and write operations respectively. The address
lines A1 and A0 allow to successively access any one of the ports or the control register
as listed below:
A1 A0 Function
0 0 port A
0 1 port B
1 0 port C
1 1 control register
The control signal "'CS" (pin 6) is used to enable the 8255 chip. It is an active low
signal, ie, when CS = '0, the 8255 is enabled. The RESET input (pin 35) is connected to
a system (like 8085, 8086, etc. ) reset line so that when the system is reset, all the ports
are initialised as input lines. This is done to prevent 8255 and/or any peripheral
connected to it, from being destroyed due to mismatch of ports. This is explained as
follows. Suppose an input device is connected to 8255 at port A. If from the previous
operation, port A is initialised as an output port and if 8255 is not reset before using the
current configuration, then there is a possibility of damage of either the input device
connected or 8255 or both since both 8255 and the device connected will be sending out
data.
The control register or the control logic or the command word register is an 8-bit
register used to select the modes of operation and input/output designation of the ports.
Input/Output Mode
There are three types of the input/output mode. They are as follows:
Mode 0
In this mode, the ports can be used for simple input/output operations without
handshaking. If both port A and B are initialized in mode 0, the two halves of port C can
be either used together as an additional 8-bit port, or they can be used as individual 4-bit
ports. Since the two halves of port C are independent, the may be used such that one-
half is initialized as an input port while the other half is initialized as an output port.
Mode 1
When we wish to use port A or port B for handshake (strobed) input or output operation,
we initialise that port in mode 1 (port A and port B can be initilalised to operate in
different modes,ie, for eg, port A can operate in mode 0 and port B in mode 1). Some of
the pins of port C function as handshake lines.
For port B in this mode (irrespective of whether is acting as an input port or output
port), PC0, PC1 and PC2 pins function as handshake lines.
If port A is initialised as mode 1 input port, then, PC3, PC4 and PC5 function as
handshake signals. Pins PC6 and PC7 are available for use as input/output lines.
If port A is initialised as mode 1 output port, then pins PC3, PC6 and PC7 function as
handshake signals. PC4 and PC5 are available as input/output lines.
Mode 2
Only group A can be initialised in this mode. Port A can be used for bidirectional
handshake data transfer. This means that data can be input or output on the same eight
lines (PA0 - PA7). Pins PC3 - PC7 are used as hanshake lines for port A. The remaining
pins of port C (PC0 - PC2) can be used as input/output lines if group B is initialised in
mode 0. In this mode, the 8255 may be used to extend the system bus to a slave
microprocessor or to transfer data bytes to and from a floppy disk controller.
In this mode only port C can be used (as an output port). Each line of port C (PC0 -
PC7) can be set/reset by suitably loading the command word register.no effect occurs in
input-output mode.
The figure shows the control word format in the input/output mode. This mode is
selected by making D7 = '1' .
D0, D1, D3, D4 are for lower port C, port B, upper port C and port A respectively.
When D0 or D1 or D3 or D4 are "SET", the corresponding ports act as input ports. For
eg, if D0 = D4 = '1', then lower port C and port A act as input ports. If these bits are
"RESET", then the corresponding ports act as output ports. For eg, if D1 = D3 = '0', then
port B and upper port C act as output ports.
D2 is used for mode selection for group B (Port B and Lower Port C). When D2 = '0',
mode 0 is selected and when D2 = '1', mode 1 is selected.
D5, D6 are used for mode selection for group A (Upper Port C and Port A). The
format is as follows:
D6 D5 mode
0 0 0
0 1 1
1 x 2
Example: If port B and upper port C have to be initialised as input ports and lower port
C and port A as ouput ports (all in mode 0), what is the control word?
Applying the corresponding values to the format in input/output mode, we get the
control word as "8A (hex)"
The figure shows the control word format in BSR mode. This mode is selected by
making D7='0'.
D0 is used for bit set/reset. When D0= '1', the port C bit selected (selection of a port C
bit is shown in the next point) is SET, when D0 = '0', the port C bit is RESET.
D1, D2, D3 are used to select a particular port C bit whose value may be altered using
D0 bit as mentioned above. The selection of the port C bits are done as follows:
Example: If the 5th bit (PC5) of port C has to be "SET", then what is the control word?
o 1. Since it is BSR mode, D7 = '0'.
o 2. Since D4, D5, D6 are not used, assume them to be '0'.
o 3. PC5 has to be selected, hence, D3 = '1', D2 = '0', D1 = '1'.
o 4. PC5 has to be set, hence, D0 = '1'.
Applying the above values to the format for BSR mode, we get the control word as "0B
(hex)".
The INTEL 8279 is specially developed for interfacing keyboard and display devices to
8085/8086/8088 microprocessor based system. The important features of 8279 are,
Keyboard section:
The keyboard section consists of eight return lines RL0 - RL7 that can be used to form
the columns of a keyboard matrix.
It has two additional input : shift and control/strobe. The keys are automatically
debounced.
The two operating modes of keyboard section are 2-key lockout and N-key rollover.
In the 2-key lockout mode, if two keys are pressed simultaneously, only the first key is
recognized.
In the N-key rollover mode simultaneous keys are recognized and their codes are
stored in FIFO.
The keyboard section also have an 8 x 8 FIFO (First In First Out) RAM.
The FIFO can store eight key codes in the scan keyboard mode. The status of the shift
key and control key are also stored along with key code. The 8279 generate an interrupt
signal when there is an entry in FIFO. The format of key code entry in FIFO for scan
keyboard mode is,
In sensor matrix mode the condition (i.e., open/close status) of 64 switches is stored in
FIFO RAM. If the condition of any of the switches changes then the 8279 asserts IRQ
as high to interrupt the processor.
Display section:
The display section has eight output lines divided into two groups A0-A3 and B0-B3.
The output lines can be used either as a single group of eight lines or as two groups of
four lines, in conjunction with the scan lines for a multiplexed display.
The output lines are connected to the anodes through driver transistor in case of
common cathode 7-segment LEDs.
The cathodes are connected to scan lines through driver transistors.
The display can be blanked by BD (low) line.
The display section consists of 16 x 8 display RAM. The CPU can read from or write
into any location of the display RAM.
Scan section:
The scan section has a scan counter and four scan lines, SL0 to SL3.
In decoded scan mode, the output of scan lines will be similar to a 2-to-4 decoder.
In encoded scan mode, the output of scan lines will be binary count, and so an external
decoder should be used to convert the binary count to decoded output.
The scan lines are common for keyboard and display.
The scan lines are used to form the rows of a matrix keyboard and also connected to
digit drivers of a multiplexed display, to turn ON/OFF.
The CPU interface section takes care of data transfer between 8279 and the processor.
This section has eight bidirectional data lines DB0 to DB7 for data transfer between
8279 and CPU.
It requires two internal address A =0 for selecting data buffer and A = 1 for selecting
control register of8279.
The control signals WR (low), RD (low), CS (low) and A0 are used for read/write to
8279.
It has an interrupt request line IRQ, for interrupt driven data transfer with processor.
The 8279 require an internal clock frequency of 100 kHz. This can be obtained by
dividing the input clock by an internal prescaler.
The RESET signal sets the 8279 in 16-character display with two -key lockout
keyboard modes.
The 8279 can be programmed to perform various functions through eight command
words.
To convert the digital signal to analog signal a Digital-to-Analog Converter (DAC) has
to be employed.The DAC will accept a digital (binary) input and convert to analog
voltage or current. Every DAC will have "n" input lines and an analog output. The DAC
require a reference analog voltage (Vref) or current (Iref) source. The smallest possible
analog value that can be represented by the n-bit binary code is called resolution. The
resolution of DAC with n-bit binary input is 1/2nof reference analog value. Every
analog output will be a multiple of the resolution. For example, consider an 8-bit DAC
with reference analog voltage of 5 volts. The analog values for all possible digital input
are as shown.
PIN DIGRAM & BLOCK DIAGRAM OF DAC0800
The DAC0800 is an 8-bit, high speed, current output DAC with a typical settling time
(conversion time) of 100 ns. It produces complementary current output, which can be
converted to voltage by using simple resistor load.The DAC0800 require a positive and
a negative supply voltage in the range of ± 5V to ±18V. It can be directly interfaced
with TTL, CMOS, PMOS and other logic families.For TTL input, the threshold pin
should be tied to ground (VLC = 0V). The reference voltage and the digital input will
decide the analog output current, which can be converted to a voltage by simply
connecting a resistor to output terminal or by using an op-amp I to V converter.The
DAC0800 is available as a 16-pin IC in DIP.
The pin configuration of DAC0800 is
The internal block diagram of DACO800 is,
The ADC0809 is an 8-bit successive approximation type ADC with inbuilt 8-channel
multiplexer.The ADC0809 is suitable for interface with 8086 microprocessor. The
ADC0809 is available as a 28 pin IC in DIP (Dual Inline Package). The ADC0809 has a
total unadjusted error of ±1 LSD (Least Significant Digit). The ADC0808 is also same
as ADC0809 except the error. The total unadjusted error in ADC0808 is ± 1/2 LSD. The
pin configuration of ADC0809/ADC0808 is
PIN DESCRIPTION OF ADC0809
The 8-channel multiplexer can accept eight analog inputs in the range of 0 to 5V and
allow one by one for conversion depending on the 3-bit address input. The channel
selection logic is,
A conversion process will be interrupted on receipt of new START pulse. The End-Of-
Conversion (EOC) will go low between 0 and 8 clock pulses after the positive edge of
START pulse. The ADC can be used in continuous conversion mode by tying the EOC
output to START input. In this mode an external START pulse should be applied
whenever power is switched ON.
The 256'R resistor network and the switch tree is shown in fig.
The 256R ladder network has been provided instead of conventional R/2R ladder
because of its inherent monotonic, which guarantees no missing digital codes. Also the
256R resistor network does not cause load variations on the reference voltage.The
comparator in ADC0809/ADC0808 is a chopper- stabilized comparator. It converts the
DC input signal into an AC signal, and amplifies the AC sign using high gain AC
amplifier. Then it converts AC signal to DC signal. This technique limits the drift
component of the amplifier, because the drift is a DC component and it is not
amplified/passed by the AC amp1ifier. This makes the ADC extremely insensitive to
temperature, long term drift and input offset errors.In ADC conversion process the input
analog value is quantized and each quantized analog value will have a unique binary
equivalent.
Design
A sample schematic with one master (a microcontroller) and three slave nodes (an
ADC, a DAC, and another microcontroller) with pull up resistors Rp
I²C uses only two bidirectional open-drain lines, Serial Data (SDA) and Serial Clock
(SCL), pulled up with resistors. Typical voltages used are +5 V or +3.3 V although
systems with other, higher or lower, voltages are permitted.
The I²C reference design has a 7-bit address space with 16 reserved addresses, so a
maximum of 112 nodes can communicate on the same bus. The most common I²C bus
modes are the 100 kbit/s standard mode and the 10 kbit/s low-speed mode, but clock
frequencies down to DC are also allowed. Recent revisions of I²C can host more nodes
and run faster (400 kbit/s Fast mode, 1 Mbit/s Fast mode plus or Fm+, and 3.4 Mbit/s
High Speed mode), and also support other extended features, such as 10-bit addressing.
The maximum number of nodes is obviously limited by the address space, and also by
the total bus capacitance of 400 pF, because it restricts practical communication
distances to a few meters.
Reference design
The reference design, as mentioned above, is a bus with a clock (SCL) and data (SDA)
lines with 7-bit addressing. The bus has two roles for nodes: master and slave:
Master node — node that issues the clock and addresses slaves
Slave node — node that receives the clock line and address.
The bus is a multi-master bus which means any number of master nodes can be present.
Additionally, master and slave roles may be changed between messages (after a STOP
is sent).
There are four potential modes of operation for a given bus device, although most
devices only use a single role and its two modes:
The master is initially in master transmit mode by sending a start bit followed by the 7-
bit address of the slave it wishes to communicate with, which is finally followed by a
single bit representing whether it wishes to write(0) to or read(1) from the slave.
If the slave exists on the bus then it will respond with an ACK bit (acknowledge) for
that address. The master then continues in either transmit or receive mode (according to
the read/write bit it sent), and the slave continues in its complementary mode (receive or
transmit, respectively).
The address and the data bytes are sent most significant bit first. The start bit is
indicated by a high->low transition of SDA with SCL high; the stop bit is indicated by a
low->high transition of SDA with SCL high.
If the master wishes to write to the slave then it repeatedly sends a byte with the slave
sending an ACK bit. (In this situation, the master is in master transmit mode and the
slave is in slave receive mode.)
If the master wishes to read from the slave then it repeatedly receives a byte from the
slave, the master sending an ACK bit after every byte but the last one. (In this situation,
the master is in master receive mode and the slave is in slave transmit mode.)
The master then ends transmission with a stop bit, or it may send another START bit if
it wishes to retain control of the bus for another transfer (a "combined message").
Message Protocols
I²C defines three basic types of message, each of which begins with a START and ends
with a STOP:
In a combined message, each read or write begins with a START and the slave address.
After the first START, these are also called "repeated START" bits; repeated START
bits are not preceded by STOP bits, which is how slaves know the next transfer is part
of the same message.
Any given slave will only respond to particular messages, as defined by its product
documentation.
Pure I²C systems support arbitrary message structures. SMBus is restricted to nine of
those structures, such as "read word N" and "write word N", involving a single slave.
With only a few exceptions, neither I²C nor SMBus define message semantics, such as
the meaning of data bytes in messages. Message semantics are otherwise product-
specific. Those exceptions include messages addressed to the I²C "general call" address
(0x00) or to the SMBus "Alert Response Address"; and messages involved in the
SMBus "Address Resolution Protocol" (ARP) for dynamic address allocation and
management.
In practice most slaves adopt request/response control models, where one or more bytes
following a write command are treated as a command or address. Those bytes determine
how subsequent written bytes are treated and/or how the slave responds on subsequent
reads. Most SMBus operations involve single byte commands.
One specific example is the 24c32 type EEPROM, which uses two request bytes that are
called Address High and Address Low. (Accordingly, these EEPROMs aren't usable by
pure SMBus hosts, which only support single byte commands.) These bytes are used to
address bytes within the 32 kbit (4 kB) supported by that EEPROM; the same two byte
addressing is also used by larger EEPROMs, such as 24c512 ones storing 512 kbits (64
kB).
To write to the EEPROM, a single message is used. After the START, the master sends
the chip's bus address with the direction bit clear ("write"), then sends the two byte
address of data within the EEPROM and then sends data bytes to be written starting at
that address, followed by a STOP. When writing multiple bytes, all the bytes must be in
the same 32 byte page. While it's busy saving those bytes to memory, the EEPROM
won't respond to further I2C requests. (That's another incompatibility with SMBus:
SMBus devices must always respond to their bus addresses.)
Applications
I²C is appropriate for peripherals where simplicity and low manufacturing cost are more
important than speed. Common applications of the I²C bus are:
Reading configuration data from SPD EEPROMs on SDRAM, DDR SDRAM, DDR2
SDRAM memory sticks (DIMM) and other stacked PC boards
Supporting systems management for PCI cards, through an SMBus 2.0 connection.
Accessing NVRAM chips that keep user settings.
Accessing low speed DACs.
Accessing low speed ADCs.
Changing contrast, hue, and color balance settings in monitors (Display Data
Channel).
Changing sound volume in intelligent speakers.
Controlling OLED/LCD displays, like in a cellphone.
Reading hardware monitors and diagnostic sensors, like a CPU thermostat and fan
speed.
Reading real time clocks.
Turning on and turning off the power supply of system components.
Peripherals can also be added to or removed from the I²C bus while the system is
running, which makes it ideal for applications that require hot swapping of components.
Buses like I²C became popular when computer engineers realized that much of the
manufacturing cost of an integrated circuit design results from its package size and pin
count. A smaller package also usually weighs less and consumes less power, which is
especially important in cellphones and portable computing.
Limitations
The assignment of slave addresses is one weakness of I²C. Seven bits is too few to
prevent address collisions between the many thousands of available devices, and
manufacturers rarely dedicate enough pins to configure the full slave address used on a
given board. While some devices can set multiple address bits per pin, e.g. by using a
spare internal ADC channel to sense one of eight ranges set by an external voltage
divider, usually each pin controls one address bit. Manufacturers may provide pins to
configure a few low order bits of the address and arbitrarily set the higher order bits to
some value based on the model. This limits the number of devices of that model which
may be present on the same bus to some low number, typically between two and eight.
That partially addresses the issue of address collisisons between different vendors. The
addition of ten-bit addresses to I²C hasn't really caught on yet. Neither has the complex
SMBus "ARP" scheme for dynamically assigning addresses (other than for PCI cards
with SMBus presence, for which it is required).
I²C supports a limited range of speeds. Hosts supporting the multi-megabit speeds are
rare. Support for the Fm+ one-megabit speed is more widespread, since its electronics
are simple variants of what is used at lower speeds. Many devices don't support the 400
kbit/s speed (in part because SMBus doesn't yet support it). I²C nodes implemented in
software (instead of dedicated hardware) may not even support the 100 kbit/s speed; so
the whole range defined in the specification is rarely usable. All devices must at least
partially support the highest speed used or they may spuriously detect their device
address. Devices are allowed to stretch clock cycles to suit their particular needs, which
can starve bandwidth needed by faster devices and increase latencies when talking to
other device addresses. Bus capacitance also places a limit on the transfer speed,
especially when current sources aren't used to increase signal rise times.
PART-A
In I/O mode, the 8255 ports work as programmable I/O ports, while In BSR
mode only port C (PC0-PC7) can be used to set or reset its individual port bits. Under
the IO mode of operation, further there are three modes of operation of 8255, So as to
support different types of applications, viz. mode 0, mode 1 and mode 2.
7. What are the signals used in input control signal & output control signal?
Ans: Input control signal
• STB (Strobe input)
• IBF (Input buffer full)
• INTR(Interrupt request)
Output control signal
• OBF (Output buffer full)
• ACK (Acknowledge input)
• INTR(Interrupt request)
20. What is the purpose of control word written to control register in 8255?
Ans:The control words written to control register specify an I/O function for
each I.O port. The bit D7 of the control word determines either the I/O function
of the BSR function.
25.What is an USART?
Ans:USART stands for universal synchronous/Asynchronous Receiver/Transmitter. It is
a programmable communication interface that can communicate by using either
synchronous or asynchronous serial data.
a. Keyboard section
b. Scan section
c. Display section
d. CPU interface section
PART-B
1.. Sketch and explain the interface of PPI 8255 to the 8085 microprocessor .
2.Interface4 7 segment LEDs to display as a BCD counter.
3.Sketch and explain the interface of 8279 to the 8085 microprocessor Interface 8x8 key pad
4 Draw the block diagram of 8255 and explain its working. What is Control Word?
Determine the control word for the following configuration of 8255:- 4 Port A – Output Mode
of port A – Mode 1 Port B – Output Mode of port B – Mode 0 Port C lower (pins PC0 – PC2)
– Output
5.Explain major components of 8259 with the aid of suitable diagram. .
6. Explain the command words/control words of 8251in details.16/10/8 marks
UNIVERSITY QUESTION PAPERS