You are on page 1of 60

4BCS504: MICROPROCESSORS

Module–I: Introduction

Introduction to microprocessors and computer:


microprocessor, computer, assembly language, number
systems
Microprocessor - Overview
• Microprocessor is a controlling unit of a micro-computer, fabricated on a
small chip capable of performing ALU (Arithmetic Logical Unit) operations
and communicating with the other devices connected to it.
• Microprocessor consists of an ALU, register array, and a control unit.
• ALU performs arithmetical and logical operations on the data received
from the memory or an input device.
• Register array consists of registers identified by letters like B, C, D, E, H, L
and accumulator.
• The control unit controls the flow of data and instructions within the
computer.
How does a Microprocessor Work?

• 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.
Features of a Microprocessor
• Cost-effective − The microprocessor chips are available at low prices and results its
low cost.

• Size − The microprocessor is of small size chip, hence is portable.

• Low Power Consumption − Microprocessors are manufactured by using metaloxide


semiconductor technology, which has low power consumption.

• Versatility − The microprocessors are versatile as we can use the same chip in a
number of applications by configuring the software program.

• Reliability − The failure rate of an IC in microprocessors is very low, hence it is


reliable.
Classification
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.
Example of RISC Processor

• Power PC: 601, 604, 615, 620


• DEC Alpha: 210642, 211066, 21068, 21164
• MIPS: TS (R10000) RISC Processor
• PA-RISC: HP 7100LC
CISC Processor
• 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
Special Processors
• These are the processors which are designed for some special purposes. Few of the
special processors are briefly discussed −

Coprocessor

• A coprocessor is a specially designed microprocessor, which can handle its particular


function many times faster than the ordinary microprocessor.

• Example

Some Intel math-coprocessors are


8087-used with 8086
80287-used with 80286
80387-used with 80386
Introduction to microprocessors and computer:
microprocessor
What is a Microprocessor?
• The word comes from the combination micro and processor. – Processor means a device that
processes instructions.
• In this context processor means a device that processes numbers, specifically binary numbers,
0’s and 1’s.
• To process means to manipulate. It is a general term that describes all manipulation.
• Again in this content, it means to perform certain operations on the numbers that depend on
the microprocessor’s design.
Definition

• The microprocessor is a programmable device that takes in numbers, performs


on them arithmetic or logical operations according to the program stored in
memory and then produces other numbers as a result.
• Microcomputer : a computer with a processor as its CPU. Includes memory, I/O etc.

• Microprocessor : silicon chip which includes ALU, register circuits & control circuits

• Microcontroller : silicon chip which includes microprocessor, memory & I/O in a single
package.
Evolution of Microprocessors

• We can categorize the microprocessor according to the generations or according to the


size of the microprocessor:

First Generation (4 - bit Microprocessors) 05 – 0000 0101

• Introduced in the year 1971-1972 by Intel Corporation.

• It was a processor on a single chip. It could perform simple arithmetic and logical
operations such as addition, subtraction, Boolean OR and Boolean AND.

• It had a control unit capable of performing control functions like fetching an instruction
from storage memory, decoding it, and then generating control pulses to execute it.
Second Generation (8 - bit Microprocessor)
• The second generation microprocessors were introduced in 1973 again by Intel.

• It was a first 8 - bit microprocessor which could perform arithmetic and logic
operations on 8-bit words.

• It was Intel 8008, and another improved version was Intel 8088.

Third Generation (16 - bit Microprocessor)


• The third generation microprocessors, introduced in 1978 were represented by Intel's
8086, Zilog Z800 and 80286, which were 16 - bit processors with a performance like
minicomputers.
Fourth Generation (32 - bit Microprocessors)
• Several different companies introduced the 32-bit microprocessors, but the most
popular one is the Intel 80386.
Fifth Generation (64 - bit Microprocessors)
• From 1995 to now we are in the fifth generation.
• After 80856, Intel came out with a new processor namely Pentium processor
followed by Pentium Pro CPU, which allows multiple CPUs in a single system
to achieve multiprocessing.
• Other improved 64-bit processors are Celeron, Dual, Quad, Octa Core
processors.
Important Intel Microprocessors

Microproces Year of Memory addressing


Word Length Pins Clock
sor Invention Capacity

4004 1971 4-bit 1 KB 16 750 KHz

8085 1976 8-bit 64 KB 40 3-6 MHz

8086 1978 16-bit 1MB 40 5-8 MHz

80286 1982 16-bit 16MB real, 4 GB 68 6-12.5 MHz


virtual

80386 1985 32-bit 4GB real, 64TB 132 14X14 PGA 20-33 MHz
virtual

PGA - Pin Grid Array


Year of Memory addressing
Microprocessor Word Length Pins Clock
Invention Capacity

80486 1989 32-bit 4GB real, 64TB 168 17X17 PGA 25-100 MHz
virtual
Pentium 1993 32-bit 4GB real,32-bit 237 PGA 60-200
address,64-bit data
bus

Pentium Pro 1995 32-bit 64GB real, 36-bit 387 PGA 150-200 MHz
address bus
Pentium II 1997 32-bit - - 233-400 MHz
Pentium III 1999 32-bit 64GB 370 PGA 600-1.3 MHz
Pentium 4 2000 32-bit 64GB 423 PGA 600-1.3 GHz
Itanium 2001 64-bit 64 address lines 423 PGA 733 MHz-1.3 GHz
Basic Terms used in Microprocessor

• Instruction Set - The group of commands that the microprocessor can understand is
called Instruction set. It is an interface between hardware and software.

• Bus - Set of conductors intended to transmit data, address or control information to


different elements in a microprocessor. A microprocessor will have three types of
buses, i.e., data bus, address bus, and control bus.

• IPC (Instructions Per Cycle) - It is a measure of how many instructions a CPU is


capable of executing in a single clock.

• Data Types - The microprocessor supports multiple data type formats like binary,
ASCII, signed and unsigned numbers.
• Clock Speed - It is the number of operations per second the processor can
perform. It can be expressed in megahertz (MHz) or gigahertz (GHz). It is also
called the Clock Rate.

• Bandwidth - The number of bits processed in a single instruction is called


Bandwidth.

• Word Length - The number of bits the processor can process at a time is called
the word length of the processor. 8-bit Microprocessor may process 8 -bit data at a
time. The range of word length is from 4 bits to 64 bits depending upon the type
of the microcomputer.
Working of Microprocessor

• The microprocessor follows a sequence to execute the instruction: Fetch, Decode,


and then Execute.

• Initially, the instructions are stored in the storage memory of the computer in
sequential order.

• The microprocessor fetches those instructions from the stored area (memory),
then decodes it and executes those instructions till STOP instruction is met.

• Then, it sends the result in binary form to the output port. Between these
processes, the register stores the temporary data and ALU (Arithmetic and Logic
Unit) performs the computing functions.
Features of Microprocessor

• Low Cost - Due to integrated circuit technology microprocessors are available at


very low cost. It will reduce the cost of a computer system.

• High Speed - Due to the technology involved in it, the microprocessor can work
at very high speed. It can execute millions of instructions per second.

• Small Size - A microprocessor is fabricated in a very less footprint due to very


large scale and ultra large scale integration technology. Because of this, the size of
the computer system is reduced.

• Versatile - The same chip can be used for several applications, therefore,
microprocessors are versatile.
• Low Power Consumption - Microprocessors are using metal oxide
semiconductor technology, which consumes less power.

• Less Heat Generation - Microprocessors uses semiconductor technology which


will not emit much heat as compared to vacuum tube devices.

• Reliable - Since microprocessors use semiconductor technology, therefore, the


failure rate is very less. Hence it is very reliable.

• Portable - Due to the small size and low power consumption microprocessors are
portable.
Types of Microprocessors

Vector Processors

• A vector processor is designed for vector computations. A vector is an array of


operands of the same type. Consider the following vectors:
• Vector A (a1, a2, a3, ......., an)
• Vector B (b1, b2, b3,......., bn)
• Vector C = Vector A + Vector B
• = C(c1, c2, c3, .......,cn), where c1 = a1+ b1, c2 = a2 + b2, .....,Cn= an + bn.

• A vector processor adds all the elements of vector A and Vector B using a single vector
instruction with hardware approach.
Examples of vector processors are:
• DEC's VAX 9000,
• IBM 390/VF,
• CRAY Research Y-MP family,
• Hitachi's S-810/20, etc
Array Processors or SIMD Processors

• An array processor contains multiple numbers of ALUs. Each ALU is provided with the
local memory.

• The ALU together with the local memory is called a Processing Element (PE).

• An array processor is a SIMD (Single Instruction Multiple Data) processor.

• Thus using a single instruction, the same operation can be performed on an array of
data which makes it suitable for vector computations.
Basic Microprocessor Unit
Memory
• Memory stores information such as instructions and data in binary format (0 and 1). It
provides this information to the microprocessor whenever it is needed.

• Usually, there is a memory “sub-system” in a microprocessor-based system.

• This sub-system includes:


– The registers inside the microprocessor
– Read Only Memory (ROM) used to store information that does not change.
– Random Access Memory (RAM) (also known as Read/Write Memory).

• used to store information supplied by the user. Such as programs and data.
Execution

To execute a program:

• the user enters its instructions in binary format into the memory.

• The microprocessor then reads these instructions and whatever data is


needed from memory, executes the instructions and places the results
either in memory or produces it on an output device.
The three cycle instruction execution model

• To execute a program, the microprocessor “reads” each instruction from memory,


“interprets” it, then “executes” it.

• To use the right names for the cycles: – The microprocessor fetches each
instruction, – decodes it, – Then executes it. This sequence is continued until all
instructions are performed/
Machine Language
• The number of bits that form the “word” of a microprocessor is fixed for that
particular processor. – These bits define a maximum number of combinations.

• For example an 8-bit microprocessor can have at most 28 = 256 different


combinations.

• However, in most microprocessors, not all of these combinations are used.

• Certain patterns are chosen and assigned specific meanings.

• Each of these patterns forms an instruction for the microprocessor.

• The complete set of patterns makes up the microprocessor’s machine language


The 8085 Machine Language:

• The 8085 (from Intel) is an 8-bit microprocessor.

• The 8085 uses a total of 246 bit patterns to form its instruction set.

• These 246 patterns represent only 74 instructions. • The reason for the difference is
that some (actually most) instructions have multiple different formats.

• Because it is very difficult to enter the bit patterns correctly, they are usually entered
in hexadecimal instead of binary.

• For example, the combination 0011 1100 which translates into “increment the number
in the register called the accumulator”, is usually entered as 3C.
Assembly Language
• Entering the instructions using hexadecimal is quite easier than entering the binary
combinations. – However, it still is difficult to understand what a program written in
hexadecimal does

• So, each company defines a symbolic code for the instructions.

• These codes are called “mnemonics”. – The mnemonic for each instruction is usually a group of
letters that suggest the operation performed.

• Using the same example from before, – 00111100 translates to 3C in hexadecimal (OPCODE) –
Its mnemonic is: “INR A”. – INR stands for “increment register” and A is short for accumulator.

• Another example is: 1000 0000, – Which translates to 80 in hexadecimal. – Its mnemonic is
“ADD B”. – “Add register B to the accumulator and keep the result in the accumulator”.
• Another example is: 1000 0000, – Which translates to 80 in hexadecimal. – Its mnemonic
is “ADD B”. – “Add register B to the accumulator and keep the result in the
accumulator”.

• It is important to remember that a machine language and its associated assembly language
are completely machine dependent.

• In other words, they are not transferable from one microprocessor to a different one.

• For example, Motorolla has an 8-bit microprocessor called the 6800. – The 8085 machine
language is very different from that of the 6800.

• So is the assembly language. A program written for the 8085 cannot be executed on the
6800 and vice versa
How does assembly language get translated into machine language?

There are two ways

• “Hand Assembly”: The programmer translates each assembly language instruction


into its equivalent hexadecimal code (machine language).

• Then the hexadecimal code is entered into memory.

• The other possibility is a program called an “assembler”, which does the


translation automatically.
Number Systems
• The use of the microprocessor requires a working knowledge of binary, decimal, and hexadecimal
numbering systems.

Digits

• Before numbers are converted from one number base to another, the digits of a number system must
be under

• A decimal (base 10) number is constructed with 10 digits: 0 through 9.stood.

• The first digit in any numbering system is always zero.

• For example, a base 8 (octal) number contains 8 digits: 0 through 7; a base 2 (binary) number
contains 2 digits: 0 and 1.

• If the base of a number exceeds 10, the additional digits use the letters of the alphabet, beginning
with an A.
• For example, a base 12 number contains 10 digits: 0 through 9, followed by A for
10 and B for 11.

• Note that a base 10 number does contain a 10 digit, just as a base 8 number does
not contain an 8 digit.

• The most common numbering systems used with computers are decimal, binary,
and hexadecimal (base 16).
Decimal Number System
• Decimal number system is a base 10 number system having 10
digits from 0 to 9.

• This means that any numerical quantity can be represented using


these 10 digits.

• Decimal number system is also a positional value system.

• This means that the value of digits will depend on its position.
Example
• Say we have three numbers – 734, 971 and 207. The value of 7 in all three
numbers is different−

• In 734, value of 7 is 7 hundreds or 700 or 7 × 100 or 7 × 10 2

• In 971, value of 7 is 7 tens or 70 or 7 × 10 or 7 × 101

• In 207, value 0f 7 is 7 units or 7 or 7 × 1 or 7 × 100

• The weightage of each position can be represented as follows −


Binary Number System
• The easiest way to vary instructions through electric signals is two-state
system – on and off.

• On is represented as 1 and off as 0, though 0 is not actually no signal but


signal at a lower voltage.

• The number system having just these two digits – 0 and 1 – is called binary
number system.
• Each binary digit is also called a bit.

• Binary number system is also positional value system, where each digit
has a value expressed in powers of 2, as displayed here.

• In any binary number, the rightmost digit is called least significant bit


(LSB) and leftmost digit is called most significant bit (MSB).
• And decimal equivalent of this number is sum of product of
each digit with its positional value.

• 110102 = 1×24 + 1×23 + 0×22 + 1×21 + 0×20

• = 16 + 8 + 0 + 2 + 0

• = 2610

• 0100 1010 = 7410

• 128 64 32 16 8 4 2 1
• 1 byte (B) = 8 bits
• 1 Kilobytes (KB) = 1024 bytes
• 1 Megabyte (MB) = 1024 KB
• 1 Gigabyte (GB) = 1024 MB
• 1 Terabyte (TB) = 1024 GB
• 1 Exabyte (EB) = 1024 TB
• 1 Zettabyte = 1024 EB
• 1 Yottabyte (YB) = 1024 ZB
Octal Number System

• Octal number system has eight digits – 0, 1, 2, 3, 4, 5, 6 and


7.

• Octal number system is also a positional value system with


where each digit has its value expressed in powers of 8, as
shown here −
• Decimal equivalent of any octal number is sum of product of
each digit with its positional value.

• 726.238 = 7×82 + 2×81 + 6×80. 2x8-1+3x8-2

• = 448 + 16 + 6

• = 47010
Hexadecimal Number System
• Hexadecimal number system has 16 symbols – 0 to 9 and A
to F where A is equal to 10, B is equal to 11 and so on till F.

• Hexadecimal number system is also a positional value system


with where each digit has its value expressed in powers of 16,
as shown here −
• 27FB16 = 2×163 + 7×162 + 15×161 + 10×160
• = 8192 + 1792 + 240 +10
• = 1023410
ASCII
• Besides numerical data, computer must be able to handle alphabets, punctuation marks,
mathematical operators, special symbols, etc. that form the complete character set of
English language.

• The complete set of characters or symbols are called alphanumeric codes. The complete
alphanumeric code typically includes −
• 26 upper case letters
• 26 lower case letters
• 10 digits
• 7 punctuation marks
• 20 to 40 special characters
• Now a computer understands only numeric values, whatever
the number system used.
• So all characters must have a numeric equivalent called the
alphanumeric code.
• The most widely used alphanumeric code is American Standard
Code for Information Interchange (ASCII).
• ASCII is a 7-bit code that has 128 (27) possible codes.
ISCII
• ISCII stands for Indian Script Code for Information
Interchange.
• IISCII was developed to support Indian languages on computer.
• Language supported by IISCI include Devanagari, Tamil,
Bangla, Gujarati, Gurmukhi, Tamil, Telugu, etc.
• IISCI is mostly used by government departments and before it
could catch on, a new universal encoding standard
called Unicode was introduced.
Unicode
• Unicode is an international coding system designed to be used with
different language scripts.

• Each character or symbol is assigned a unique numeric value, largely


within the framework of ASCII.

• Earlier, each script had its own encoding system, which could conflict with
each other.

• In contrast, this is what Unicode officially aims to do − Unicode provides a


unique number for every character, no matter what the platform, no matter
what the program, no matter what the language.
Decimal to Binary

4310 = 1010112
Decimal to Octal

47310 = 7318
Decimal to Hexadecimal

42310 = 1A716

You might also like