VCK Unit 2 Architecture of 8085 Microprocessor
VCK Unit 2 Architecture of 8085 Microprocessor
B. Sc. II Electronics Semester-III, Paper-III, DSC -1005 C Electronics Communication and Microprocessor 8085
Dr. C. B. Patil
B. Sc. II Electronics Semester-III, Paper-III, DSC -1005 C Electronics Communication and Microprocessor 8085
UNIT 2
Architecture of 8085 Microprocessor
Syllabus: Architecture of 8085 Microprocessor: Silent features of 8085.Block diagram and
Pin description of 8085. Data and address bus, Registers, ALU, Stack pointer, Program
counter, Flag register, Clock and reset circuits. Interrupts in 8085. De-multiplexing of
AD0-AD7. T-states, Machine cycle, Instruction cycle. Timing diagram of MOV and MVI
instructions.
Introduction:
Microprocessor (μp) is a multipurpose, programmable logical device that reads binary
instructions from memory, accepts binary data as an input & processes the data according to
those instructions & provides the result as an output. Microprocessor is a semiconductor device
consisting of several digital circuits, which performs together to execute the instructions given by
the user. Depending upon the capability of handling a data, they are classified as 4-bit, 8-bit, 16-
bit, 32-bit microprocessor. It can be used in two different ways.
1. as a programmable logic device to control the process.
e.g. -VCRs, washing- machine, video game, T.V., microwave oven, copying machine,
toys etc.
2. as a data processing unit or a computing units of a computer like P.C.
B. Sc. II Electronics Semester-III, Paper-III, DSC -1005 C Electronics Communication and Microprocessor 8085
Fig.2.1 shows internal architecture of 8085 μp. It includes accumulator, ALU, Control
unit, instruction register, instruction Decoder & Encoder, Timing & control unit, Serial I/O
control, Interrupt control unit etc.
Control Unit
Generates signals within μp to carry out the instruction, which has been decoded. In
reality causes certain connections between blocks of the μp to be opened or closed, so that data
goes where it is required, and so that ALU operations occur.
B. Sc. II Electronics Semester-III, Paper-III, DSC -1005 C Electronics Communication and Microprocessor 8085
• For example in ADD C instruction C register contents are moved to the Temp. Register and
the addition of A and Temp. Register contents is performed by the ALU.
• For example when MVI M, 17H instruction is fetched, IR register will receive the opcode
for MVI M and the Temporary register will receive 17H.
Flags
The ALU includes five flip- flops, which are set or reset after an operation according to
data conditions of the result in the accumulator and other registers. They are called Zero (Z),
Carry (CY), Sign (S), Parity (P), and Auxiliary Carry (AC) flags. The most commonly used flags
are Zero, Carry, and Sign. The microprocessor uses these flags to test data conditions.
For example, after an addition of two numbers, if the sum in the accumulator is larger
than eight bits, the flip-flop uses to indicate a carry called the Carry flag (CY) is set to one.
When an arithmetic operation results in zero, the flip- flop called the Zero (Z) flag is set to one.
The figure 2.2 shows an 8-bit register, called the flag register. However, it is not used as a
register; five bit positions out of eight are used to store the outputs of the five flip- flops. The
flags are stored in the 8-bit register so that the programmer can examine these flags (data
conditions) by accessing the register through an instruction. These flags have critical importance
in the decision- making process of the microprocessor. The conditions (set or reset) of the flags
are tested through the software instructions.
For example, the instruction JC (Jump on Carry) is implemented to change the sequence of a
program when CY flag is set. The detail understanding of flag is essential in writing assembly
language programs.
B. Sc. II Electronics Semester-III, Paper-III, DSC -1005 C Electronics Communication and Microprocessor 8085
using data copy instructions. The 8085 programming model also includes one accumulator, and
one flag register. In addition, it has two 16-bit registers: the stack pointer and the program
counter.
Program Counter (PC)
This 16-bit register deals with sequencing the execution of instructions. This register is a
memory pointer. Memory locations have 16-bit addresses, and that is why this is a 16-bit
register. The microprocessor uses this register to sequence the execution of the instructions. The
function of the program counter is to point to the memory address from which the next byte is to
be fetched. When a byte (machine code) is being fetched, the program counter is incremented by
one to point to the next memory locatio n.
• It is a 16-bit special purpose register
• This register is a memory pointer used to sequence the execution of the instructions from
memory device.
• The execution of a program is initiated by loading the PC by the address of the first
instruction of the program.
• Once the byte is fetched, the PC is automatically incremented to point to the next byte unless
a jump to some specific address occurs.
• This process is repeated till the last instruction of the program.
• In case of JUMP or CALL instructions, current address is stored on to the Stack and new
address specified by the JUMP or CALL instruction is loaded in the Program Counter. So
now execution goes to new address specified by the JUMP or CALL instruction.
Stack Pointer (SP)
The stack pointer is also a 16-bit register used as a memory pointer. It points to a memory
location in R/W memory, called the stack. The beginning of the stack is defined by loading 16-
bit address in the stack pointer. It always points to top of the Stack
Instruction Register, Decoder & Encoder
The current instruction from memory is stored in Instruction Register (IR) before
execution. Decoder then takes instruction and ‘decodes’ or interprets the instruction. Decoded
instruction then passed to next stage. Encoder generates the sequential control signals.
Timing & control unit
This unit synchronizes all the μp operations with the CLK & generates the different
control signals for communication between μp & peripherals.
Interrupt control unit
An interrupt can be defined as any signal to the µP that alters the normal sequence of execution of
a program. The interrupt can be introduced in the µP through an instruction written in the program
or it can even be initiated by external device. Whenever µP receives any interrupt it’s control gets
shifted to some other location in order to execute a set of instructions called service routine which
is written at that location. The µP resumes its operation after completing the service routine. The
interrupt process in 8085 is controlled by the Interrupt Enable flip-flop, which is internal to the
processor and can be set or reset by using software instructions. There exist two types of
interrupts: a) Software interrupts b) Hardware interrupts
i. Software interrupts
The instruction set of 8085 includes eight RST (Restart) instructions referred to as software
interrupts. These are one-byte instructions. Each of these instructions allows the transfer of the
program execution to a specific location on page 00H. Therefore RST instructions act like a vector
that points towards different memory locations.Table1 shows the list of different RST instructions.
The RST0 instruction service routine is stored in locations between 0000H and 0007H. When this
instruction is given the Program Counter (PC) points to the memory location 0000H and its
current address is loaded into the stack pointer. After the service routine is executed the PC returns
back to the address of the next memory location by popping back the address from the stack
pointer. Similarly RST1 service routine is stored in memory location 0008H to 000FH. In the
same way when RST5 is inserted in the program it transfers the control to memory location
0028H. It is a break point service routine. The RST5 instruction displays the contents of
accumulator and the flags when the A key is pressed and returns to the calling program when the
5|Page Unit 2: Architecture of 8085 Microprocessor
B. Sc. II Electronics Semester-III, Paper-III, DSC -1005 C Electronics Communication and Microprocessor 8085
B. Sc. II Electronics Semester-III, Paper-III, DSC -1005 C Electronics Communication and Microprocessor 8085
B. Sc. II Electronics Semester-III, Paper-III, DSC -1005 C Electronics Communication and Microprocessor 8085
Clock Signals:
1) X1, X2 (Input): Crystal or R/C network is connected here to set the frequency of internal
clock generator. The generated frequency is divided by 2 and then it is given to the
various internal blocks for its operation.
2) CLK (Output): This is output signal where the internal operating frequency is available.
B. Sc. II Electronics Semester-III, Paper-III, DSC -1005 C Electronics Communication and Microprocessor 8085
acknowledgement signal.
RESET signals:
1) RESET IN (Input): This is active low signal which is input to μp. It resets the μp & PC
becomes 0000H. None of the other flags or registers (except the instruction register) are
affected. The CPU is held in the reset condition as long as Reset is applied.
2) RESET OUT (Output): This is active low output signal which is used to indicate that μp
is reset.
Interrupt controlled signals: The 8085 has 5 interrupt inputs: INTR, RST5.5, RST6.5, RST 7.5,
and TRAP.
1) INTR (Input) & INTA (Output): Interrupt request & acknowledge. The INTR is an active
high Interrupt. When μp receives an interrupt signal, it sends the active low interrupt
acknowledgement i.e. INTA. This interrupt have least priority.
2) RST 7.5, RST6.5, RST5.5: (Restart interrupts): These are active high, vectored and
maskable interrupts. Their vector locations are 003CH, 0034H, 002CH respectively.
3) TRAP (Input): This is active high. It is highest priority interrupt. It is a non- maskable
interrupt. It is unaffected by any mask or Interrupt Enable. When the signal is received
then PC goes to location 0024H.
Bus means a group of lines used to transfer the bits between μp & peripheral devices or within
different sections of μp. Typical system uses a number of buses (collection of wires) which
transmit binary numbers, one bit per wire. A typical microprocessor communicates with memory
and other devices (input and output) using three buses: Address Bus, Data Bus and Control Bus.
Address Bus:
The Address Bus is a group of 16 lines generally identified as A0-A15. Address bus is
unidirectional, i.e. numbers only sent from microprocessor to memory, not other way. One
address line identifies two locations means two registers each of 8 bit or 1-byte. Hence 16
address lines can identify 216=65536. The 8085μp have 16 address lines which is capable to
locate 64KB memory locations. The address lines for 8085 μp are A0, A1, A2, ---------- , A14, A15,
hence the addresses from 0000H to FFFFH which identify 64KB memory locations.
9|Page Unit 2: Architecture of 8085 Microprocessor
B. Sc. II Electronics Semester-III, Paper-III, DSC -1005 C Electronics Communication and Microprocessor 8085
Data Bus:
It is a group of 8 lines. It is bidirectional, i.e. data (bits) may flow in any direction from
microprocessor to peripherals & from peripherals to microprocessor. The 8 data lines enables the
μp to manipulate 8 bit data ranging from 00H to FFH i.e.28=256. It determines the word length &
register size of a μp. The word length of a data for 8085 is 8-bit hence 8085 is called 8-bit μp.
Since data bus is 8 bits wide then largest number is 11111111 (255 in decimal). Therefore, larger
number have to be broken down into chunks of 255. This slows microprocessor. Data Bus also
carries instructions from memory to the microprocessor. Size of the bus therefore limits the
number of possible instructions to 256, each specified by a separate number.
Control Bus :
The control bus comprised of various single lines that carry synchronization signals.
The MPU uses these lines to send timing signals or pulses. The MPU generate specific control
signals for every operation such as Memory Read [MEMR], Memory Write [MEMW], I/O Read
[I/OR] etc.
Switch To RESET IN
C 10µF
Ground
10 | P a g e Unit 2: Architecture of 8085 Microprocessor
B. Sc. II Electronics Semester-III, Paper-III, DSC -1005 C Electronics Communication and Microprocessor 8085
B. Sc. II Electronics Semester-III, Paper-III, DSC -1005 C Electronics Communication and Microprocessor 8085
2.11
2.12 8085 Machine Cycles:
The 8085 microprocessor has 5 (five) basic machine cycles as shownin Table 2.2
Machine cycle Status signals Control signals
IO/M S1 S0 RD WR
1. Opcode fetch cycle (4T) 0 1 1 0 1
2. Memory read cycle (3 T) 0 1 0 0 1
3. Memory write cycle (3 T) 0 0 1 1 0
4. I/O read cycle (3 T) 1 1 0 0 1
5. I/O write cycle (3 T) 1 0 1 1 0
Table 2.4 8085 Machine Cycles
2.13 Stack Memory:
The stack is the reserved area of the memory which is shared by microprocessor and
programmer. The higher order address of RAM area is reserved as a stack. The 16 bit register
which is holding the memory address of the stack is called a stack pointer. Programmer can use
the stack to store the data which can be quickly accessed. The intermediate results and register
contents can be stored onto the stack. Microprocessors use the stack during CALL and RET
instructions. Whenever the CALL instruction is executed, the address of the next instruction is
loaded onto the stack and subroutine is executed. Since every subroutine ends with RET
instruction, so when RET instruction is executed, the program counter (PC) is loaded back with
the address from the stack and now program execution starts from the location next to where it
was called from.
The programmer can initialize the stack pointer by using the instruction LXI SP, XXXX
H. e.g. LXI SP, 7000H, Then storing of Data begins from 6FFFH, means one less than
7000H.The data can be loaded or retrieved from the Stack using PUSH, POP instructions. When
the information is written onto the stack, the operation is called as PUSH. When the information
is read from the stack the operation is called as POP. The stack memory has the structure called
as last in first out (LIFO) or first in last out (FILO).
2.13 Timing diagrams:
A timing diagram of an instruction is a graphical representation of the time taken by the µP to
fetch, decode and execute an instruction. The size of the instruction and the frequency of the µP
decide the total amount of time taken to execute an instruction.
1) Instruction cycle: Time required for completing the execution of an instruction is known as
instruction cycle. The 8085 instruction cycle consists of one to six machines cycles for
operations.
2) Machine cycle: It is the time required for completing a single operation. This operation can be
accessing memory for read/write operation or accessing I/O device. There can be 3 to 6 clock
periods or T-states in a machine cycle.
3) T-states or clock cycles/periods (CLK): T-state is equivalent to one clock period. It is the
time in which only a subdivision of the operation can be performed. The total number of T-
states determines the size of the machine cycle required to perform an operation.
For Ex: If the internal clock frequency of 8085 microprocessor is 3 MHZ,
One T-state 1/3 MHz =0.333 s= 0.333 x10-6 sec=333x10-9sec. (333 nano seconds nearly)
B. Sc. II Electronics Semester-III, Paper-III, DSC -1005 C Electronics Communication and Microprocessor 8085
B. Sc. II Electronics Semester-III, Paper-III, DSC -1005 C Electronics Communication and Microprocessor 8085
data bus.
During T3, the opcode is placed in Instruction Register (IR). The memory is disabled by
making RD high. Thus here the fetch cycle is completed.
The opcode is decoded in T4.
Timing diagram of MVI Instruction:
Ex. Illustrate the execution of two byte instruction MVI B, 25 H stored at locations as follows:
Ex. Illustrate the execution of two byte instruction MVI B, 43 H stored at locations as follows:
Memory Mnemonics Hex Comment
address codes
B. Sc. II Electronics Semester-III, Paper-III, DSC -1005 C Electronics Communication and Microprocessor 8085
2000 H MVI B, 43H 06 H ; copy the specified data into destination register B
2001 H 43 H ; It is a 2 byte instruction; therefore the complete
instruction is stored in a two memory locations
This instruction requires two machine cycles for its complete execution: M1—opcode fetch and
M2—memory read. M1 consists of 4 T-states and M2 consists of 3 T-states.
Exercise:
Select correct alternatives:
1) 8085μp is ------------------ bit microprocessor.
a) 4 b) 8 c) 16 d) 32
2) Operating frequency of 8085μp is------------------ MHz
15 | P a g e Unit 2: Architecture of 8085 Microprocessor
B. Sc. II Electronics Semester-III, Paper-III, DSC -1005 C Electronics Communication and Microprocessor 8085
a) 1 b) 2 c) 3 d) 4
3) technology is used to fabricate 8085μp.
a) NMOS b) CMOS c) HMOS d) TTL
4) register is used to indicate status of the result.
b) ACC b) Flag c) PC d) SP
5) is a 16 bit register.
a. ACC b) Flag c) PC d) B
6) is a memory pointer register.
b. ACC b) Flag c) PC d) B
7) ------ signal is used to Demultiplexing AD0-AD7.
a. RESET IN b) ALE c) S0, S1 d) IO/M
8) 8085 microprocessor can access ----------------- bytes of memory.
a) 8 K b) 16K c) 32K d) 64K
9) 8085 microprocessor has------ bit data bus.
a) 4 b) 8 c) 16 d) 32
10) To communicate with slower memories -------- signal is used.
a) RESET IN b) ALE c) READY d) HOLD
11) Stack memory is initialized using ------- instruction.
a) LXI H, xxxxH b) LXI SP, xxxxH c) PUSH B d) POP B
12)are 16-bit registers.
a) PC and ACC b) SP and ACC c) PC and SP d) ACC and B
13)is not be an Interrupt signal.
a) INTR b) RST 7.5 c) RST 5.5 d) HOLD
14) Principal register in 8085 microprocessor is------
a) ACC b) Flag c) PC d) SP
15)registers can be acts as inputs for ALU.
a) ACC and B b) B and C c) PC and SP d) ACC and Temp Register
16)registers are not user accessible.
a) ACC and B b) B and C c) PC and SP d) W and Z
17) 8085 microprocessor has ------ number of General purpose registers.
a) 4 b) 6 c) 8 d) 10
18) 8085 microprocessor has ------ bit address bus.
a) 4 b) 8 c) 16 d) 32
19) 8085 microprocessor can be reset by using the -------- signal.
a) HOLD b) ALE c) READY d) RESET IN
20) If crystal of 6MHz is connected to Microprocessor then the operating clock frequency
is ---------MHz
a) 6 b) 3 c) 16 d) 1
21) Microprocessor writes a data into a memory by activating the signals as--------
a) S0=0, S1=0, IO/M=1, RD=0
b) S0=0, S1=0, IO/M=0, RD=0
c) S0=0, S1=1, IO/M=0, WR=0
d) S0=1, S1=0, IO/M=0, WR=0
22) Microprocessor reads a data from input device by activating the signals as--------
a) S0=0, S1=0, IO/M=1, RD=0
b) S0=0, S1=0, IO/M=0, WR=0
c) S0=0, S1=1, IO/M=0, WR=0
d) S0=0, S1=1, IO/M=1, RD =0
23)signal is not an output signal.
a) RD b) WR c) S0 d) READY
24) Microprocessor uses ------ signals to communicate with serial devices.
a) HOLD and HLDA b) TRAP and RST 7.5
c) SID and SOD d) READY and HOLD
25) Addressing capacity of microprocessor depends upon ----- --.
a) address lines b) data lines
B. Sc. II Electronics Semester-III, Paper-III, DSC -1005 C Electronics Communication and Microprocessor 8085
30) The interrupt having specific address in the memory is called as ----------------
a) software interrupt b) vectored interrupt
c) hardware interrupt d) maskable interrupt
31) ----- is a edge triggered interrupt
a) RST7.5 b) RST 6.5 c) INTR d) RST 5.5
32) -----instruction is used to send a data in serial communication
a) SIM b) SUB c) SBB d) RIM
33) In 8085---------- is having highest priority
a) RST 7.5 b) TRAP c) INTR d) INTA
34) The interrupt that can be ignored is called as ------
a) Non maskable interrupt b) Maskable interrupt
c) Hardware interrupt d) Vectored interrupt
11.b 12.c 13.d 14.a 15.d 16.d 17.b 18.c 19.d 20.b