Microprocessor: Engr. Mark Angelo Y. Santos, ECE, ECT

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 59

Microprocessor

Engr. Mark Angelo y. Santos, ECE, ECT


• The important features of
8085 microprocessor.
8085 Microprocessor
• The important features of 8085 μp are :
1. It is a 8 bit microprocessor.
2. It has 16 bit address bus and hence can address up to
216 = 65536 bytes (64KB) memory locations through
A0-A15.
3. The first 8 lines of address bus and 8 lines of data bus
are multiplexed AD0 – AD7.
4. Data bus is a group of 8 lines D0 – D7.
5. It supports 5 hardware interrupt and 8 software
interrupt.
8085 Microprocessor

6. A 16 bit program counter (PC)


7. A 16 bit stack pointer (SP)
8. Six 8-bit general purpose register
arranged in pairs: BC,DE, HL.
9. It requires a signal +5V power supply
10.Maximum Clock Frequency is 3MHz and
Minimum Clock Frequency is 500kHz
Pin Diagram of 8085
X1 & X 2

Pin 1 and Pin 2 (Input)


 These are also called
Crystal Input Pins.
Crystal input pins have only one function. That is
to provide stable clock pulses to
the digital circuit.

 8085can generate clock


signals internally.

 To generateclock signals internally,


8085 requires external inputs from
X1 and X2.
RESET IN and RESET
OUT
Pin 36 (Input) and Pin 3 (Output)
 RESET IN:

◦ It is used to reset the


microprocessor.

◦ It is active low signal.

◦ When the signal on this pin is low for


at least 3 clocking cycles, it forces
the microprocessor to reset itself.
RESET IN and RESET
OUT
Pin 36 (Input) and Pin 3 (Output)
 Resetting
the
microprocessor means:

◦ Clearing the PC and IR.


◦ Disabling all interrupts
(except TRAP).
◦ Disabling the SOD pin.
◦ All the buses (data,
address, control) are tri-
stated.
◦ Gives HIGH output to
RESET OUT pin.
RESET IN and RESET
OUT
Pin 36 (Input) and Pin 3 (Output)
 RESET OUT:

◦ It is used to reset the


peripheral devices and
other ICs on the circuit.

◦ It is an output signal.

◦ It is an active high signal.

◦ The output on this pin goes


high whenever RESET IN is
given low signal.

◦ The output remains high as


long as RESET IN is kept low.
SID and SOD
Pin 4 (Input) and Pin 5 (Output)
SID (Serial Input
Data):

o It takes 1 bit input from


serial port of 8085.

o Stores the bit at the 8th


position (MSB) of the
Accumulator.

o RIM (Read Interrupt


Mask) instruction is
used to transfer the bit.
SID and SOD
Pin 4 (Input) and Pin 5 (Output)
 SOD(Serial Output
Data):

o It takes 1 bit from


Accumulator to serial port
of 8085.

o Takes the bit from the 8th


position (MSB) of the
Accumulator.

o SIM (Set Interrupt


Mask) instruction is
used to transfer the bit.
 Interrupt: Interrupt Pins
• It means interrupting the normal execution of the
microprocessor.

• When microprocessor receives interrupt signal,


it discontinues whatever it was executing.

• It starts executing new program indicated by the


interrupt signal.

• Interrupt signals are generated by external peripheral


devices.

• After execution of the new program, microprocessor


goes back to the previous program.
Sequence of Steps Whenever There
is an Interrupt
 Microprocessor completes execution of current
instruction of the program.

 PC contents are stored in stack.

 PC is loaded with address of the new program.

 Afterexecuting the new program, the


microprocessor returns back to the previous
program.

 It goes to the previous program by reading the


top value of stack.
Architecture of Microprocessor
The microprocessor is a single IC package in which several useful
functions are integrated and fabricated on a single silicon
semiconductor chip. Its architecture consists of a central processing
unit, memory modules, a system bus, and an input/output unit.
Microprocessor Configuration
• The microprocessor is said to be a "computer built around ICs."  Mainframes, minis, and microprocessors all
share the same principles of operation and vary only in their scale, speed and architecture.  The minimum
components required to build a computer are the CPU, memory and I/O devices as shown in Figure below

All these components of a microprocessor are fabricated of a single IC.  Such ICs are coupled to
build a computer.  Three minimum IC’s that are needed to make up a microprocessor are the CPU,
memory, and peripheral IC. 
CPU (Central Processing Unit)
•   The CPU forms the nucleus of any computer by executing
instructions.  Microprocessors are grouped into 4-bit, 8-bit, 16-bit,
and 32-bit microprocessors according to the length of bits they can
handle at a time.  A 4-bit microprocessor can handle four binary digits
in a single instance of calculation, but as many as eight digits in two
instances and 16 in four instances.
  The microprocessor is also known as a "MPU (microprocessing
unit)", "microprocessor",  or simply "processor."
Input device (Input)

• A data input device. The keyboard and mouse of a PC, for example,
are data input devices. With a built-in controller, switches and
sensors are input devices.
• These input devices cannot be directly connected to a CPU, but they
must be attached to the CPU by way of a "peripheral IC," containing
connection circuitry. Depending on the kind of input device to be
connected to the CPU, an appropriate peripheral IC is used.
Output device (Output)

• A data output device. The display and printer of a PC, for example,
are data output devices. With a built-in controller, display LEDs,
motors, heaters and so on are output devices. Like input devices,
output devices are attached to a CPU by way of a "peripheral IC."
Depending on the kind of output device to be connected to the CPU,
an appropriate peripheral IC is used.
• Input devices and output devices are collectively called "peripherals."
Microprocessor Special Purpose Designs
Microprocessor Special Purpose Designs

• Microprocessors are available in different special-purpose designs which include the


following.
• A DSP (digital signal processor) is one kind of specialized processor, used for signal
processing.
• GPUs (Graphics processing units) are mainly designed for image rendering in real-
time. Other types of specialized processors are used for machine vision as well as
processing the video.
• In embedded systems, microcontrollers incorporate a microprocessor using
peripheral devices
• SOCs (Systems on-chip) frequently incorporate one or more
microcontroller/microprocessor cores using additional components like radio
modems. These modems are applicable in tablets, smartphones, etc.
Considerations of Speed & Power
Considerations of Speed & Power

• The microprocessor selection is mainly done for differing applications depending


upon the size of a word. If the word size is long, then it allows every clock cycle of
a microprocessor to perform more computation, however, to communicate with
physically larger IC dies through higher standby as well as operating power
utilization, 4-bit, 8-bit, or 12-bit processors are extensively used into
microcontrollers embedded systems.
• Once a system expects to handle high-volumes of data otherwise need a more
supple user interface, then 16-bit 32-bit/64-bit processors are utilized. For SoC or
microcontroller applications that need very low power electrons, 8-bit/16-bit
microprocessors may be selected instead of 32-bit
• When 32-bit arithmetic runs on an 8-bit processor could finish up with huge
power, because the processor must perform software through several instructions.
Computer architecture
DIAGRAM OF A COMPUTER
SYSTEM
A computer is a programmable machine that receives input, stores and manipulates
data//information, and provides output in a useful format.

Diagram Of A Computer System 25


BLOCK DIAGRAM OF A BASIC
COMPUTER SYSTEM
Basic computer system consist of a Central processing unit (CPU),
memory (RAM and ROM), input/output (I/O) unit.

26
PARTS OF COMPUTER SYSTEM

Buses
• A bus is a high-speed internal connection. Buses are used to send control
signals and data between the processor and other components.
Three types of bus are used.
• Address bus - carries memory addresses from the processor to other
components such as primary storage and input/output devices. The address
bus is unidirectional.
• Data bus - carries the data between the processor and other components. The
data bus is bidirectional.
• Control bus - carries control signals from the processor to other components.
The control bus also carries the clock's pulses. The control bus is
unidirectional.
PARTS OF COMPUTER SYSTEM
• Read-only memory, or ROM, is a type of computer storage containing
non-volatile, permanent data that, normally, can only be read, not
written to. ROM contains the programming that allows a computer to
start up or regenerate each time it is turned on.
• RAM (random access memory) is a computer's short-term memory,
where the data that the processor is currently using is stored. Your
computer can access RAM memory much faster than data on a hard
disk, SSD, or other long-term storage device, which is why RAM
capacity is critical for system performance.
PARTS OF COMPUTER SYSTEM
• Input-Output Interface is used as an method which helps in
transferring of information between the internal storage devices i.e.
memory and the external peripheral device .
• A peripheral device is that which provide input and output for the
computer, it is also called Input-Output devices.
BLOCK DIAGRAM OF A BASIC
COMPUTER SYSTEM
Basic computer system consist of a Central processing unit (CPU),
memory (RAM and ROM), input/output (I/O) unit.

30
Basic component of microcomputer
1. CPU - Central Processing Unit
• 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.

Pentium D dual core processors

31
Common CPU components

The central processing unit (CPU) consists of six main components:


• control unit (CU)
• arithmetic logic unit (ALU)
• registers
• cache
• buses
• clock
• All the components work together to allow processing and system
control.
Block Diagram of CPU
Control unit
• The CU provides several functions:
• it fetches, decodes and executes instructions
• it issues control signals that control hardware components within the
CPU
• it transfers data and instructions around the system

• The control unit is a component of a computer's central processing unit


that directs the operation of the processor. A CU typically uses a binary
decoder to convert coded instructions into timing and control signals that
direct the operation of the other units.
Arithmetic logic unit
• Arithmetic logic unit (ALU)
• The ALU has two main functions:
• it performs arithmetic and logical operations (decisions).
• it acts as a gateway between primary storage and secondary storage -
data transferred between them passes through the ALU.

• In computing, an arithmetic logic unit is a combinational digital circuit


that performs arithmetic and bitwise operations on integer binary
numbers.
Registers
Registers are small amounts of high-speed memory contained within the CPU. They are used by the
processor to store small amounts of data that are needed during processing, such as:
• the address of the next instruction to be executed
• the current instruction being decoded
• the results of calculations

Different processors have different numbers of registers for different purposes. Most have some, or all, of
the following:
• program counter (PC)
• memory address register (MAR)
• memory data register (MDR)
• current instruction register (CIR)
• accumulator (ACC)
Definition
• A processor register or simply register is a quickly accessible location
available to a computer's processor. Registers usually consist of a
small amount of fast storage, although some registers have specific
hardware functions, and may be read-only or write-only.
• 
CACHE
• Cache is a small amount of high-speed random access memory
(RAM) built directly within the processor. It is used to temporarily
hold data and instructions that the processor is likely to reuse. This
allows for faster processing, as the processor does not have to wait
for the data and instructions to be fetched from the RAM.
CLOCK
• The CPU contains a clock which, along with the CU, is used to
coordinate all of the computer's components. The clock sends out a
regular electrical pulse which synchronises (keeps in time) all the
components.
• The frequency of the pulses is known as clock speed. Clock speed is
measured in hertz (Hz). The greater the speed, the more instructions
can be performed in any given moment of time.
BUSES
A bus is a high-speed internal connection. Buses are used to send control
signals and data between the processor and other components.
• Three types of bus are used.
• Address bus - carries memory addresses from the processor to other
components such as primary storage and input/output devices. The address
bus is unidirectional.
• Data bus - carries the data between the processor and other components. The
data bus is bidirectional.
• Control bus - carries control signals from the processor to other components.
The control bus also carries the clock's pulses. The control bus is
unidirectional.
2. Memory
• physical devices used to store data or programs.
• Computer main memory comes in two principal varieties:
random-access memory (RAM) and read-only memory
(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 general, the contents of RAM are erased when the power
to the computer is turned off, but ROM retains its data
indefinitely.
• In a PC, the ROM contains a specialized program called the
BIOS that orchestrates loading the computer's
operating system from the hard disk drive into RAM
whenever the computer is turned on or reset.
41
3. I/O Unit

• Input/output (I/O), refers to the communication between an


information processing system (such as a computer), 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
• On a typical personal computer, 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.
Computer networking is another form of I/O.

42
DATA SIZE
Nibble 4 bit

Byte 8 bit

Word 16 bit

Long word 32 bit

43
Internal structure and basic operation of
microprocessor

Address bus
ALU Register
Section
Data bus

Control and timing


section Control bus

Block diagram of a microprocessor


44
Arithmetic and logic unit (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 logical operations (AND,
OR), including the addition operation.

45
Internal structure of ALU

2 bits of ALU 4 bits of ALU

46
Control unit
• 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.

47
Register sets
• The register section/array consists completely of
circuitry 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 register" or a
"32-bit register".
48
Register in motorola 68000
microprocessor
31 16 15 8 7 0
D0
D1
D2
D3 DATA REGISTERS
D4
D5
D6
D7
31 16 15 8 7 0
A0
A1
A2
A3 ADDRESS REGISTERS
A4
A5
A6
A7

USER STACK POINTER


A7 STACK POINTER
SUPERVISOR STACK POINTER

PC PROGRAM CONTER
15 8 7 0
SYSTEM BYTE USER VYTE SR STATUS REGISTER 49
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.

50
Condition code register (CCR) = Flags
• an 8 bit register used to store the status of CPU,
such as carry, zero, overflow and half carry.

51
Flag Name Description

Z Zero flag Indicates that the result of a mathematical or logical operation was zero.

Indicates that the result of an operation produced an answer greater than the
C Carry flag number of available bits. (This flag may also be set before a mathematical
operation as an extra operand to certain instructions, e.g. "add with carry".)

X Extend flag Masks the XIRQ request when set. It is set by the hardware and cleared by the
software as well is set by unmaskable XIRQ.

Indicates that the result of a mathematical operation is negative. In some


processors, the N and S flags have different meanings: the S flag indicates
N Negative/ Sign flag
whether a subtraction or addition has taken place, whereas the N flag
indicates whether the last operation result is positive or negative.

Indicates that the result of an operation has overflowed according to the


V Overflow Flag CPU's word representation, similar to the carry flag but for signed operations.

Interrupts can be enabled or disabled by respectively setting or clearing this


I interrupts flag. Modifying this flag may be restricted to programs executing in supervisor
mode

52
Program counter (PC)
• 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 tos (top of stack)
• to store address of next instruction to be
executed.
• count the number of instructions.

53
Stack pointer (SP)
• The stack is configured as a data structure that
grows downward from high memory to low
memory.
• At any given time, the SP holds the 16-bit
address of the next free location in the stack.
• The stack acts like any other stack when there is
a subroutine call or on an interrupt. ie. pushing
the return address on a jump, and retrieving it
after the operation is complete to come back to
its original location.

54
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.

55
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.

56
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.

57
Micro processor clock
• Also called clock rate, the speed at which a
microprocessor executes instructions.
Every computer contains an internal clock
that regulates the rate at which
instructions are executed and
synchronizes all the various computer
components.

58
Examples of micro processor

• Intel 8086
• Motorola 6800
• Zilog Z80

• The three microprocessors mentioned above


paved way to the modern microprocessors that
we have today and

59

You might also like