Chapter Three
Chapter Three
1
Outline
Memory Classifications
Input & Output Devices: I/Os with 8-Bit Addresses, I/Os with 16-Bit
Addresses
The data in this selection cannot be written over and can only the read.
The ROM is used to store information that should not change.
ROMs are available into 4 types. There are
i. Masked ROM ii. PROM iii. EPROM iv. EEPROM
i-Masked ROM : The instructions in such ROMs are permanently installed by the
manufacturer as for the specification provided by the system programmer and cannot be altered.
ii-PROM (Programmable Read Only Memory)
The manufacturer provides a memory device which can be programmed by the user by using
a PROM program.
5
Cntd…
iii-EPROM (Erasable PROM)
It uses most charge storage technology.
It is also programmable by the user.
The information stored in the EPROM can be erased by exposing the memory to
ultraviolet light which erase the data stored the data in total memory area.
Then the memory can be reprogrammable by the user by using EPROM burning circuit.
iv-EEPROM (Electrically Erasable PROM)
This is similar to EPROM except that the erasing done by electrical signal
instead of ultraviolet light and that the data in memory location can be
selective erased.
6
B. RAM(Read/Write Memory)
It working area of CPU
The CPU can access any memory location by specifying its address.
RAMs are two types.
i-Static RAM
In the case of static RAM once the data is written into a memory location, the data remain
unchanged unless on same memory location is written into again.
It uses flip-flops for storage elements.
ii-Dynamic RAM
In case of dynamic RAM the basic storage elements is a capacitor.
This element contains a 1or a 0 depending on the presence or absence of charge.
The contents of the dynamic RAM may change with time due to leakage of charge.
So, it is necessary to periodically refresh the storage element in a dynamic RAM. 7
Cntd…
The advantages of dynamic RAM over static RAM are
It consumes less power than static RAM.
It has about 5 times more storage element per unit area.
Disadvantages are that DRAMS have slower access times and need special circuitry to
periodically refresh memory.
2-Secondary Memory
The maximum capacity of primary memory 2n location. Each of 2n location where n is
the number of CPU address lines.
Sometimes it is necessary to handle more data than allowed by the primary memory. In
such cases secondary memory is used.
The CPU cannot directly access memory but can access through I/O ports.
E.G., magnetic tapes, hard disk, and floppy disk. 8
Memory Mapping
8085 has 16-bit Address Bus
The complete address space is given by the range of addresses 0000H –FFFFH
The range of addresses allocated to a memory device is known as its memory map
Memory map: 64K memory device
I. Address lines required: 16 (A0 – A15)
II. Memory map: 0000H – FFFFH
Memory map: 32K memory device
Address lines required: 15 (A0 – A14)
Memory map: depends on how address line A15 is connected
9
Cntd…
ROM Model:
A Read Only Memory (ROM) has an encoder to select a word in an encoder, only one
of the inputs must be made active.
But to save lines, the CPU directly puts out the address of the word it wants to access.
So, it is necessary to insert a device between the address put out by the CPU and the
ROM inputs which enables a unique input to the ROM.
This device must be a decoder.
This is an example with an address bus of
n=3 bits and a memory of 8 bytes (23=8 words).
The CPU puts out the address 111
on the address lines
A2 A1 A0 to access the 8th word B7.
B7 is made active by the decoder and the word
W (7) = W2 (7) W1 (7) W0 (7) is put on the data bus. (Decoded ROM of capacity 8 bytes)
10
Cntd…
RAM Or Read/Write Model:
The internal organization of a Random Access Memory (RAM) is similar to that of ROM.
But RAM has input which is made active when data is to be written into RAM.
The figure shows a 3 bit = 8 words RAM.
One of the outputs of the decoder is made active depending on the address which is input to it.
This active output is fed to the encoder to generate the output W, which is directly connected to
the data bus of the system.
13
Cntd..
Accessing memory can be summarized into the following three steps:
Select the chip.
Identify the memory register.
Enable the appropriate buffer.
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. 14
Memory structure & its requirements
The way of interfacing bellow two chips to the microprocessor is the same.
However, the ROM does not have a WR signal.
15
Cntd…
Overall Interface
16
Memory Interfacing and Address Decoding:
Memory Interfacing :
An address decoding circuit is employed to select the required I/O device or a memory chip.
When IO/M……. is high, decoder is to active and the require IO device is selected.
If IO/M….. is low, the decoder 1 is activated the required memory chip is selected.
A few MSB(most significant bit) of address line is applied to the decoder to select the memory
chip or an I/O device.
17
Cntd…
A13 A14 A15 OUTPUT
0 0 0
Y0
0 0 1 Y1
0 1 0 Y2
0 1 1 Y3
1 0 0 Y4
1 0 1 Y5
1 1 0 Y6
1 1 1 Y7
18
II. I/O Interfacing
There are various communication devices like the keyboard, mouse, printer, etc
So, we need to interface the keyboard and other devices with the microprocessor by using latches
and buffers.
In memory interfacing: 8 bit data line, 16 bit address line , control signals are connected to
corresponding lines of memory IC.
In I/O device interfacing: 8 bit data line, only 8 bit address line , control signals are connected to
corresponding lines of I/O devices.
Memory-mapped I/O
Peripheral-mapped I/O
24
25
The interfacing of Output Devices
Output devices are usually slow. Also, the output is usually expected to continue
appearing on the output device for a long period of time.
Given that the data will only be present on the data lines for a very short period
(microseconds), it has to be latched externally.
To do this the external latch should be enabled when the port’s address is present on the
address bus, the IO/M signal is set high and WR is set low.
The resulting signal would be active when the output device is being accessed by the
microprocessor.
Decoding the address bus (for memory-mapped devices) follows the same techniques
discussed in interfacing memory.
7
The interfacing of Input Devices
The basic concepts are similar to interfacing of output devices.
The address lines are decoded to generate a signal that is active when the particular port is
being accessed.
An IORD signal is generated by combining the IO/M and the RD signals from the
microprocessor.
A tri-state buffer is used to connect the input device to the data bus.
The control (Enable) for these buffers is connected to the result of combining the address
signal and the signal IOR.D.
7
End of chapter Three
Any Question???
28