MICROPROCESSORS
MICROPROCESSORS
INTRODUCTION
On a personal computer, the CPU (the control unit, arithmetic/logic unit and the inside
memory) is usually contained on a single chip and sometimes is called a microprocessor. It
is often identified by its model name or model number. From the technological viewpoint, a
microprocessor is a VLSI (Very Large Scale Integration) single-chip implementation of a
complete processing unit. Microprocessors are capable of accepting coded instructions for
execution in 16-, 32- or even 64-bit word formats, that is in groups of bits, bytes or
characters, considered as an entity, and capable of being stored in one memory location.
Working of a microprocessor.
The microprocessor follows a sequence: Fetch, Decode, and then Execute. Initially, the
instructions are stored in the memory in a sequential order. The microprocessor fetches those
instructions from the memory, then decodes it and executes those instructions till STOP
instruction is reached. Later, it sends the result in binary to the output port. Between these
processes, the register stores the temporarily data and ALU performs the computing
functions.
a). Description of Microprocessor
The brain or engine of the PC is the processor (sometimes called microprocessor), or central
processing unit (CPU). The CPU performs the system’s calculating and processing. A
microprocessor is an integrated circuit that holds most of the works of a computer. It can
fetch an instruction, process it and delivered an output. When there is program memory,
RAM, and other support circuitry on the chip, this is a micro-controller. Depending on how
much data can be processed at once, this can be a 4, 8, 16, 32 (and more) bit processor.
The processor is usually the most expensive component in the system, costing up to four or
more times greater than the motherboard it plugs into. Intel is generally credited with creating
the first microprocessor in 1971 with the introduction of a chip called the 4004. Today, Intel
still has control over the processor market, at least for PC systems. This means that all PC-
compatible systems use either Intel processors or Intel-compatible processors from a handful
of competitors (such as AMD or Cyrix).
Integrated circuits are miniature complex circuits consisting of semiconductor devices, mainly
diodes and transistors, interconnected with various passive elements. All these elements are
formed upon or within a semiconductor, substrate called a die. The circuit configuration so
formed is called a chip, the terms “chip” and “die” being often considered
synonymous.
Most microprocessors are based on the principle of store program concept. In store-program
concept, programs or instructions are sequentially stored in the memory locations that are to
be executed. To do any task using a microprocessor, it is to be programmed by the user. So
the programmer must have idea about its internal resources, features and supported
instructions. Each microprocessor has a set of instructions, a list which is provided by the
microprocessor manufacturer. The instruction set of a microprocessor is provided in two
forms: binary machine code and mnemonics.
Microprocessor communicates and operates in binary numbers 0 and 1. The set of instructions
in the form of binary patterns is called a machine language and it is difficult for us to
understand. Therefore, the binary patterns are given abbreviated names, called mnemonics,
which forms the assembly language. The conversion of assembly-level language into binary
machine-level language is done by using an application called assembler.
The historical development of the microprocessors can document increases in clock speed
(the speed at which a processor executes instructions) and number of transistors in chips.
Since 1982, Intel has been the leading manufacturer of processors. They used a model
number to identify the various chips (Intel 8088, 80286, 80386, 80486).
Later, they decided to identify their microprocessors with names: Pentium® processors,
Celeron TM processors (less expensive PCs) and XeonTM processors (workstations,
servers). Pentium has been developed to be available with clock frequencies of up to 155
MHz and it uses a speedy version of CISC (Complex Instruction Set Computer) technology
and a 64-bit internal data bus. Users of multimedia applications should obtain an Intel
processor equipped with MMXTM technology, in which a set of instructions is built in the
processor so it can manipulate and process multimedia data more efficiently.
An alternative to the Intel-style microprocessor is the Motorola microprocessor, which is in
Apple Macintosh and Power Macintosh systems. The RISC (Reduced Instruction Set
Computer) processor used in Apple’s PowerPC introduced a new architecture that increased
the speed of the processor because it had been designed to understand a relatively small
number of basic instructions.
The Alpha microprocessor, which was developed by Digital Equipment Corporation, is used
primarily in workstations and high-end servers. Current models of the Alpha chip run at clock
speeds from 300 to 600 MHz.
i. RISC Processor
RISC stands for Reduced Instruction Set Computer. It is designed to reduce the execution
time by simplifying the instruction set of the computer. Using RISC processors, each
instruction requires only one clock cycle to execute results in uniform execution time.
This reduces the efficiency as there are more lines of code, hence more RAM is needed to
store the instructions. The compiler also has to work more to convert high-level language
instructions into machine code.
Some of the RISC processors are:
Power PC: 601, 604, 615, 620
DEC Alpha: 210642, 211066, 21068, 21164
MIPS: TS (R10000) RISC Processor
PA-RISC: HP 7100LC
Characteristics of RISC
The major characteristics of a RISC processor are as follows:
It consists of simple instructions.
It supports various data-type formats.
It utilizes simple addressing modes and fixed length instructions for pipelining.
It supports register to use in any context.
One cycle execution time.
“LOAD” and “STORE” instructions are used to access the memory location.
It consists of larger number of registers.
It consists of less number of transistors.
CISC stands for Complex Instruction Set Computer. It is designed to minimize the number
of instructions per program, ignoring the number of cycles per instruction. The emphasis is on
building complex instructions directly into the hardware.
The compiler has to do very little work to translate a high-level language into assembly level
language/machine code because the length of the code is relatively short, so very little RAM
is required to store the instructions.
Some of the CISC Processors are:
IBM 370/168
VAX 11/780
Intel 80486
Architecture of CISC
Its architecture is designed to decrease the memory cost because more storage is needed in
larger programs resulting in higher memory cost. To resolve this, the number of instructions
per program can be reduced by embedding the number of operations in a single instruction.
Characteristics of CISC
Variety of addressing modes.
Larger number of instructions
Variable length of instruction formats.
Several cycles may be required to execute one instruction.
Instruction-decoding logic is complex.
One instruction is required to support multiple addressing modes.
iii. Special compressors
A coprocessor is a special processor chip or circuit board that assists the processor in
performing specific tasks. Users running engineering, scientific, or graphic applications, for
instance, will notice a dramatic increase in speed applications that take advantage of a
floating-point coprocessor (sometimes called math or numeric coprocessors).
When a coprocessor is not connected in the system and the functions of the coprocessor is
done by the CPU by writing coprocessor instructions from a predetermined location in the
form of a software routine and invoked by interrupt, it is known as ‘coprocessor trap’. There
are three fields in a coprocessor instruction—these are code, address, and op code.
The code field distinguishes between the coprocessor and CPU instructions. The address field
indicates the address of a particular coprocessor. This is required when several coprocessors
are used in the system. The op code field indicates the type of operation to be executed by the
processor.
Input/Output Processor
It is a specially designed microprocessor having a local memory of its own, which is used to
control I/O devices with minimum CPU involvement.
For example:
DMA (direct Memory Access) controller
Keyboard/mouse controller
Graphic display controller
SCSI port controller
2. Transputers: This is 32-bit microprocessors with a memory and direct links for
connection to other transputer units cooperating in a network system.
4. Versatility: The microprocessors are versatile as we can use the same chip in a number of
applications by configuring the software program.
Microprocessor programming languages can typically be divided into three main types: machine
language, assembly language, and high-level language. A machine language program consists of
either binary or hexadecimal op-codes. Programming a microcomputer with either one is
relatively difficult, because one must deal only with numbers.
The architecture and micro-programs of a microprocessor determine all its instructions. These
instructions are called the microprocessor's instruction set. Programs in assembly and high-level
languages are represented by instructions that use English-language-type statements.
Machine language is the program representation as the microcontroller understands it. It is not
easy for humans to read. Assembly language is a human-readable form of machine language
which makes it much easier for us to deal with. Each assembly language statement corresponds
to one machine language statement (not counting macros).
An assembly/machine language program is fast and small. This is because you are in complete
charge of what goes into the program.
Programming a microprocessor, understands only binary 0s and 1s. Programs containing only
binary 0s and 1s are said to be in "machine language". However humans have difficulty
understanding machine language. If we express the binary 0s and 1s using mnemonics and
hexadecimal encoding, it becomes somewhat easier for humans to understand. This encoding
results in what is called "assembly language". However, since a microprocessor understands
only binary, the assembly code must be converted into binary code before it is stored or
processed by microprocessor.
Assembly language, two to four letter mnemonic words are used in place of the
actual hex or binary code for describing program steps. For example, the
instruction 7B for the Intel 8080 would be “ MOV A,E” in assembly language.
The mnemonics, of course, are useless to the microprocessor, which can only
understand binary codes, but it is an expedient way for programmers to manage the
writing of their programs on paper or text editor (word processor).
Note;
In order to make programming easier to understand, many "high level" languages have
been developed. These languages are closer to human language and so the code is easier to
understand.
Programming languages that are very easy for humans to understand and program with,
like Python, are called "higher" than languages that are less easy for humans to
understand, like C.
The higher the language, the lower it's performance. Any programming language higher
than assembly language hides the underlying binary code and microprocessor architecture
to such an extent that its useless to use for learning computer architecture. So in this book,
we'll use only assembly language and machine language.
Today's multi-core 64-bit microprocessors have an extremely complex architecture.
INTERFACING A MICRO PROCESSOR
a. I/O interfacing
b. MEMORY INTERFACING
When executing any instruction, the address of memory location or an I/O device is sent out
by the microprocessor. The corresponding memory chip or I/O device is selected by a
decoding circuit. Memory requires some signals to read from and write to registers and
microprocessor transmits some signals for reading or writing data.
The interfacing process includes matching the memory requirements with the microprocessor
signals. Therefore, the interfacing circuit should be designed in such a way that it matches the
memory signal requirements with the microprocessor's signals.
1. Microprocessor 8085 can access 64Kbytes memory since address bus is 16-bit. But it is not
always necessary to use full 64Kbytes address space. The total memory size depends upon the
application.
2. Generally EPROM (or EPROMs) is used as a program memory and RAM (or RAMs) as a
Data memory. When both, EPROM and RAM are used, the total address space 64Kbytes is
shared by them.
3. The capacity of program memory and data memory depends on the application.
4. It is not always necessary to select 1 EPROM and 1 RAM. We can have multiple EPROMs
and multiple RAMs as per the requirement of application.
5. We can place EPROM/RAM anywhere in full 64 Kbytes address space. But program memory
(EPROM) should be located from address 0000H since reset address of 8085 microprocessor
is 0000H.
6. It is not always necessary to locate EPROM and RAM in consecutive memory For example :
If the mapping of EPROM is from 0000H to OFFFH, it is not must to locate RAM from
1000H. We can locate it anywhere between 1000H and FFFFH. Where to locate memory
component totally depends on the application.
Note
The memory interfacing requires to :
Select the chip
Identify the register
Enable the appropriate buffer.
Microprocessor system includes memory devices and I/O devices. It is important to note that
microprocessor can communicate (read/write) with only one device at a time, since the data,
address and control buses are common for all the devices. In order to communicate with memory
or I/O devices, it is necessary to decode the address from the microprocessor. Due to this each
device (memory or I/O) can be accessed independently. The following section describes common
address decoding techniques.