8085 Microprocessor Architecture
8085 Microprocessor Architecture
8085 Microprocessor Architecture
Microprocessor Architecture
The microprocessor can be programmed to perform functions on given data by writing specific instructions into its memory.
The microprocessor reads one instruction at a time, matches it with its instruction set, and performs the data manipulation specified. The result is either stored back into memory or displayed on an output device.
Unidirectional.
Information flows out of the microprocessor and into the memory or peripherals.
When the 8085 wants to access a peripheral or a memory location, it places the 16-bit address on the address bus and then sends the appropriate control signals.
Microprocessors & Interfacing
Dr. Bassel Soudan 4
The 8085 uses the data bus to transfer the binary information. Since the data bus has 8-bits only, then the 8085 can manipulate data 8 bits at-a-time only.
All of the operations of the microprocessor can be classified into one of three types:
- Microprocessor Initiated Operations - Internal Operations - Peripheral Initiated Operations
These are operations that the microprocessor itself starts. These are usually one of 4 operations:
Memory Read Memory Write I/O Read (Get data from an input device) I/O write (Send data to an output device)
It is important to note that the microprocessor treats memory and I/O devices the same way.
Input and output devices simply look like memory locations to the microprocessor.
For example, the keyboard may look like memory address A3F2H. To get what key is being pressed, the microprocessor simply reads the data at location A3F2H.
The communication process between the microprocessor and peripheral devices consist of the following three steps:
Identify the address. Transfer the binary information. Provide the right timing signals.
Microprocessors & Interfacing
Dr. Bassel Soudan 9
10
The 8085 can perform a number of internal operations. Such as: storing data, Arithmetic & Logic operations, Testing for condition, etc.
To perform these operations, the microprocessor needs an internal architecture similar to the following:
Accumulator Flags B C D E H L Program Counter Stack Pointer
Address
16
Data
11
We have already discussed the general purpose registers, the Accumulator, and the flags. The Program Counter (PC)
This is a register that is used to control the sequencing of the execution of instructions. This register always holds the address of the next instruction. Since it holds an address, it must be 16 bits wide.
12
13
Interrupt
The microprocessors operations are interrupted and the microprocessor executes what is called a service routine. This routine handles the interrupt, (perform the necessary operations). Then the microprocessor returns to its previous operations and continues.
14
Hold
The 8085 has a pin called HOLD. This pin is used by external devices to gain control of the busses. When the HOLD signal is activated by an external device, the 8085 stops executing instructions and stops using the busses. This would allow external devices to control the information on the busses. Example DMA.
15
Memory in a microprocessor system is where information (data and instructions) is kept. It can be classified into two main types:
Main memory (RAM and ROM) Storage memory (Disks , CD ROMs, etc.)
The simple view of RAM is that it is made up of registers that are made up of flip-flops (or memory elements).
The number of flip-flops in a memory register determines the size of the memory word.
ROM on the other hand uses diodes instead of the flip-flops to permanently hold the information.
Microprocessors & Interfacing
Dr. Bassel Soudan 16
For the microprocessor to access (Read or Write) information in memory (RAM or ROM), it needs to do the following:
Select the right memory chip (using part of the address bus). Identify the memory location (using the rest of the address bus). Access the data (using the data bus).
17
Tri-State Buffers
An important circuit element that is used extensively in memory. This buffer is a logic circuit that has three states:
Logic 0, logic1, and high impedance. When this circuit is in high impedance mode it looks as if it is disconnected from the output completely.
High Impedance
18
Input
Output
Input
Output
Enable
Enable
19
The basic memory element is similar to a D latch. This latch has an input where the data comes in. It has an enable input and an output on which data comes out.
Data Input Data Output
Enable
EN
20
WR
21
22
A Memory Register
If we take four of these latches and connect them together, we would have a 4-bit memory register
I0 I1 I2 I3
WR
D Q EN
EN RD O0
D Q EN
D Q EN
D Q EN
O1
O2
O3
23
D1
o o
D2
o
D3
WR
D EN
D EN
D EN
D EN
Expanding on this scheme to add more memory registers we get the diagram to the right.
D EN
D EN
D EN
D EN
D EN
D EN
D EN
D EN
D EN
D EN
D EN
D EN
RD
D0
D1
D2
D3
24
Input Buffers Memory Reg. 0 Memory Reg. 1 Memory Reg. 2 Memory Reg. 3 Output Buffers
O1
O2
O3
25
Using the RD and WR controls we can determine the direction of flow either into or out of memory. Then using the appropriate Enable input we enable an individual memory register. What we have just designed is a memory with 4 locations and each location has 4 elements (bits). This memory would be called 4 X 4 [Number of location X number of bits per location].
26
27
Input Buffers Memory Reg. 0 Memory Reg. 1 Memory Reg. 2 Memory Reg. 3 Output Buffers
A1 A0
RD O0
O1
O2
O3
28
Since we have tri-state buffers on both the inputs and outputs of the flip flops, we can actually use one set of pins only.
The chip would now look like this:
WR A d d r e s s D e c o d e r
Input Buffers Memory Reg. 0 Memory Reg. 1 Memory Reg. 2 Memory Reg. 3 Output Buffers
D0 D1 D2 D3 RD WR A1 A0
D0 D1 D2 D3
A1 A0
RD
29
30
Dimensions of Memory
Memory is usually measured by two numbers: its length and its width (Length X Width).
The length is the total number of locations. The width is the number of bits in each location.
The length (total number of locations) is a function of the number of address lines.
# of memory locations = 2(#ofaddresslines) So, a memory chip with 10 address lines would have 210 = 1024 locations (1K) Looking at it from the other side, a memory chip with 4K locations would need Log2 4096=12 address lines
Microprocessors & Interfacing
Dr. Bassel Soudan 31
The 8085 has 16 address lines. That means it can address 216 = 64K memory locations.
Then it will need 1 memory chip with 64 k locations, or 2 chips with 32 K in each, or 4 with 16 K each or 16 of the 4 K chips, etc.
how would we use these address lines to control the multiple chips?
32
Chip Select
Usually, each memory chip has a CS (Chip Select) input. The chip will only work if an active signal is applied on that input. To allow the use of multiple chips in the make up of memory, we need to use a number of the address lines for the purpose of chip selection.
These address lines are decoded to generate the 2n necessary CS inputs for the memory chips to be used.
33
34
D0 D1
RD WR A0 A1 CS RD WR A0 A1 CS RD WR A0 A1 CS RD WR A0 A1 CS
A0 A1
A2 A3
2 X4 Decoder
35
The memory map is a picture representation of the address range and shows where the different memory chips are located within the address range.
0000 0000
EPROM
3FFF 4400
Address Range
Address Range of 1st RAM Chip Address Range of 2nd RAM Chip
RAM 4
F7FF FFFF
36
The address range of a particular chip is the list of all addresses that are mapped to the chip.
An example for the address range and its relationship to the memory chips would be the Post Office Boxes in the post office.
Each box has its unique number that is assigned sequentially. (memory locations) The boxes are grouped into groups. (memory chips) The first box in a group has the number immediately after the last box in the previous group.
37
The upper digit of the box number identifies the group and the lower two digits identify the box within the group.
Microprocessors & Interfacing
Dr. Bassel Soudan 38
The 8085 has 16 address lines. So, it can address a total of 64K memory locations.
If we use memory chips with 1K locations each, then we will need 64 such chips. The 1K memory chip needs 10 address lines to uniquely identify the 1K locations. (log21024 = 10) That leaves 6 address lines which is the exact number needed for selecting between the 64 different chips (log264 = 6).
39
Now, we can break up the 16-bit address of the 8085 into two pieces: A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
Chip Selection Location Selection within the Chip
Depending on the combination on the address lines A15 - A10 , the address range of the specified chip is determined.
40
A chip that uses the combination A15 - A10 = 001000 would have addresses that range from 2000H to 23FFH.
Keep in mind that the 10 address lines on the chip gives a range of 00 0000 0000 to 11 1111 1111 or 000H to 3FFH for each of the chips. The memory chip in this example would require the following circuit on its chip select input:
A 10 A 11 A 12 A 13 A 14 A 15 CS
41
Now the chip would have addresses ranging from: 2400 to 27FF. Changing the combination of the address bits connected to the chip select changes the address range for the memory chip.
Microprocessors & Interfacing
Dr. Bassel Soudan 42
After
FFFF
FFFF
43
The address lines from a microprocessor can be classified into two types:
High-Order
Used for memory chip selection
Low-Order
Used for location selection within a memory chip.
44
Data Lines
All of the above discussion has been regarding memory length. Lets look at memory width. We said that the width is the number of bits in each memory word.
We have been assuming so far that our memory chips have the right width. What if they dont?
It is very common to find memory chips that have only 4 bits per location. How would you design a byte wide memory system using these chips? We use two chips for the same address range. One chip will supply 4 of the data bits per address and the other chip supply the other 4 data bits for the same address.
45
Data Lines
CS A0 A9
CS
CS
D0 D3 D4 D7
46