0% found this document useful (0 votes)
15 views14 pages

Unit 1 Part 1 High

This document provides an introduction to microprocessors, specifically focusing on the 8085 microprocessor, its architecture, operations, and interfacing with memory and input/output devices. It details the components of a microcomputer system, the functions of the microprocessor, and the various operations it performs, including memory read/write and peripheral interactions. Additionally, it outlines the features and internal architecture of the 8085 microprocessor, including its registers, buses, and flag statuses.

Uploaded by

kpopper230
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views14 pages

Unit 1 Part 1 High

This document provides an introduction to microprocessors, specifically focusing on the 8085 microprocessor, its architecture, operations, and interfacing with memory and input/output devices. It details the components of a microcomputer system, the functions of the microprocessor, and the various operations it performs, including memory read/write and peripheral interactions. Additionally, it outlines the features and internal architecture of the 8085 microprocessor, including its registers, buses, and flag statuses.

Uploaded by

kpopper230
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor

UNIT
Introduction to Microprocessor

SYLLABUS
Introduction to Microprocessor: Microprocessor architecture and its operations, Memory, Input
& output devices, the 8085 MPU- architecture, Pins and signals, Timing Diagrams, Logic devices for
interfacing, Memory interfacing, Interfacing output displays, Interfacing input devices, Memory
mapped I/O.

1.1 Introduction to Microprocessor:


The 8085 Microprocessor is an 8-bit microprocessor with an 80-instruction set, capable of
interfacing with various peripherals and memory. It was introduced by Intel in 1976 and played
a significant role in the early development of personal computers and embedded systems. It
succeeded the 8080 microprocessor and was one of the earliest microprocessors widely used in
various applications. The 8085 typically operates at a clock speed of 3 MHz, although some
variations and implementations may have different clock speeds. It can access up to 64KB of
memory, making it suitable for a variety of applications. Memory interfacing is a crucial aspect of
working with the 8085.

The 8085 microprocessor is typically programmed using assembly language, which provides low-
level control over its operations. Programmers write code in assembly language and then
assemble it into machine code for execution. It has historical significance in the world of
computing and served as a stepping stone for the development of more advanced
microprocessors and microcontrollers.

1.1.1 Microcomputer:

Figure 1.1: Microcomputer


Microcomputer system consists of four components:
1. Microprocessor (The microprocessor is the heart of microcomputer.)
2. Memory
3. Input and
4. Output
Page | 1
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor

The microcomputer is a programmable digital device, designed with registers, flip-flops and
timing elements. It is designed for general-purpose computing tasks and can be used for various
applications.

1.1.2. Microprocessor:
A microprocessor is a specific component within a microcomputer, and it serves as the central
processing unit (CPU) of the system.

Fig. 1.2: Block diagram of Microprocessor.

• The microprocessor mainly contains (CPU)


i. The Arithmetic & Logic unit (ALU)
ii. The control unit and
iii. General-purpose registers.
It does not have built-in RAM, ROM, I/O ports etc. on the chip.
• The microprocessors are commonly referred to as general-purpose microprocessor.
Examples:
Intel: 8086, 80286, 80386, 80486, Pentium etc.
Motorola: 68000, 68010, 68020, 68030 etc.

1.1.3. Operations performed by Microprocessor:


The Operations performed by Microprocessor are
1. Microprocessor-initiated operations
2. Internal operations
3. Peripheral operations or externally initiated operations

1. Microprocessor initiated operations:


The Microprocessor unit (MPU) performs primarily four operations:
i. Memory Read: Read data or Instructions from memory.
ii. Memory write: Writes data or instructions into memory.
iii. I/O Read: Accept data from input devices.
iv. I/O write: Sends data to output devices.

2. Internal operations or 8085 Microprocessor internal data operation:


The internal data operations in 8085 microprocessor are
• Store 8-bit data.
• Perform arithmetic and logical operations.
• Test for conditions.
• Sequence the execution of instructions.
• Store data temporarily during the execution in the defined R/W memory locations called
the stack.

Page | 2
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor

3. Peripherals or Externally Initiated operations:


The external devices or signals can initiate the following operations using the 8085
Microprocessor Pins: Reset, Interrupt, Ready and Hold.

Reset IN: When the reset pin is activated by an external key, all the internal operations are
suspended and the program counter is cleared i.e. PC = 0000 H. Now, the program execution
will begin from the address 0000 H.

Interrupt: The microprocessor can be interrupted from the execution of instructions and
asked to execute some other instructions called an Interrupt Service Routine (ISR). The
microprocessor resumes it operation after completing the Interrupt service routine.

Ready: It is used by the microprocessor to sense whether a peripheral is ready to transfer data
or not.
If Ready = 1, the peripheral is ready.
If Ready = 0, the microprocessor waits till it goes high.

Hold: When the HOLD pin is activated by an external signal, the microprocessor relinquishes
control of buses and allows the external peripheral to use them. For example: The HOLD signal
is used in Direct Memory Access (DMA) data transfer.

1.1.4. 8085 Microprocessor Bus organization:

Figure 1.3: The 8085-bus structure

The 8085 microprocessor performs operation using three sets of communication lines called
buses:

1 The Address : The 8085 microprocessor uses a 16-bit address bus to access
bus memory locations. This provides a maximum addressable memory
space of 64 KB (kilobytes). This address bus is used for memory
addressing, allowing the microprocessor to fetch. The 8085 MPU
with its 16-bit address lines is capable of addressing 216 = 65.536
memory location (64 Kb) instructions and data from memory and
to write data to memory.

2 The data bus : The 8085 microprocessor has an 8-bit bi-directional data bus. Data
bus can transfer data in 8-bit chunks or one byte between the
microprocessor and memory, input/output (I/O) devices, and
other components.
3 The control bus : • The control bus is comprised of various single lines that carry
synchronization signals. The control bus is not a group of lines
like Address bus or data bus, but individual lines that provide a
pulse to indicate an MPU operation.

Page | 3
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor

• The control bus in the Intel 8085 microprocessor is a set of


signals that are used to control various operations within the
microprocessor. These control signals coordinate actions such
as memory read and write operations, input/output (I/O)
operations, and the sequencing of instructions.

Figure 1.4: Memory Read operation

• To communicate with a memory, for example, to read an instruction from a memory


location, the MPU unit places the 16-bit address on the address bus s shown in figure 1.
The address on the bus is decoded by an external logic circuit.
• The MPU unit sends a pulse called Memory Read as the control signal. The pulse activates
the memory chip, and the contents of the memory location i.e. 8-bit data are placed on the
data bus and brought inside the microprocessor.

1.2. Features of 8085 Microprocessor:


The features of 8085 Microprocessor are:
• 8-bit general purpose µp
• Capable of addressing 64 k of memory
• It has 40 pins
• Requires +5 v power supply
• Can operate with 3 MHz clock
• The clock cycle is 200 ns
• It has 80 basic instructions

Page | 4
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor

1.2.1. 8085 Microprocessor architecture:

Figure 1.5: 8085 Microprocessor internal architecture


Figure 1.5 shows the 8085 Microprocessor internal architecture.

The various units of a microprocessor are listed below


• Arithmetic and logic Unit
• Accumulator
• General purpose register
• Program counter
• Stack pointer
• Temporary Register
• Status Register (Flags)
• Timing and Control Unit
• Instruction Register and Decoder
• Register array
• Address bus and Data bus

Page | 5
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor

Arithmetic & Logic Unit (ALU):


The ALU unit performs the arithmetic and logical operations like addition, subtraction, Logical
AND, Logical OR, Complement, Increment, Decrement clear etc.

Accumulator
• Accumulator is an 8-bit register which can hold 8-bit data.
• Accumulator is a special register used for temporary data storage and manipulation
during arithmetic and logical operations.
• It also stores the result of the operation carried out by the Arithmetic and Logic unit.

General purpose register:

Figure 1.6: shows the General-Purpose register

General Purpose Registers


• Apart from accumulator 8085 consists of six special registers called General Purpose
Registers.
• These general-purpose registers are used to hold data like any other registers.
• The general-purpose registers in 8085 processors are B, C, D, E, H & L and each register
can hold 8-bit data.
• These registers can also be used to work in pairs to hold 16-bit data such as B-C, D-E and
H-L to store 16-bit data.
• The H-L pair works as a memory pointer.
• A memory pointer holds the address of a particular memory location and can store 16-bit
address as they work in pair.

Program Counter (PC):


• The Program Counter is a 16-bit register which points to the address of the next
instruction to be executed.
• It automatically increments after fetching each instruction byte.
• When the 8085 microprocessor is reset, the default value of PC is 0000H, indicating the
beginning of the program memory.

STACK:
The stack is a region of memory used for storing data temporarily during program execution.

Page | 6
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor

Stack Pointer (SP):


• The Stack pointer is also a 16-bit register which is used as a memory pointer.
• The stack is a section of RAM used by the CPU to store information temporarily. This
information could be data or an address.
• The register used to access the stack is called the stack pointer (SP) register.
• The last memory location of the occupied portion of the stack is called stack top.
• The storing of a CPU register in the stack is called a PUSH, and loading the contents of the
stack back into a CPU register is called a POP.

Temporary register:
Temporary register is an 8-bit register. This register acts as a temporary memory during the
arithmetic and logical operations. This temporary register can only be accessed by the
microprocessor and it is completely inaccessible to programmers.

Status Register (Flags) or Program Status Word (PSW)


Flags are a set of five flip-flops and are associated with arithmetic and logic operations. These
flags can hold a 1-bit value, either a logic 1 or 0, based on certain conditions that arise during
arithmetic and logic operations.

D7 D6 D5 D4 D3 D2 D1 D0
𝐒 𝐙 𝐀𝐂 𝐏 𝐂𝐘
Figure 1.7: 8085 microprocessor Flags

The five bits indicate the five-status flag and three bits are undefined. The combinations of these
8-bits are called Program Status Word (PSW). The 5 flags bits are Carry (CY), Zero (Z), Sign (S),
Parity (P) and Auxiliary Carry (AC)

CARRY (CY):
• After performing arithmetic & logic operation if there is a carryout from the MSB (D 7 i.e.
7th bit) then CY = 1, otherwise CY = 0.
• If there is a borrow from subtraction or comparison, the carry flag CY=1; otherwise CY=0.

PARITY FLAG (P):


After performing arithmetic & logic operation if the result in the accumulator has an even
number of 1’s then P=1; otherwise P=0. (i.e. if the result in the accumulator has an odd number
of 1’s then P= 0.)

AUXILIARY CARRY FLAG (AC):


After performing arithmetic & logic operation if a carry is generated from D3 to D4 bit then AC
= 1, otherwise AC = 0.
(This flag is used only internally for BCD operations and is not available for the
programmer).

ZERO FLAG:
After performing arithmetic & logic operation if the result in the accumulator is zero, then Z=1
and if the result in the accumulator is non-zero then Z=0.

SIGN FLAG:
After performing arithmetic & logic operation if the most significant bit (MSB) of the result in
accumulator is 1 i.e. MSB=1, then S=1; otherwise S=0. (if MSB=1, then S=1 & if MSB=0, then S=0).

Page | 7
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor

TIMING AND CONTROL UNIT


The Timing and Control Unit plays a crucial role in synchronizing all microprocessor operations
with the clock and generating essential control signals required for communication between the
microprocessor and peripherals. The 𝐑𝐃̅̅̅̅ and 𝐖𝐑
̅̅̅̅̅ signals serve as sync pulses that indicate the
availability of data on the data bus.

INSTRUCTION REGISTER AND DECODER


The instruction register and the decoder are part of the ALU. When an instruction is fetched from
memory, it is loaded in the instruction register. The decoder decodes the instruction and
establishes the sequence of events to follow. The instruction register is not programmable
and cannot be accessed through any instruction.

REGISTER ARRAY
Two additional registers, called temporary registers 𝐖 and 𝐙, are included in the register array
and they are used internally by 8085 microprocessor. These registers are not available to the
programmer. These registers are used to hold 8-bit data during the execution of some
instructions.

ADDRESS BUS AND DATA BUS:

ADDRESS BUS:
• The address bus is a set of physical lines that carry the memory address information. It
specifies the location in memory or a peripheral device where data needs to be read from
or written to.
• In 8085 microprocessor address bus is 16-bit A0 to A15.
• The lower address lines are multiplexed address and data lines i.e. AD0 to AD7 and
higher address line are A8 to A15.
• The address bus is unidirectional. The width of the address bus determines the range of
memory addresses that can be accessed, allowing access to 64 KB of memory locations
(i.e. 216 = 64 KB).

DATA BUS:
• The data bus is set of physical lines that carry the actual data being transferred between
the microprocessor and memory or peripheral devices.
• In 8085 microprocessor data bus is 8-bit bidirectional allowing it to transfer 8-bits of
data at a time.

NUMERICAL ON FLAGs

1. Determine the flag bits in the 8085 microprocessor after adding 80H and 60H.
SOLUTION:
CY D7 D6 D5 D4 D3 D2 D1 D0

80 0 1 0 0 0 0 0 0 0

+ 60 + 0 1 1 0 0 0 0 0

E0 1 1 1 0 0 0 0 0

Page | 8
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor

Carry Flag (CY) : There's no carry, so CY = 0.


Parity Flag (P) : E0H has 3 set bits, which is odd, so P = 0.
Auxiliary Carry : There's no carry from D3 to D4 bit, so AC = 0.
Flag (AC) OR
Theirs is no carry from the low nibble (4 bits) to the high nibble, so
AC = 0.
Zero Flag (Z) : The result (E0H) is not zero, so Z = 0.
Sign Flag (S) : The leftmost bit (Most Significant Bit - MSB) is 1, it indicates a
negative number i.e. result is E0H. so S = 1.

So, after adding 80H and 60H, the flag values are:
D7 D6 D5 D4 D3 D2 D1 D0
𝐒 𝐙 𝐀𝐂 𝐏 𝐂𝐘
1 0 0 0 0

2. Determine the flag bits in the 8085 microprocessor after adding CB H and E9 H.
SOLUTION:
CY D7 D6 D5 D4 D3 D2 D1 D0

1 1 1 1 1

CB 1 1 0 0 1 0 1 1

+ E9 + 1 1 1 0 1 0 0 1

1B4 1 1 0 1 1 0 1 0 0

Carry Flag (CY) : There's carry, so CY = 1.


Parity Flag (P) : B4 H has 4 set bits, which is even, so P = 1.
Auxiliary Carry : There's carry from D3 to D4 bit, so AC = 1.
Flag (AC) OR
Theirs is carry from the low nibble (4 bits) to the high nibble, so AC =
1.
Zero Flag (Z) : The result (B4 H) is not zero, so Z = 0.
Sign Flag (S) : The leftmost bit (Most Significant Bit - MSB) is 1, it indicates a
negative number i.e. result is E0H. so S = 1.

So, after adding CB H and E9 H, the flag values are:


D7 D6 D5 D4 D3 D2 D1 D0
𝐒 𝐙 𝐀𝐂 𝐏 𝐂𝐘
1 0 1 1 1

Page | 9
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor

1.2.2. PIN DIAGRAM OF 8085 MICROPROCESSOR:

Figure 1.8 (a): Pin diagram of 8085 Figure 1.8 (b): Functional Pin diagram

The pins of 8085 microprocessor are as below:


Pin
Pin Name Description
No.
• Crystal (or either RC network or LC network) is connected
at these two pins to set the frequency of internal clock
generator.
1-2 X 1 & X2
• The frequency is internally divided by two. The 8085
microprocessor operates at a frequency of 3MHz, so a 6MHz
crystal is connected externally.
It indicates that the MPU is being reset. The signal can be used to
3 RESETOUT
reset other devices.
The 8085 has two pins for serial Communication: Serial Input Data
(SID) & Serial Output Data (SOD).
SOD (Serial Output Data):
4& Serial I/O Ports
SOD is the serial output data pin. It is used for transmitting data
5 SOD & SID
serially from the microprocessor to external devices or peripherals.
Data is sent bit by bit through this pin in a sequential manner.
SID (Serial Input Data):

Page | 10
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor

SID is the serial input data pin. It is used for receiving serial data
from external devices or peripherals and transferring it to the
microprocessor. Data is received bit by bit through this pin.
In the 8085 microprocessor, interrupts are mechanisms used to
temporarily pause the normal program execution and handle
specific events or requests from external devices. The 8085
microprocessor has five interrupt signals that can be used to
interrupt program execution. These interrupt signals are:
TRAP or TRAP Interrupt:
• TRAP is a non-maskable interrupt (NMI) that is generated by
an external device, such as a power failure or a hardware
malfunction.
• When TRAP is triggered, the microprocessor jumps to a
specific memory location address 0024 to execute a
predefined routine.
• The TRAP interrupt has the highest priority and cannot be
disabled.

RST 7.5:
• The RST 7.5 interrupt is a maskable interrupt that is
generated by a software instruction. RST 7.5 can be enabled
or disabled by the microprocessor.
• When RST 7.5 is triggered, the microprocessor jumps to a
specific memory location address 002C to execute a
predefined routine.
(INTERRUPTS) • It has the second highest priority.

TRAP RST 6.5:


RST 7.5 • The RST 6.5 interrupt is a maskable interrupt that is
6-11
RST 6.5 generated by a software instruction. RST 6.5 can be enabled
RST 5.5 or disabled by the microprocessor.
INTR • When RST 6.5 is triggered, the microprocessor jumps to a
̅̅̅̅̅̅̅
𝐈𝐍𝐓𝐀 specific memory location address 0034 to execute a
predefined routine.
• It has the third highest priority.

RST 5.5:
• The RST 5.5 interrupt is a maskable interrupt that is
generated by a software instruction. RST 5.5 can be enabled
or disabled by the microprocessor.
• When RST 5.5 is triggered, the microprocessor jumps to a
specific memory location address 003C to execute a
predefined routine.
• It has the fourth highest priority.

INTR (Interrupt Request):


• INTR is a maskable interrupt request generated by external
devices, such as a keyboard or a mouse.
• INTR is enabled or disabled by software.
• It has the lowest priority and can be disabled.
INTA (Interrupt Acknowledge):
• INTA is not an interrupt.
• It is an interrupt acknowledgement sent by the
microprocessor after INTR is received.

Page | 11
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor

• When the microprocessor acknowledges the interrupt, it


proceeds to execute the corresponding interrupt service
routine.

SUMMARY OF INTERRUPTS
Address
Maskable or Non-
Interrupt Priority order or
Maskable
Location
1 (Highest Non-maskable
TRAP 0024
priority) (NMI)
RST 7.5 2 Maskable 003C
RST 6.5 3 Maskable 0034
RST 5.5 4 Maskable 002C
5 (Lowest No
INTR Maskable
priority) specific

AD0 to AD7:
• AD0 to AD7 are multiplexed address and data lines that form
the lower byte of the 16-bit Address/Data bus. AD0 – AD7 are
8-bit bi-directional and serve as both A0 – A7 and D0 – D7
simultaneously.
12- • They are used to send both address and data between the
AD0-AD7
19 microprocessor and memory or peripheral devices
• During the execution of the instruction, these lines carry the
address bits during the early part, then during the late parts
of the execution, they carry the 8 data bits.

20 GND or VSS Ground

A8 to A15:
• A8-A15 are a set of eight unidirectional lines that form the
21-
A8-A15 upper part of the 16-bit Address bus.
28
• They are used to transmit the most significant bits of the
memory address during memory read and write operations.

ALE (Address Latch Enable):


• When ALE = 1, AD0 to AD7 serve as address lines (A0-A7),
allowing the microprocessor to use them for addressing
30 ALE
memory locations.
• When ALE = 0, AD0 to AD7 serve as data lines (D0-D7),
enabling the microprocessor to send or receive data.
• ̅̅̅̅̅
𝐖𝐑 is an active low signal used to initiate the write
operation when interfacing with memory or peripheral
31 ̅̅̅̅̅
𝐖𝐑 devices.
• When ̅̅̅̅̅
𝐖𝐑 = 0, It indicates that the data on the data bus are
to be written into a selected memory or I/O location.
• ̅̅̅̅
𝐑𝐃 is an active low signal used to initiate the read operation
when interfacing with memory or peripheral devices.
32 ̅̅̅̅
𝐑𝐃
• When 𝐑𝐃̅̅̅̅ = 0, it indicates that the selected I/O or memory
device is to be read and data are available on the data bus.

Page | 12
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor

These are the status signals sent by microprocessor to distinguish


the various types of operations as mentioned below.
S1 S0 Operations
29 &
S0 & S1 0 0 HALT (No operation)
33
0 1 WRITE
1 0 READ
1 1 FETCH
• I0/ 𝐌
̅ is a status signal used to differentiate whether the
address is for I/O or memory operations.
̅ • When I0/ 𝐌 ̅ = 1, the address on the address bus is for I/O
34 I0/ 𝐌
devices.
• When I0/ 𝐌 ̅ = 0, the address on the address bus is for the
memory.
• READY signal is used by the microprocessor to sense whether a
peripheral is ready to transfer data or not.
35 READY
• If READY = 1, the peripheral is ready
• If READY = 0, the microprocessor waits till it goes high.

• When ̅̅̅̅̅̅̅̅̅
𝐑𝐄𝐒𝐄𝐓 ̅̅̅𝐈𝐍 = 𝟎, the microprocessor enters a reset state.
36 ̅̅̅̅̅̅̅̅̅ 𝐈𝐍
𝐑𝐄𝐒𝐄𝐓 ̅̅̅ • During this state, all registers and flags are cleared, and the
program counter (PC=00) is typically set to its initial value.
• CLK OUT in the 8085 microprocessor is an output signal that
37 CLK (OUT) carries the microprocessor's clock frequency. This signal can be
used as the system clock for other devices.
HLDA (Hold Acknowledge):
• HLDA is a signal used to acknowledge a HOLD request.
38 HLDA • It indicates that the HOLD request has been received.
• The microprocessor takes over the buses after the removal of
the HOLD request when HLDA goes low.
HOLD (Hold Request):
• It indicates that another device is requesting the use of the
address and data bus.
• After receiving a HOLD request, the microprocessor
39 HOLD
relinquishes (hands over) the use of the buses as soon as the
current machine cycle is completed.
• The microprocessor regains the buses after the removal of the
HOLD signal.
40 VCC +5V DC supply

Note:
In the 8085 microprocessor, "HOLD" and "HLDA" (Hold Acknowledge) are control
signals used to manage external requests for control of the system bus.

Status signals and the status of data bus


̅
I0/ 𝐌 S1 S2 Data Bus Status (Output)

0 0 0 Halt

0 0 1 Memory WRITE

0 1 0 Memory READ

Page | 13
Microprocessor & Microcontroller Unit-1: Introduction to Microprocessor

1 0 1 IO WRITE

1 1 0 IO READ

0 1 1 Op code fetch

1 1 1 Interrupt acknowledge

Page | 14

You might also like