The 8085 Microprocessor Architecture: Dr. Kuda Nageswara Rao
The 8085 Microprocessor Architecture: Dr. Kuda Nageswara Rao
Associate Professor Dept. of Computer Science & Systems Engineering ANDHRA UNIVERSITY
8085
40 pin DIP. +5V 3 - 5MHz
ADD BUS DATA BUS CONTROL STATUS POWER SUPPLY AND FREQ EXTERNALLY INITIATED SIGNALS SERIAL I/O PORTS
5V GND
40 20 X1 X2
21 28 HIGH ORDER ADD BUS
SID 5 SOD 4 TRAP 6 RST7.5 7 RST6.5 8 RST5.5 9 INTR 10 READY 35 HOLD 39 RESET IN 36 INTA 11 HLDA 38
37
30 ALE 29 S0 33 S1 34 IO/M 32 RD 31 WR
RESET OUT
CLK OUT
Accumu
Temp Reg
Flags
Instru Decoder
W Z Temp Reg (8) Temp Reg (8) B C (8) (8) D E (8) (8) H L (8) (8) Stack pointer (16) Program counter (16) Incrementer/decrementer Latch (16)
www.yesnarayanan.blogspot.com
8085
MEMWR WR IOWR
www.yesnarayanan.blogspot.com
ADD/DATA bus
A15
AD0
OC GND
Control signals
ALE active high output used to latch the lower 8 address bits. RD, WR - active low output signals. IO/M output signal to differentiate memory and IO operation. S1 and S0 status output signal. Identify various operations.
Machine cycle IO/M S1 S0 Control signals
Opcode fetch
Memory read Memory write I/O read I/O write Interrupt Ackn Halt Hold Reset
0
0 0 1 1 1 Z Z Z
1
1 0 1 0 1 0 X X
1
0 1 0 1 1 0 X X
RD=0
RD=0 WR=0 RD=0 WR=0 INTA=0 RD, WR =Z and INTA=1
www.yesnarayanan.blogspot.com
Demultiplexing AD7-AD0
From the above description, it becomes obvious that the AD7 AD0 lines are serving a dual purpose and that they need to be demultiplexed to get all the information. The high order bits of the address remain on the bus for three clock periods. However, the low order bits remain for only one clock period and they would be lost if they are not saved externally. Also, notice that the low order bits of the address disappear when they are needed most. To make sure we have the entire address for the full three clock cycles, we will use an external latch to save the value of AD7 AD0 when it is carrying the address bits. We use the ALE signal to enable this latch.
Demultiplexing AD7-AD0
8085
A15-A8 ALE AD7-AD0 Latch
A7- A0
D7- D0
Given that ALE operates as a pulse during T1, we will be able to latch the address. Then when ALE goes low, the address is saved and the AD7 AD0 lines can be used for their purpose as the bi-directional data lines.
The ALU
In addition to the arithmetic & logic circuits, the ALU includes the accumulator, which is part of every arithmetic & logic operation. Also, the ALU includes a temporary register used for holding data temporarily during the execution of the operation. This temporary register is not accessible by the programmer.
Machine cycles and instruction length, do not have a direct relationship. To illustrate lets look at the machine cycles needed to execute the following instruction. STA 2065H
This is a 3-byte instruction requiring 4 machine cycles and 13 T-states. 32H 2010H 2011H 65H The machine code will be stored 20H 2012H in memory as shown to the right This instruction requires the following 4 machine cycles:
Opcode fetch to fetch the opcode (32H) from location 2010H, decode it and determine that 2 more bytes are needed (4 T-states). Memory read to read the low order byte of the address (65H) (3 T-states). Memory read to read the high order byte of the address (20H) (3 T-states). A memory write to write the contents of the accumulator into the memory location.
Memory interfacing
There needs to be a lot of interaction between the microprocessor and the memory for the exchange of information during program execution. Memory has its requirements on control signals and their timing. The microprocessor has its requirements as well. The interfacing operation is simply the matching of
these requirements.
RAM
Input Buffer WR
ROM
Address Lines
CS
Address Lines
CS
Output Buffer
RD
Output Buffer
RD
Data Lines
Date Lines
The process of interfacing the above two chips is the same. However, the ROM does not have a WR signal.
Interfacing Memory
Accessing memory can be summarized into the following three steps: Select the chip. Identify the memory register. Enable the appropriate buffer. Translating this to microprocessor domain: The microprocessor places a 16-bit address on the address bus. Part of the address bus will select the chip and the other part will go through the address decoder to select the register. The signals IO/M and RD combined indicate that a memory read operation is in progress. The MEMR signal can be used to enable the RD line on the memory chip.
Address decoding
The result of address decoding is the identification of a register for a given address. A large part of the address bus is usually connected directly to the address inputs of the memory chip. This portion is decoded internally within the chip. What concerns us is the other part that must be decoded externally to select the chip. This can be done either using logic gates or a decoder.
8085
A15-A8
ALE AD7-AD0 Latch
CS
A9- A0
A7- A0
WR RD
IO/M
D7- D0
RD
WR