Professional Documents
Culture Documents
Memory
Memory is an essential element of a computer. Memory plays an important role in
saving and retrieving data. The performance of the computer system depends upon
computer. RAM AND ROM both form part of primary memory. The primary memory
access memory (RAM) because it is possible to randomly select and use any
It is also called read/write memory. The storage of data and instructions inside the
primary storage is temporary. It disappears from RAM as soon as the power to the
The memories, which lose their content on failure of power supply, are known as
volatile memories .So now we can say that RAM is volatile memory.
Read Only Memory (ROM): There is another memory in computer, which is called
Read Only Memory (ROM). The storage of program and data in the ROM is
Memory Interfacing.....T.Srikrishna, Asst Prof, GVP PG, Visakhapatnam
permanent. The ROM stores some standard processing programs supplied by the
. The memories, which do not lose their content on failure of power supply, are
modify or erase programs stored in ROM, but it is possible for you to store your
program in PROM chip. Once the programmers’ are written it cannot be changed
and remain intact even if power is switched off. Therefore programs or instructions
EPROM: This stands for Erasable Programmable Read Only Memory, which
overcome the problem of PROM & ROM. EPROM chip can be programmed time and
again by erasing the information stored earlier in it. Information stored in EPROM
exposing the chip for some time ultraviolet light and it erases chip is reprogrammed
using a special programming facility. When the EPROM is in use information can
only be read.
Cache Memory: The speed of CPU is extremely high compared to the access time
of main memory. Therefore the performance of CPU decreases due to the slow
memory chip is attached between CPU and Main memory whose access time is very
memories are accessed much faster than conventional RAM. It is used to store
programs or data currently being executed or temporary data frequently used by the
CPU. It is also very expensive to have bigger size of cache memory and its size is
Registers: The CPU processes data and instructions with high speed; there is also
processed data with high speed. So the computer uses a number of special memory
units called registers. They are not part of the main memory but they store data or
Secondary memory can be stored on storage media like floppy disks, magnetic
disks, magnetic tapes, This memory can also be stored optically on Optical disks -
CD-ROM. The following terms comes under secondary memory of a computer are
discussed below:
Magnetic Tape: Magnetic tapes are used for large computers like mainframe
computers where large volume of data is stored for a longer time. In PC also you can
use tapes in the form of cassettes. The cost of storing data in tapes is inexpensive..
Magnetic Disk: We might have seen the gramophone record, which is circular like a
disk and coated with magnetic material. Magnetic disks used in computer are made
on the same principle. It rotates with very high speed inside the computer drive. Data
is stored on both the surface of the disk. Magnetic disks are most popular for direct
access storage device. Information is recorded on tracks of a disk surface in the form
of tiny magnetic spots. The presence of a magnetic spot represents one bit and its
Optical Disk: With every new application and software there is greater demand for
memory capacity. It is the necessity to store large volume of data that has led to the
Interfacing:
Memory Interfacing.....T.Srikrishna, Asst Prof, GVP PG, Visakhapatnam
A microprocessor can perform some operation on a data and give the output.
But to perform the operation we need an input to enter the data and an output
to display the results of the operation.
Interfacing Types
There are two types of interfacing in context of the 8085 processor.
(a) Memory Interfacing.
(b) I/O Interfacing.
Memory Interfacing:
While executing an instruction, there is a necessity for the microprocessor to access
memory frequently for reading various instruction codes and data stored in the
memory. The interfacing circuit aids in accessing the memory.
Memory requires some signals to read from and write to registers. Similarly the
microprocessor transmits some signals for reading or writing a data.
I/O Interfacing:
We know that keyboard and Displays are used as communication channel with
outside world. So it is necessary that we interface keyboard and displays with the
microprocessor. This is called I/O interfacing. In this type of interfacing we use
latches and buffers for interfacing the keyboards and displays with the
microprocessor.
The programs and data that are executed by the microprocessor have to be stored in
ROM/EPROM and RAM, which are basically semiconductor memory chips.
The interface process involves designing a circuit that will match the memory
requirements with the microprocessor signal.
Memory has certain signal requirements to read from and write into memory.
Similarly Microprocessor initiates the set of signals when it wants to read from and
write into memory.
Generation of Control Signals for Memory: When the 8085 wants to read from
and write into memory, it activates IO/M, RD and WR signals as shown. Status of
IO/M, RD’ and WR’ signals during memory read and write operations
Using IO/M , RD and WR signals, two control signals MEMR (memory read) and MEMW
(memory write) are generated. Fig. 16 shows the circuit used to generate these signals.
Memory Interfacing.....T.Srikrishna, Asst Prof, GVP PG, Visakhapatnam
8085 places 16-bit address on address bus and with this address only one
register should be selected (only 11 low order address lines are required).
8085 provides two signal-IO/M’ and RD’– to indicate that is memory read
operation MEMR’. (Similarly signal-IO/M’ and WR’– indicates memory write
operation MEMW’).
Figure Shows:
2048 registers
Structure of ROM:
8 input lines
12 address lines (A11-A0), 1 chip select, 1 Read control Signal lines to enable
output buffer.
The following are the steps involved in interfacing memory with 8085 processor.
Example:
Interface 4KB memory to 8085 with starting address A000H.
4KB memory requires 12 address lines for addressing and 4 address lines are
used for address decoding
Given that starting address for memory is A000H. So for 4KB memory ending
address becomes A000H+0FFFH (4KB) = AFFFH.
A0-A11 address lines are directly connected to address bus of memory chip.
A12-A15 are used for generating chip select signal for memory chip.
A15 line is use for enabling 74x138 decoder chip. A12, A13, A14 lines are connected
to 74X138 chip as inputs. When theses lines are 010 output should be ‘0’. This is
provided at O2 pin of 74X138 chip.
A15, A14, A13, A12 inputs should be 1010, for enabling the chip. So the circuit for
this is as shown above.
The 8085 address lines A11-A0 are connected to the pins A11-A0 of the
memory chip.
An address bus: this determines the location in memory that the processor will
read data from or write data to.
A data bus: this contains the contents that have been read from the memory
location or are to be written into the memory location.
Memory Interfacing.....T.Srikrishna, Asst Prof, GVP PG, Visakhapatnam
Consider a system in which the full memory space 64kb is utilized for EPROM
memory. Interface the EPROM with 8085 processor.
In memory mapped I/O scheme we can use only one address space. This
particular one address space is allocated to both memory and I/O devices.
In this scheme remember that I/O device is also treated as a memory location.
Now take a very good example, MOV C, M instruction would transfer one byte of
data from a memory location or it can also transfer an input device to the register
C, depending on whether the address in the H-L register pair is assigned to a
memory location or to an input device.
If H-L contains address of a memory location, data will be transferred from that
memory location to register C, while if H-L pair contains the address of an input
device, data will be transferred from that input device to register C.
In this method separate address space is given to I/O devices. Each I/O
device is given an 8-bit address. Hence maximum 256 devices can be interfaced to
the processor. The address range for the I/O devices is 00H-FFH. I/O control signals
are used to perform read, write operations.
For reading data from I/O device or writing data to IO device IN, OUT
instructions needs to be used.
We know that Some CPUs provide one or more control lines like IO/ M line for
8085, which indicates the status of operation, is memory or I/O operation.
If we get the status of IO/ M’ line is high, it indicates I/O operation and when we
get low, it points to memory operation. in this case the same address may be
assigned to both memory and an I/O device depending on the status of IO/M
line.
The above scheme is referred as I/O mapped I/O scheme. Look in this scheme
two separate address spaces exist. One space is meant exclusively for memory
operations and the other for I/O operations.
The following figure shows, pictorially, both the schemes. Here it is assumed that
the system has a 64 KB of memory and 256 I/O space.
Memory Interfacing.....T.Srikrishna, Asst Prof, GVP PG, Visakhapatnam
MEMR and MEMW control signals are used to control IOR and IOW control signals are used to control read and
read and write I/O operations respectively. write I/O operations respectively.
Instructions available are STA addr, LDA addr, LDAX rp, IN and OUT are the only available instructions.
STAX rp, ADD M, CMP M, MOV r, M, etc.
Data transfer takes place between accumulator and I/O
Data transfer takes place between any register and I/O dev ice.
dev ice.
Maximum number of I/O dev ices that can be addressed is Maximum number of I/O dev ices that can be addressed is
6dev
5536
ice(theoretically). 2 56.
It requires m ore hardware circuitry because it decodes 16- It requires less hardware circuitry because it decodes 8- bit
bit address. address.
STACK.ORGANIZATION
Stack is a storage structure that stores information in such a way that the last item
stored is the first item retrieved. It is based on the principle of LIFO (Last-in-first-out).
The stack in digital computers is a group of memory locations with a register that
holds the address of top of element. This register that holds the address of top of
element of the stack is called Stack Pointer.
Stack.Operations:
The two operations of a stack are:
1. Push: Inserts an item on top of stack.
2. Pop: Deletes an item from top of stack.
Memory Stack
A stack can be implemented in a random access memory (RAM) attached to a CPU.
The implementation of a stack in the CPU is done by assigning a portion of memory
to a stack operation and using a processor register as a stack pointer. The starting
memory location of the stack is specified by the processor register as stack pointer.