LU - Microprocessor I - Chap3 - Introduction To 8085 Microprocessor - FA2017
LU - Microprocessor I - Chap3 - Introduction To 8085 Microprocessor - FA2017
o 1974
o 8-bit architecture
o Still used in some
microcontroller
applications !
This is the form in which instructions are stored in memory. This is the only form
that the microprocessor understands.
e.g. “Add 1,2” is assigned to the machine language pattern 11001101 mentioned
above to refer to the operation 1+2.
There is usually one assembly language instruction for each machine language
instruction.
One high level instruction translates into many assembly or machine language
instructions.
Input Output
Memory
ALU Register
Array
System Bus
Control Memory
ROM RAM
2. Register Array
A collection of registers within the microprocessor itself. These are used primarily for
data storage during program execution. The number and the size of these registers
differ from one microprocessor to the other.
3. Control Unit
As the name implies, the control Unit controls what is happening in the
microprocessor. It provides the necessary control and timing signals to all operations
in the microprocessor as well as its contact to the outside world.
Memory Storage
Microprocessor I – 4th year Electrical Engineering – Chapter 3 19
Dr. Mohamad Mroué
The Hardware/Software Interaction
o Software refers to any program that executes on the
hardware.
It contains very low level programs that control the behavior
of the hardware all the way to complicated applications like
3D graphics, video editing, and circuit simulation and design.
It has:
‒ 6 general purpose registers 16 bits
‒ An accumulator Accumulator Flags
B C
‒ A flag register D E
H L
‒ A stack pointer Program Counter
Stack Pointer
‒ A program counter
Address 16 8 Data
D7 D6 D5 D4 D3 D2 D1 D0
S Z AC P CY
‒ MVI A, 32
• Opcode: MVI A
• Operand: The number 32
• Binary Code:
0011 1110 3E 1st byte.
0011 0010 32 2nd byte.
Opcode Operand
‒ It is important to recognize that the microprocessor deals with 0’s and 1’s.
• It deals with values as vector of bits.
• It is the user job to add a meaning to these vectors.
To
Flowchart 8085 Manual Hex. Monitor Binary Memory
Microprocessor Lookup Code Program Code For Storage
‒ “Unidirectional”.
• Information flows out of the microprocessor and into the memory or peripherals.
‒ 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.
‒ Internal Operations
Memory Decode
A0 And
Memory
Chip
8085 Data
MPU
D7
Data Bus
D0
MEMR
Memory Read
16 bits
Accumulator Flags
B C
D E
H L
Program Counter
Stack Pointer
Address 16 8 Data
‒ The stack pointer is also a 16-bit register that is used to point into memory.
‒ The stack is an area of memory used to hold data that will be retreived soon.
‒ Reset
• All operations are stopped and the program counter is reset to 0000.
‒ Interrupt
• The microprocessor’s 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.
‒ Identify the memory location (using the rest of the address bus).
To avoid this, tri-state buffers are added at the input and output of
the latch.
WR RD
Enable
EN
I0 I1 I2 I3
WR
D D D D
Q Q Q Q
EN EN EN EN
EN
RD O0 O1 O2 O3
EN
Q D
EN
Q D
EN
Q D Q
EN
EN EN EN EN
D Q D Q D Q D Q
EN EN EN EN
D Q D Q D Q D Q
EN EN EN EN
o o o o
RD
D0 D1 D2 D3
WR Input Buffers
RD Output Buffers
O0 O1 O2 O3
I0 I1 I2 I3
WR Input Buffers
A D Memory Reg. 0
d e
A1 d c Memory Reg. 1
r o
A0 e d Memory Reg. 2
s e
Memory Reg. 3
s r
RD Output Buffers
O0 O1 O2 O3
WR Input Buffers
A D Memory Reg. 0 D0 D0
d e
A1 d c Memory Reg. 1 D1 A1 D1
r o
e Memory Reg. 2 D2 D2
A0 d A0
s e Memory Reg. 3
s r D3 D3
RD Output Buffers
RD WR
‒ The data is then applied on the data lines and it is stored into the enabled
register.
• Looking at it from the other side, a memory chip with 4K locations would need
Log2 4096 = 12 address lines
how would we use these address lines to control the multiple chips?
‒ We will need to use 2 inputs and a decoder to identify which chip will be used
at what time.
‒ The resulting design would now look like the one on the following slide.
WR
D0
D1
RD WR RD WR RD WR RD WR
A0 A0 A0 A0
A1 A1 A1 A1
CS CS CS CS
A0
A1
A2 2 X4
A3 Decoder
Address Range
5FFF
6000
RAM 2 Address Range of 2nd RAM Chip
8FFF
9000
RAM 3 Address Range of 3rd RAM Chip
A3FF
A400
F7FF
FFFF
‒ An example for the address range and its relationship to the memory chips
would be the Post Office Boxes in the post office.
o Each box has its unique number that is assigned sequentially. (memory locations)
o The boxes are grouped into groups. (memory chips)
o The first box in a group has the number immediately after the last box in the
previous group.
The upper digit of the box number identifies the group and the lower two digits identify the box
within the group.
‒ That leaves 6 address lines which is the exact number needed for selecting
between the 64 different chips (log264 = 6).
‒ Depending on the combination on the address lines A15 - A10 , the address range of
the specified chip is determined.
A10
A11 MEMR
A12 MEMW
A13
A9 CS RD WR
A14
A8
Int. Decoder
A15
I/O Lines
1024
Registers
A1
A0
A11
A12 CS
A13
A14
A15
‒ Now the chip have the 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.
Before After
0000 0000
2000
23FF 2400
27FF
FFFF FFFF
‒ Low-Order
• Used for location selection within a memory chip.
A0
…
A9
CS CS
D0
…
D3
D4
…
D7
4F 0100 1111
Data Bus
Memory
Internal Data Bus
2000
FLAG
Accumulator Instruction B C
Flip-Flop
Decoder D E
ALU H L
SP
PC
2005 0100 1111
Control
Unit Address Bus
2005
8085
MPU Control Bus
MEMR 4F