0% found this document useful (0 votes)
39 views

Microprocessor Architecture and Memory: By: Farhan Aziz AP, Department of ECE BSACET, Mathura

The document summarizes the architecture of the 8085 microprocessor, including its main components and operations. It discusses the address bus, data bus, and control bus. It describes how the microprocessor initiates read and write operations to memory and I/O devices by placing addresses on the address bus and transferring data on the data bus while providing timing signals via the control bus. It also discusses the microprocessor's internal architecture, including registers, program counter, stack pointer, and arithmetic/logic operations.

Uploaded by

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

Microprocessor Architecture and Memory: By: Farhan Aziz AP, Department of ECE BSACET, Mathura

The document summarizes the architecture of the 8085 microprocessor, including its main components and operations. It discusses the address bus, data bus, and control bus. It describes how the microprocessor initiates read and write operations to memory and I/O devices by placing addresses on the address bus and transferring data on the data bus while providing timing signals via the control bus. It also discusses the microprocessor's internal architecture, including registers, program counter, stack pointer, and arithmetic/logic operations.

Uploaded by

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

Chapter 3

Microprocessor Architecture and Memory

By:
Farhan Aziz
AP, Department of ECE
BSACET, Mathura

Microprocessors & Interfacing 1


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.

Microprocessors & Interfacing 2


The 8085 Architecture
• The 8085 uses three separate busses to perform
its operations
– The address bus.
– The data bus.
– The control bus.

Microprocessors & Interfacing 3


Structure of BUS

Microprocessors & Interfacing 4


The Address Bus
– 16 bits wide (A0 A1…A15)
• Therefore, the 8085 can access locations with numbers
from 0 to 65,536. Or, the 8085 can access a total of 64K
addresses.
– “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.
– The microprocessor uses the address bus to
identify a peripheral or a memory location.(Step1)

Microprocessors & Interfacing 5


The Data Bus
– 8 bits wide (D0 D1…D7)
– “Bi-directional”.
• Information flows both ways between the microprocessor
and memory or I/O.
– The 8085 uses the data bus to transfer the binary
information.(Step2)
– Since the data bus has 8-bits only, then the 8085
can manipulate data 8 bits at-a-time only.

Microprocessors & Interfacing 6


The Control Bus
– There is no real control bus. Instead, the control
bus is made up of a number of single bit control
signals.
– These line carry th synchronization signals,
timming signal.
– Provide pulse to indiacte microprocessor
operation(Rear, write)
– It provide timing signals.(Step3)

Microprocessors & Interfacing 7


Operation Types in a Microprocessor
• All of the operations of the microprocessor can
be classified into one of three types:
- Microprocessor Initiated Operations
- Internal Operations
- Peripheral Initiated Operations

Microprocessors & Interfacing 8


Microprocessor 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)

Microprocessors & Interfacing 9


Microprocessor Initiated Operations
• 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 10
The Read Operation
– To read the contents of a memory location, the
following steps take place:
• The microprocessor places the 16-bit address of the
memory location on the address bus.
• The microprocessor activates a control signal called
“memory read” which enables the memory chip.
• The memory decodes the address and identifies the right
location.
• The memory places the contents on the data bus.
• The microprocessor reads the value of the data bus after
a certain amount of time.

Microprocessors & Interfacing 11


Internal Data Operations
• 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 8 Data

Microprocessors & Interfacing 12


The Internal Architecture
• 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.

Microprocessors & Interfacing 13


The Internal Architecture
• The Stack pointer
– The stack pointer is also a 16-bit register that is
used to point into memory.
– The memory this register points to is a special
area called the stack.
– The stack is an area of memory used to hold data
that will be retreived soon.
– The stack is usually accessed in a Last In First
Out (LIFO) fashion.

Microprocessors & Interfacing 14


Externally Initiated Operations
• External devices can initiate (start) one of the 4
following operations:
– 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.

Microprocessors & Interfacing 15


Externally Initiated Operations
– Ready
• The 8085 has a pin called RDY. This pin is used by
external devices to stop the 8085 until they catch up.
• As long as the RDY pin is low, the 8085 will be in a wait
state.
– 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.

Microprocessors & Interfacing 16


Memory

• It store the binary information ( data, instruction


etc)

Microprocessors & Interfacing 17


The Design and Operation of Memory
• 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 18
Accessing Information in Memory
• 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).

Microprocessors & Interfacing 19


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.

The Output is Low The Output is High High Impedance

Microprocessors & Interfacing 2


0
The Tri-State Buffer
• This circuit has two inputs and one output.
– The first input behaves like the normal input for the
circuit.
– The second input is an “enable”.
• If it is set high, the output follows the proper circuit
behavior.
• If it is set low, the output looks like a wire connected to
nothing.

Input Output OR Input Output

Enable Enable

Microprocessors & Interfacing 21


The Basic Memory Element
• 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


D Q

Enable
EN

Microprocessors & Interfacing 2


2
The Basic Memory Element
• However, this is not safe.
– Data is always present on the input and the output
is always set to the contents of the latch.
– To avoid unintensional change in the input and
control the availabilty of the output, tri-state buffers
are added at the input and output of the latch.
Data Input Data Output
D Q

WR RD

Enable
EN

Microprocessors & Interfacing 2


3
The Basic Memory Element
• The WR signal controls the input buffer.
– The bar over WR means that this is an active low
signal.
– So, if WR is 0 the input data reaches the latch
input.
– If WR is 1 the input of the latch looks like a wire
connected to nothing.
• The RD signal controls the output in a similar
manner.

Microprocessors & Interfacing 2


4
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 D D D
Q Q Q Q

EN EN EN EN
EN

RD O0 O1 O2 O3

Microprocessors & Interfacing 2


5
A group of memory registers
D0 D1 D2 D3

o o o o
WR

D Q D Q D Q D Q

EN EN EN EN

– Expanding on this D Q D Q D Q D Q

scheme to add more EN EN EN EN

memory registers we get


the diagram to the right. 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

Microprocessors & Interfacing 2


6
A group of Memory Registers
– If we represent each memory location (Register)
as a block we get the following
I0 I1 I2 I3

WR Input Buffers

EN0 Memory Reg. 0

EN1 Memory Reg. 1

EN2 Memory Reg. 2

EN3 Memory Reg. 3

RD Output Buffers

O0 O1 O2 O3

Microprocessors & Interfacing 2


7
The Design of a Memory Chip
• 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].

Microprocessors & Interfacing 2


8
The Enable Inputs
• How do we produce these enable line?
– Since we can never have more than one of these
enables active at the same time, we can have
them encoded to reduce the number of lines
coming into the chip.
– These encoded lines are the address lines for
memory.

Microprocessors & Interfacing 2


9
The Design of a Memory Chip
– So, the previous diagram would now look like the
following:
I0 I1 I2 I3

WR Input Buffers

A D Memory Reg. 0
d e
A1 d c Memory Reg. 1
r o
e Memory Reg. 2
A0 d
s e Memory Reg. 3
s r

RD Output Buffers

O0 O1 O2 O3

Microprocessors & Interfacing 3


0
The Design of a Memory Chip
• 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 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

Microprocessors & Interfacing 31


The steps of writing into Memory
• What happens when the programmer issues the
STA instruction?
– The microprocessor would turn on the WR control
(WR = 0) and turn off the RD control (RD = 1).
– The address is applied to the address decoder
which generates a single Enable signal to turn on
only one of the memory registers.
– The data is then applied on the data lines and it is
stored into the enabled register.

Microprocessors & Interfacing 3


2
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( # of address lines)

• 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 3
3
The 8085 and Memory
• 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?

Microprocessors & Interfacing 3


4
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.

Microprocessors & Interfacing 3


5
Chip Selection Example
– Assume that we need to build a memory system
made up of 4 of the 4 X 4 memory chips we
designed earlier.

– 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.

Microprocessors & Interfacing 3


6
Chip Selection Example

RD

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

Microprocessors & Interfacing 3


7
Memory Map and Addresses
• 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 Address Range of EPROM Chip
3FFF
4400
RAM 1 Address Range of 1st RAM Chip
Address Range

5FFF
6000
RAM 2 Address Range of 2nd RAM Chip
8FFF
9000
RAM 3 Address Range of 3rd RAM Chip
A3FF
A400

RAM 4 Address Range of 4 th RAM Chip

F7FF
FFFF

Microprocessors & Interfacing 3


8
Address Range of a Memory Chip
• 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.

Microprocessors & Interfacing 3


9
Address Range of a Memory Chip
– The above example can be modified slightly to
make it closer to our discussion on memory.
– Let’s say that this post office has only 1000 boxes.
– Let’s also say that these are grouped into 10 groups of 100
boxes each. Boxes 0000 to 0099 are in group 0, boxes
0100 to 0199 are in group 1 and so on.

– We can look at the box number as if it is made up


of two pieces:
– The group number and the box’s index within the group.
– So, box number 436 is the 36th box in the 4th group.

The upper digit of the box number identifies the group and the
lower two digits identify the box within the group.

Microprocessors & Interfacing 4


0
The 8085 and Address Ranges
• 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).

Microprocessors & Interfacing 41


The 8085 and Address Ranges
• 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.

Microprocessors & Interfacing 4


2
Chip Select Example
• 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 CS

A 13
A 14

A 15

Microprocessors & Interfacing 4


3
Chip Select Example
• If we change the above combination to the
following: A 10

A 11

A 12 CS

A 13
A 14

A 15

– 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 4
4
Chip Select Example
– To illustrate this with a picture:
• in the first case, the memory chip occupies the piece of
the memory map identified as before.
• In the second case, it occupies the piece identified as
after.

Before After
0000 0000

2000
23FF 2400
27FF

FFFF FFFF

Microprocessors & Interfacing 4


5
High-Order vs. Low-Order Address Lines
• 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.

– This classification is highly dependent on the


memory system design.

Microprocessors & Interfacing 4


6
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 don’t?
• 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.

Microprocessors & Interfacing 4


7
Data Lines

CS

A0

A9

CS CS

D0

D3
D4

D7

Microprocessors & Interfacing 4


8
Questions
• Q1-Calculate number of memory chips neede to
design 8K-byte memory if the memory size is
1024x1.
• Explain the memory address range of 1K
(1024x8) memory.Explain the changes in the
address if the hardware of the CS bar is
modified.
• Memory address range of the chip with 256
bytes?
• Calculate the address lines for a 10K byte
memory chip.

Microprocessors & Interfacing 4


9
Classification of memory(3.2.7)
• Home work

Microprocessors & Interfacing 5


0
Input And Output Devices
• I/O device are the mean through which the MPU
communicates with “the out side world”.
• There are two methods by which I/O device can
be identified:
1. I/O with 8 bit address(Peripheral
mapped I/O)
2. I/O with 16-bit address(Memory-Mapped
I/O )

Microprocessors & Interfacing 51


1. I/O with 8 bit address
(Peripheral mapped I/O)
• Uses 8 address line to identify an input or an
output device.
• Called Peripheral mapped I/O or I/O mapped I/O
• Also known as I/O space, separate from memory
space (which is 16 bit numbering system)
• 8bit line-256 address so can identify 256 input device
and 256 output device (Address ranging from 00H
toFFH called I/O map)
• Input and output are differentiated by the control
signals.
• I/O read control signal – for input device
I/O write control signal – for output device
Microprocessors & Interfacing 5
2
• Individual address called I/O address or I/O port
• Example
LED (output device)
Switch(Input Device)
• These devices are connected to bus through
external tristate interfacing device so they will be
enabled and connected to buses only when MPU
choose to communicate with them.
• We do not need these problem for memory
accessing due to internal decoding, R/W buffers
and availability of chip select pin and control signal
of memory
Microprocessors & Interfacing 5
3
Step to communication with I/O
• Similar to those in communicating with memory

1.MPU place 8 bit address on address bus, which


is decoded by external decoding circuit

2. MPU send control signal (I/O Read or Write) and


enable the input/ output device.

3. Data are transferred using the data bus.

Microprocessors & Interfacing 5


4
I/O with 16-bit address (Memory-Mapped I/O )

• Uses 16-bit address line to identify I/O devices.


• It is connected as if it is memory
• Called Memory-Mapped I/O
• Uses same control signal as memory
(Memory Read or Memory Write)
• Uses same instruction as memory
• Memory of 64K
• In the next lecture you will get more detail about I/O
devices. (Chapter 5)

Microprocessors & Interfacing 5


5
SN I/O Mapped I/O Memory mapped I/O
1 In this device address is 8 bit In this device address
Thus A0-A7 or A8-A15 lines are used to is 16 bit. Thus A0 to
generate device address A15 lines are used to
generate device
address.
2. IOR and IOW control signals are used to MEMR and MEMW
control read and write I/O operation control signals
3. Data transfer is between accumulator and B/W any register and
I/O device. I/O device.
4. Maximum number of I/O devices are 256 65536
5. Require less hardware due to decoding 8 More hardware require
bit address due to 16bit address
decoding
6. Instructions available are IN and OUT Instructions available
are LDA, STA, MOV
etc

Microprocessors & Interfacing 5


6
Logic Devices for interfacing
• Tri- state Device
• Buffer
• Decoder
• Encoder
• D Flip-Flops (Latch and clocked)

These interfacing devices are discuss in brief…in


detail we will discuss in next unit of interfacinng

Microprocessors & Interfacing 5


7
Practice questions
• Solve unsolved questions

Microprocessors & Interfacing 5


8
Quires?

?
Microprocessors & Interfacing 5
9
References
• Text Book (Ramesh Gaonker)
Chapter 3

Microprocessors & Interfacing 6


0
Thanks

Microprocessors & Interfacing 61

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy