CHAPTER - 1
INTRODUCTION TO MICROPROCESSORS
1
Contents
Introduction to microprocessors
General architecture of microcomputer system
Evolution of Intel microprocessors
Architectural compatibility
Hardware and software
Review of the basic number systems and conversion
between different number systems
2
INTRODUCTION
Computer system consists of:
CPU (central processing unit) which is the heart of the computer.
ALU (arithmetic-logic unit) ,Control unit ,Registers
Memory
Input / Output interfaces
The interconnections between these units are through 3 basic buses:
Address Bus: - which select memory location or I/O device for CPU.
Data Bus: - Move information b/n CPU & memory or I/O devices with size from 8
bits to 64 bits in microprocessor.
Control Bus: - generate command signal to synchronize the CPU with I/O or
memory.
carries control signals such as clock signals; interrupt signals (ready, halt etc.).
3
Hardware and Software
A computer system is divided into two categories: Hardware and Software
Hardware refers to the physical and visible components of the system such
as a monitor, CPU, keyboard, scanner and mouse,….
Software refers to a set of instructions which enable the hardware to
perform a specific set of tasks.
e.g windows 10,adobe Photoshop , google chrome and Microsoft Excel..
The software must be installed in the hardware to function properly and
similarly, the hardware must be present for the tasks to be performed.
Both are interdependent, yet they are also different from each other.
4
Introduction to microprocessors
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.
A Microprocessor is a brain of micro computer.
It is a single chip which is capable of processing data.
It controls all components of a computer like monitor, I/O device, memory devices.
It executes sequence of instructions.
It is a processor in which memory and I/O output component is connected
externally
Microprocessor Fetch, decode and execute the instruction
The microprocessor fetches those instructions from the memory, then decodes it
5
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.
6
Introduction to microprocessors
Microprocessor consists of an ALU, register , and a control unit.
control unit: controls the flow of data and instructions within the computer.
As human brain controls the body, control unit controls the computer.
Control Unit does not execute instruction by itself, i.e. does not carry out
instruction, but it directs other processing elements to execute
instruction.
It retrieves instruction from memory and this process is called fetch
instruction. After fetching instruction, it translates that instruction into
computer understandable format and sends signals to other computer
hardware units to carry out the instruction. This process (the process of
translating instruction) is called decoding.
7
Introduction to microprocessors
ALU : performs arithmetical and logical operations on the data received from
the memory or an input device.
The purpose of ALU is to execute instruction. It performs two operations:
Arithmetic operation & Logic Operation
Arithmetic operation: this includes mathematical operations like addition,
subtraction, multiplication, division, etc. If you give your computer the
instruction 2+3, this will be included in arithmetic operation and it is executed
by Arithmetic Unit.
Logical Operation: this is concerned with the comparison of data and it is called
logical operation. It includes operators like less than, greater than, equal to, less
or equal to, greater or equal to, different from, etc. e.g. if mark>80, grade is 'A'.
8
Introduction to microprocessors
Register :temporary storage location for performing instruction or
data.
• Registers are temporary storage locations inside the CPU that hold
data and addresses.
• When instruction is loaded from main memory, it is placed first in
registers to wait instruction from control unit.
• Registers are temporary storage location for data prior to execution
in ALU.
9
General Architecture of a Microcomputer System
The hardware of a microcomputer system can be divided into four
functional sections: the Input unit, Micro processing Unit,
Memory Unit, and Output Unit. See Fig. 1
10
General Architecture of a Microcomputer System
Microprocessor Unit (MPU) is the heart of a microcomputer.
A microprocessor is a general purpose processing unit built into a
single integrated circuit (IC).
The Microprocessor is the part of the microcomputer that executes
instructions of the program and processes data.
It is responsible for performing all arithmetic operations and
making the logical decisions initiated by the computer’s program.
In addition to arithmetic and logic functions, the MPU controls
overall system operation.
11
General Architecture of a Microcomputer System
Input and Output units are the means by which the MPU communicates with the
outside world.
Input unit: keyboard, mouse, scanner, etc.
Output unit: monitor, printer, etc.
Memory unit: stores both data and instructions.
Primary: is normally smaller in size and is used for temporary storage of active
information. Typically ROM, RAM.
The memory section typically contains ROM and RAM chips.
The ROM can only be read and is nonvolatile; that is, it retains its contents when
the power is turned off.
12 A ROM is typically used to store instructions and data that do not change.
General Architecture of a Microcomputer System
One can read from and write into a RAM. The RAM is volatile; that is, it does not
retain its contents ..
RAM is temporary storage i.e. the data is lost when the computer is off unlike
secondary storage. Because of this it is called volatile memory.
o Why is it volatile? It uses electric power to store data. When you write anything on
your computer, first it is stored on RAM. When you save the file, it is transferred
into secondary storage
o It is directly accessible by CPU. It is called RAM because each memory location
can be accessed randomly using memory address.
Each unit in RAM has memory address by which it can be easily
accessed/referenced.
13
General Architecture of a Microcomputer System
ROM store information permanently. They have programs built into them
at the factory and that program could not be changed or erased by the user,
but read.
It is non-volatile, read-only (not changeable). Read-only means data can't
be altered or erased but read.
ROM contain special instruction that the computer uses when it is turned
on. E.g instruction that starts the computer, instruction that displays
information on screen, etc.
Secondary: is normally larger in size and used for long-term storage of
information. Like Hard disk, Floppy, CD, etc.
14
Types of Microprocessors
Microprocessors generally is categorized in terms of the maximum
number of binary bits in the data they process – that I, their word
length.
five standard data widths have evolved for microprocessors: 4-bit,
8-bit, 16-bit, 32-bit,64-bit.
Table 1 represents Bit, Byte, and Larger units.
15
Types of Microprocessors
There are so many manufacturers of Microprocessors, but only two
companies have been produces popular microprocessors: Intel and
Motorola.
Data Bus Width: This indicates how many bits the microprocessor can handle
at once (e.g., 8 bits, 16 bits, 32 bits, 64 bits).
A wider bus allows for faster data transfer between the processor and
memory.
Table 2 lists
some of types
that belong to these
companies (families)
of microprocessors.
16
Types of Microprocessors
Note that the 8086 has data bus width of 16-bit, and it is able to
address 1Megabyte of memory.
It is important to note that 80286, 80386, 80486, and Pentium-
Pentium4 microprocessors are upward compatible with the 8086
Architecture.
This mean that 8086/8088 code will run on the 80286, 80386,
80486,and Pentium Processors, but the reverse in not true if any of
the new instructions are in use.
17
Evolution of Intel microprocessors
Depending on width of data microprocessors can process, they are of this
categories
Microprocessor is identified with word size of data.
e.g ALU can perform 4-bit data operation at a time then this type of
microprocessor is called 4-bit microprocessor
4-bit Microprocessor
4-bit microprocessor can process 4-bit data at a time.
The INTEL 4004/4040 was invented in the year 1971 by Stanley Mazor & Ted
Hoff.
The clock speed of this microprocessor is 740 KHz. The number of transistors
used in this microprocessor is 2,300 and instruction per second is 60K.
The number of pins of this microprocessor is 16.
18
Evolution of Intel microprocessors
8-bit Microprocessor
An 8-bit microprocessor can process 8-bit data at a time.
The 8008 processor was invented in the year 1972. The clock speed of
this microprocessor is 500 KHz and instruction per second is 50K
The 8080 microprocessor was invented in the year 1974. The clock speed
is 2 MHz. The number of transistors used is 60k and instruction per
second is 10 times quicker as compared with 8008 processor.
The 8085 microprocessor was invented in the year 1976. The clock speed
is 3 MHz. The number of transistors used is 6,500 and instruction per
second is 769230. The number of pins of this microprocessor is 40.
19
Evolution of Intel microprocessors
32-bit Microprocessor
The Intel 80386 microprocessor was invented in the year 1986.
The clock speed is 16 MHz to 33 MHz. The number of transistors
used is 275000.
The Intel 80486 microprocessor was invented in the year1986.
The clock speed is 16MHz to 100 MHz. The number of transistors
used is 1.2 Million transistors .
The PENTIUM microprocessor was invented in the year 1993.
The clock speed is 66 MHz.
20
Evolution of Intel microprocessors
64-bit Microprocessor
The INTEL core 2 microprocessor was invented in the year
2006. The clock speed is 1.2 GHz to 3 GHz..
The i3, i5, i7 microprocessors were invented in the years
2007, 2009, 2010 . The clock speed is 2GHz to 3.3GHz,
2.4GHz to 3.6GHz & 2.93GHz to t 3.33GHz.
21
Evolution of Intel microprocessors
22
List of Terms Used in a Microprocessor
Instruction Set − It is the set of instructions that the microprocessor can
understand.
Bandwidth − It is the number of bits processed in a single instruction.
Clock Speed − It determines the number of operations per second the
processor can perform. It is expressed in megahertz (MHz) or gigahertz
(GHz).It is also known as Clock Rate.
Word Length − It depends upon the width of internal data bus, registers,
ALU, etc. An 8-bit microprocessor can process 8-bit data at a time. The
word length ranges from 4 bits to 64 bits depending upon the type of the
microcomputer.
23
Basic number systems
Number system is the system of naming or representing
numbers.
There are various types of number systems and the most
commonly used ones are
decimal number system
binary number system
octal number system, and
hexadecimal number system.
24
Decimal number system
Base 10 Number System
The decimal number system has a base of 10 because it uses ten digits from 0 to
9. In the decimal number system, the positions successive to the left of the
decimal point represent units, tens, hundreds, thousands and so on.
Every position shows a particular power of the base (10).
Generally, the weight of each digit in a decimal number is given by:
Weight (nth digit) = nth digit * (base) (n-1)
Where n = position of the digit
Base = given base of the number system
Actually 'n' should be counted starting from left and starting with 1 and
continuing with 2, 3 etc. to use the above formula.
25
Decimal number system
But the best (shortest) way is to start with 0 instead of 1 when counting
even if the assigned numbers will not represent the real position of the
digits since there is no a 0 position.
Example: Find the weight of each digit in the following decimal
number, 789
Solution: According to the formula given, the position of the digits
will be assigned from right to left starting from 1.
Weight of (1st digit) = 1st digit * (10) (1-1) = 9 * 100 = 9 * 1 = 9
Weight of (2nd digit) = 2nd digit * (10) (2-1) = 8 * 101 = 8 * 10 = 80
Weight of (3rd digit) = 3rd digit * (10) (3-1) = 7 * 102 = 7 * 100 = 700
26
Decimal number system
If the number is a fraction decimal number, then the weight of the digits after the
decimal point will be calculated as:
Weight (nth digit) = nth digit * (base) (-n)
Where n: position of the digit after the decimal point when it is counted to the
right starting from the immediate digit after the decimal point and With the value
one(1).
Example: Find the weight of the digits after the decimal point of the following
Number: = 0.125
Solution: Weight of (1st digit) = 1st digit * (10) (-1) = 1 * 10-1 = 10-1 = 0.1
Weight of (2nd digit) = 2nd digit * (10) (-2) = 2 * 10-2 = 2 * 10-2 = 0.02
Weight of (3rd digit) = 3rd digit * (10) (-3) = 5 * 10-3 = 5 * 10-3 = 0.005
27
Binary number system
The binary number system is exactly like the decimal system except that
the base is 2 instead of 10.
We have only two symbols or digits (0 and 1) that can be used in this
number system.
Note that the largest single digit is 1 (one less than the base).
each position in a binary number represents a power of the base (2). As
such, in this system, the rightmost position in the units (20) position, the
second position from the right is the 2’s (21) position and proceeding in
this way we have 4’s (22) position, 8’s (23) position,16’s (24) position, and
so on.
Example: the decimal equivalent of the binary number 10101 is
(1x24) + (0x23) + (1x22) + (0x21) + (1x20)
16 + 0 + 4 + 0 + 1=21
(10101)2 = (21)10
28
Octal number system
In the octal number system the base is 8.
there are only 8 symbols or digits: 0,1,2,3,4,5,6, and 7
the largest single digit is 7 (one less than the base).
each position in an octal number represents a power of the base (8).
Example: the decimal equivalent of the octal number 2057 (written as 20578) is:
(2x83) + (0x82) + (5x81) + (7x80)
1024 + 0 + 40 + 7=1071
20578 = 107110
there are only 8 digits in the octal number system, so 3 bits (23 = 8) are sufficient
to represent any octal number in binary
29
Hexadecimal number system
The hexadecimal number system is one with a base of 16.
The base of 16 suggests choices of 16 single character digits or symbols.
The first 10 digits are the digits of a decimal system 0,1,2,3,4,5,6,7,8,9.
The remaining six digits are denoted by A,B,C,D,E,F representing the
decimal values 10,11,12,13,14,15 respectively.
In the hexadecimal number system, therefore, the letters A through F are
number digits. The number A has a decimal equivalent value of 10 and
the hexadecimal F has a decimal equivalent value of 15.
largest single digit is F or 15 (one less than the base).
each position in a hexadecimal system represents a power of the base
(16).
30
Hexadecimal number system
Example: the decimal equivalent of the hexadecimal number 1AF
(written as 1AF16) is:
(1x162) + (Ax161) + (Fx160)
(1x256) + (10x16) + (15x1)
256 + 160 +15=431
1AF16 = 43110
there are only 16 digits in the hexadecimal number system, so 4
bits (24 = 16) are sufficient to represent any hexadecimal number in
binary.
31
Conversion between different number systems
Conversion of number system is changing of a given number’s number
system in to another number system which we call it as target number
system.
Conversion of decimal numbers into any other number systems
A decimal number might have two parts: integral and fractional parts.
So, for converting a number from the decimal number system into any
other number system, separate it into integer part (left side of the decimal
point) and fraction part (right side of the decimal point).
For the integer part, the following procedure is followed:
32
Conversion of decimal numbers into any other number systems
For the integer part, the following procedure is followed:
1. Divide the integral part of the decimal number by the base of the
target number system and note the remainder.
2. Divide the quotient of the previous division by the base of the
target number system and note the remainder.
3. Repeat step 2 till the quotient becomes 0/less than the base.
4. Arrange the remainders in an order starting with the last division.
5. The number obtained in step 4 is the integer part of the desired
number.
33
Conversion of decimal numbers into any other number systems
For the fraction part, the following procedures are followed:
1. Multiply the fraction part by the base of the system and note the integer
part of the result.
2. Multiply the fraction part of the previous result by the base of the
system and note the integer part of the result.
3. Repeat step 2 till the fraction part of the result is zero or till the required
accuracy (number of digits after the decimal point) is achieved.
4. Arrange the integer parts in the order starting with first multiplication.
5. The number obtained in step 4 is the fraction part of the desired number.
34
Conversion of decimal numbers into any other number systems
Example 1: Convert the decimal number 93 into:
A. binary numbers=(1011101)2
B. octal numbers=(135)8
C. hexadecimal number=(5D)16
Example 2: Convert 0.125 from decimal to binary
Solution: - 0.125 x 2 = 0.250 here the integer part is 0
0.250 x 2 = 0.50 here the integer part is 0
0.50 x 2 = 1.0 here the integer part is 1
Since the fraction part is 0, no further multiplication is required. So, an
equivalent binary number becomes 0.001
35
That is, (0.125)10 = (0.001)2
Conversion of other systems into decimal number system
A number in the non- decimal number system is converted into a
decimal number by multiplying each digit in the number by its place
value and adding all the products.
Example 1: Convert the hexadecimal number FA2E into a decimal
number
Solution: FA2E = (F x 163) + (A x 162) + (2 x 161) + (E x 160)
= (15 x 4096) + (10 x 256) + (2 x 16) + (14 x 1)
= 61440 + 2560 + 32 + 14
= 64046
Therefore, FA2E16 = 6404610
36
Conversion of other systems into decimal number system
Example 2: Convert the octal number 765 into a decimal number
Solution: 765 = (7 x 82) + (6 x 81) + (5 x 80)
= (7 x 64) + (6 x 8) + (5 x 1)
= 448 + 48 + 5
= 501
Therefore, (765)8 = (501)10
Example 3: Convert the binary number 101.01 into a decimal
number
Solution:101.01 = (1 x 22) + (0 x 21) + (1 x 20) + (0 x 2-1) + (1 x 2-2)
= 4 + 0 + 1 + 0 + 0.25
= 5.25
Therefore, (101.01)2 = (5.25)10
37
Converting from a base other than 10 to a base other than 10
The following two steps are used to convert a number from a base
other than 10 to a base other than 10.
Step 1: Convert the original number to a decimal number (base
10).
Step 2: Convert the decimal number so obtained to the new base.
Example 1. 5456 = (?)4
Solution:
Step 1: Convert from base 6 to base 10
545 = (5 x 62) + (4 x 61) + (5 x 60)
= (5 x 36) + (4 x 6) + (5 x 1)
= 180 + 24 + 5
= 209
38 Therefore, 5456 = 20910
Converting from a base other than 10 to a base other than 10
Step 2: Convert 20910 to base 4
209 / 4, Q = 52, R = 1
52 / 4, Q = 13, R = 0
13 / 4, Q = 3, R = 1
3 / 4, Q = 0, R = 3
Hence, 20910 = 31014
So, 5456 = 20910 = 31014
Thus, 5456 = 31014
39
END