Wa0010.
Wa0010.
OVERVIEW OF MICROPROCESSORS
A microcomputer is primarily suited, because of its very low cost and very small size, to
dedicated applications. On the same grounds, the mainframe computer is as a rule suitable as
a general purpose computer. Mini computer finds applications in both areas.
A computer, large or small, can be represented functionally (in a simplified form) by the block
diagram in Figure. 1.1. As shown, it comprises of three basic parts or sub-systems:
Figure 1.1 Block Digram of Microcomputer
It performs the necessary arithmetic and logic operations and controls the timing and general
operation of the complete system.
Input devices are used for feeding data into the CPU, examples of these devices are toggle
switches, analog-to-digital converters, paper tape readers, card readers, keyboards, disk etc.
The output devices are used for delivering the results of computations to the outside world;
examples are light emitting diodes, cathode ray tube (CRT) displays, digital-to-analog
converters, card and paper-tape punches, character printers, plotters, communication lines etc.
The inputoutput subsystem thus allows the computer to usefully communicate with the outside
world. Input-output devices are also called as peripherals.
(c) Memory
It stores both the instructions to be executed (i.e., the program) and the data involved. It
usually consists of both RAMs (random-access memories) and ROMS (read-only memories).
A microprocessor is an integrated circuit designed to function as the CPU of a
microcomputer.
The microprocessor or CPU reads each instruction from the memory, decodes it and executes
it. It processes the data as required in the instructions. The processing is in the form of
arithmetic and logical operations. The data is retrieved from memory or taken from an input
device and the result of processing is stored in the memory or delivered to an appropriate output
device, all as per the instructions.
To perform all these functions, the µP (microprocessor) incorporates various functional
units in an appropriate manner. Such an internal structure or organizational structure of µP,
which determines how it operates, is known as its architecture. A typical microprocessor
architecture is shown in Figure 1.2. The various functional units are as follows:
1.4.1 Busses
Figure 1.2 shows busses interconnecting various blocks. These busses allow exchange of words
between the blocks. A bus has a wire or line for each bit and thus allows exchange of all bits
of a word in parallel. The processing of bits in the µP is also in parallel. The busses can thus
be viewed as data highways. The width of a bus is the number of signal lines that constitute the
bus.
The figure shows for simplicity three busses for distinct functions. Over the address bus,
the µP transmits the address of that I/O device or memory locations which it desires to access.
This address is received by all the devices connected to the processor, but only the device which
has been addressed responds. The data bus is used by the µP to send and receive data to and
from different devices (I/O and memory) including instructions stored in memory. Obviously
the address bus is unidirectional and the data bus is bi-directional. The control bus is used for
transmitting and receiving control signals between the µP and various devices in the system.
1.4.2 Arithmetic-Logic Unit (ALU)
The arithmetic-logic unit is a combinational network that performs arithmetic and logical
operations on the data.
A number of registers are normally included in the microprocessor. These are used for
temporary storage of data, instructions and addresses during execution of a program. Those in
the Intel 8085 microprocessor are typical and are described below:
This is an 8-bit register used in various arithmetic and logical operations. Out of the two
operands to be operated upon, one comes from accumulator (Acc), whilst the other one may be
in another internal register or may be brought in by the data bus from the main memory. Upon
completion of the arithmetic/logical operation, the result is placed in the accumulator (replacing
the earlier operand). Because of the later function, this register is also called as result register.
There are six general purpose 8-bit registers that can be used by the programmer for a variety
of purposes. These registers, labelled as B, C, D, E, H and L, can be used individually (e.g.,
when operation on 8-bit data is desired) or in pairs (e.g., when a 16-bit address is to be stored).
Only B-C, D-E and H-L pairs are allowed.
This 8-bit register stores the next instruction to be executed. At the proper time this stored
word (instruction) is fed to an instruction decoder which decodes it and supplied appropriate
signals to the control unit. When the execution has been accomplished the new word in the
instruction register is processed.
This is a 16-bit register which holds the address of the next instruction that has to be fetched
from the main memory and loaded into the instruction register. The program controlling the
operation is stored in the main memory and instructions are retrieved from this memory
normally in order. Therefore, normally the address contained in the PC is incremented after
each instruction is fetched. However, certain classes of instruction can modify the PC so that
the programmer can provide for branching away from the normal program flow. Examples are
instructions in the “jump” and ‘call subroutine’ groups.
A status register consisting of a few flip-flops, called as condition flags (in 8085 the number of
flags is five) is used to provide indication of certain conditions that arise during arithmetic and
logical operations. These are:
Several other registers are incorporated in the µP for its internal operation. They cannot be
accessed by the programmer and hence do not concern much a µP user.
It decodes each instruction and under the supervision of a clock controls the external and
internal units ensuring correct logical operation of the system.
Semiconductor memories are required in a microcomputer for storing information which may
comprise of (a) the data to be used for computation, (b) instructions and
(c) computational results. A program starts as a set of instructions on a paper, then this is
transferred to a set of cards with the instructions punched in code on them. These instructions
also can be transferred to magnetic tape, paper tape or directly into semiconductor memory
which is the eventual storage space for a program. The semiconductor memory chips are
connected to the µP through the address bus, data bus and control bus. (This is also the way
that I/O devices are connected to the µP). See Figure 1.3.
1.5.1 Memory Classes
(a) Random Access Memory (RAM) or Read/Write Memory (RWM) There is provision
in RAMs (RWMs) for writing information into the memory and reading it
when the microcomputer is in operation. It is, therefore, used to store information which
changes or may change during the operation of the system, viz. data for calculations
and results
of calculations. It is also used to store the programs which are to be changed frequently.
Semiconductor RAM is a volatile memory.
A RAM can be of static or dynamic type. Dynamic RAMs have higher packing densities,
are faster and consume less power in the quiescent state. However, because of external
refreshing circuitry requirement, the dynamic RAMs are profitable only in large sizes.
(b) Read-Only Memory (ROM)
The ROM functions as a memory array whose contents once programmed, are permanently
fixed and can not be altered by the µP while the system is operating. It is non-volatile.
ROMs exist in many forms.
(iv) Erasable Programmable ROM (EPROM) : Like EAROM, this type of memory can
also be erased and reprogrammed. However, erasing is by exposing the memory chips to
high intensity ultravoilet light of a wavelength close to 2537 Å. It has the same
application filed as the EAROM.
Basically there are two semiconductor technologies, namely, bipolar and MOS unipolar.
Mask ROMs and PROMs are available in both types whereas EAROMs and EPROMs are
made with MOS technology only. In general, bipolar devices (including memories) are
faster and have higher drive capabilities. On the other hand, MOS devices consume less
space and power and are cheaper. Therefore, MOS memories are preferred where speed is
not a critical factor.
1.6.1 Functions
When one or more I/O devices (peripherals) are to be connected to a µP, an interface
network for each device, called peripheral interface, is required. The interface incorporate
commonly the following four functions:
(a) Buffering : Which is necessary to take care of incompatibility between the µP and the
peripheral.
(b) Address Decoding : Which is required to select one of the several peripherals connected
in the system.
(c) Command Decoding : Which is required for peripherals that perform actions other
than data transfers.
(d) Timing and Control : All the above functions require timing and control.
1.6.2 Data Transfer
Data exchange or transfers which occur between a peripheral device and the µC fall into
one ofthe following two broad categories:
A software routine residing in memory requests the peripheral device for data transfer to or
from the µP. Generally, the data is transferred to or from the accumulator though in some µPs,
others internal registers may also participate in the transfer.
Programmed data transfers are generally used when a small amount of data is transferred
with relatively slow I/O devices, e.g., A/D and D/A converters, peripheral multiplier, peripheral
floating point arithmetic unit etc. In these cases, usually one word of data is transferred at a
time.
In this mode, the data transfer is controlled by the peripheral device. The µP is forced to hold
on by an I/O device until the data transfer between the device and the memory is complete.
Since the data control transfer is controlled entirely by hardware, the interface is more complex
than that required for a programmed data transfer. DMA transfer is used when a large block of
data is to be transferred, for example, for transferring data from peripheral mass storage devices
like the floppy disk and high-speed card reader.
Extensive hardware (IC chips) is now available for designing custom interfaces. Included in
this are multiplexer, and demultiplexers, line drivers and receivers, level translators and buffers
a stable and monostable multivibrators, latches, gates, shift registers, and so on.
Then there are more sophisticated interfaces-the programmable inter-faces, whose functions
may be altered by an instruction from the mP. These interfaces can be of general purpose type
or special purpose (dedicated function) type.
The foregoing was a brief account of the µC hardware and now follows a concise picture of
the
µC software. A sequence of instructions designed to perform a particular task in a computer is
known as the program and a set of programs written for a computer-based system is called
software for that system.