Quaid -E- Awam University of Engineering, Science and
Technology Nawabshah
#2
MICROPROCESSOR AND INTERFACING
Department of Computer Systems Engineering
INTRODUCTION TO MICROPROCESSOR
Basic computer
Address bus
ROM RAM I/O I/O
CPU interface devices
Data bus Control
bus
CPU
CPU
The portion of a computer system that carries
out the instructions of a computer program
The primary element carrying out the
computer's functions. It is the unit that reads
and executes program instructions.
The data in the instruction tells the processor
what to do.
Memory
physical devices used to store data or programs.
Computer main memory comes in two types: (RAM) and (ROM).
RAM can be read and written to anytime the CPU commands it,
but ROM is pre-loaded with data and software that never changes,
so the CPU can only read from it.
ROM is typically used to store the computer's initial start-up
instructions.
In a PC, the ROM contains a specialized program called the BIOS
used for loading the computer's operating system from the hard
disk drive into RAM whenever the computer is turned on or reset.
Memory representation
1 bit = 0 or 1
1 Byte (B) = 8 bits
1 Kilobyte (KB) = 210 = 1024 bytes
1 Megabyte (MB) = 220 = 1024KB
1 Gigabyte (GB) = 230 = 1024 MB = 1024 *1024 KB
1 Terabyte (TB) = 240= 1024 GB = 1024 * 1024 *1024 KB
Cache Memory
Cache memory is a very high speed memory which can
speed up CPU.
It acts as a buffer between the CPU and main memory.
It is used to hold those parts of data and program which
are most frequently used by CPU.
The parts of data and programs are transferred from disk
to cache memory by operating system, from where CPU
can access them..
Cache Memory
Advantages
Cache memory is faster than main memory.
It consumes less access time as compared to main
memory.
It stores the program that can be executed within a
short period of time.
It stores data for temporary use. Disadvantages
Cache memory has limited capacity.
It is very expensive.
Disadvantages
Cache memory has limited capacity.
It is very expensive.
Memory accessing methods
Random Access Memory : The primary storage is
referred to as random access memory (RAM)
because it is possible to randomly select and use any
location of the memory directly store and retrieve
data.
It takes same time to any address of the memory as
the first address.
It is also called read/write memory.
The storage of data and instructions inside the
primary storage is temporary.
It disappears from RAM as soon as the power to the
computer is switched off.
The memories, which lose their content on failure of
power supply, are known as volatile memories.
Memory accessing methods
Serial Access Memory Sequential access means the
system must search the storage device from the
beginning of the memory address until it finds the
required piece of data. Memory device which
supports such access is called a Sequential Access
Memory or Serial Access Memory. Magnetic tape is
an example of serial access memory.
Direct access memory refers to condition in which a
system can go directly to the information that the
user wants. Memory device which supports such
access is called a Direct Access Memory
Secondary Memory
Non-volatile memory - Data is not lost when power is cut off.
Reusable - The data stays in the secondary storage on permanent
basis until it is not overwritten or deleted by the user.
Reliable - Data in secondary storage is safe because of high physical
stability of secondary storage device.
Convenience - With the help of a computer software, authorized
people can locate and access the data quickly.
Capacity - Secondary storage can store large volumes of data in sets of
multiple disks.
Cost - It is much lesser expensive to store data on a tape or disk than
primary memory
Input-Output
Input/output (I/O), refers to the communication between an
information processing system and the outside world
possibly a human, or another information processing system.
Inputs are the signals or data received by the system, and
outputs are the signals or data sent from it.
Devices that provide input or output to the computer are
called peripherals.
A peripherals include input devices like the keyboard and
mouse, and output devices such as the display and printer.
Hard disk drives, floppy disk drives and optical disc drives
serve as both input and output devices.
Input devices
1 Keyboard
2. Mouse
3. Joystick
4. Digitizing Tablet
5. Touch Sensitive Screen
6. Light Pen
7. Space Mouse
8. Digital Stills Camera
9. Magnetic Ink Character
10. Optical Mark Reader (OMR)
Output devices
1 Printing: Plotter, Printer
2. Sound : Speakers
3. Visual : Monitor
Data size
Nibble 4 bit
Byte 8 bit
Word 16 bit
Long word 32 bit
Basic operations
Address bus
ALU Register
Section
Data bus
Control and timing
section Control bus
ALU
The component that performs the arithmetic and
logical operations.
The most important components in a microprocessor,
and is typically the part of the processor that is
designed first.
Able to perform the basic arithmetic and logical
operations (AND, OR).
Control Unit
Generates signals on data bus, address bus and
control bus within microprocessor to carry out
the instruction, which has been decoded.
The circuitry that controls the flow of information
through the processor, and coordinates the
activities of the other units within it.
In a way, it is the "brain within the brain", as it
controls what happens inside the processor, which
in turn controls the rest of the PC.
On a regular processor, the control unit performs
the tasks of fetching, decoding, managing
execution and then storing results.
Registers
The register are used to temporarily store data or
program codes until they are sent to the ALU or
to the control section or to memory.
The number of registers are different for any
particular CPU and the more register a CPU have
will result in easier programming tasks.
Registers are normally measured by the number
of bits they can hold, for example, an 8-bit, 16-bit
and 32-bit register.
Registers
General purpose
BCDEHL
Special purpose
Program counter
Accumulator
Stack pointer
Status register
V
N
C
Z
MAR
MDR
Instruction Register
Registers
Accumulator
A register in which intermediate
arithmetic and logic results are
stored.
example for accumulator use is
summing a list of numbers.
The accumulator is initially
set to zero, then each
number in turn is added to
the value in the
accumulator.
Only when all numbers have
been added is the result
held in the accumulator
written to main memory or
to another, non-
accumulator, CPU register.
Program Counter
A 16 bit register, used to store the
next address of the operation code
to be fetched by the CPU.
Not much use in programming, but
as an indicator to user only.
Purpose of PC in a Microprocessor
to store address of (top of stack)
to store address of next
instruction to be executed.
count the number of
instructions.
Address and Data bus
Data bus
The data bus is 'bi-directional'
Data or instruction codes from memory or
input/output are transferred into the
microprocessor.
The result of an operation or computation
is sent out from the microprocessor to the
memory or input/output.
Depending on the particular microprocessor,
the data bus can handle 8 bit or 16 bit data
Address bus
The address bus is 'unidirectional', over which the
microprocessor sends an address code to the
memory or input/output.
The size (width) of the address bus is specified by
the number of bits it can handle.
The more bits there are in the address bus, the more
memory locations a microprocessor can access.
A 16 bit address bus is capable of addressing 65,536
(64K) addresses.
Control bus
The control bus is used by the microprocessor to
send out or receive timing and control signals in
order to coordinate and regulate its operation and
to communicate with other devices, i.e. memory or
input/output.
Allah Hafiz