Lecture Number 5
Lecture Number 5
Faculty of Science
Department of CS.
Microprocessors
Lecture #5
Memory, & Memory Organization
Interfacing SRAM and EPROM
Interfacing I/O and peripheral devices
Previous Lecture
❑ Microprocessor
❑ Addressing Modes
❑ Instruction Set
2
Computer Science Dept.
Contents
5.0 Objectives
5.1 Memory
5.2 Memory organization in 8086
5.3 Interfacing SRAM and EPROM
5.4 ROM Memory
5.5 RAM Memory
5.6 Memory Hierarchy
5.7 Interfacing I/O and peripheral devices
5.8 8086 and 8088 comparison
3
Computer Science Dept.
5.0 Objective of This Lecture
4
Computer Science Dept.
5.1 Memory
Processor Memory
▪ Registers inside a microcomputer
▪ Store data and results temporarily
▪ No speed disparity
▪ Cost
Secondary Memory
▪ Storage media comprising of slow devices such as
magnetic tapes and disks
▪ Hold large data files and programs: Operating
system, compilers, databases, permanent
programs etc. 5
Computer Science Dept.
5.2 Memory organization in 8086
8086 : 16-bit
4 Read/ Write word at an odd address 0 1 D15 – D0 in first operation byte from
odd bank is transferred
1 0 D7 – D0 in first operation byte from
odd bank is transferred 7
Computer Science Dept.
5.2 Memory organization in 8086 (Cont’d.)
Allot equal address space in odd and even bank for both
EPROM and RAM
Can be implemented in two IC’s (one for even and other for
odd) or in multiple IC’s
8
Computer Science Dept.
Blank Slide
Take Rest
Refresh Your Mind
9
Computer Science Dept.
5.3 Interfacing SRAM and EPROM
10
Computer Science Dept.
5.3 Interfacing SRAM and EPROM (Cont’d.)
Typical Semiconductor IC Chip
11
Computer Science Dept.
5.3 Interfacing SRAM and EPROM (Cont’d.)
Memory map of 8086
Initialization of stack
13
Computer Science Dept.
5.4 ROM Memory
The read-only memory (ROM) permanently stores programs and data
that are resident to the system and must not change when power supply is
disconnected.
Types of ROM
1. ROM - Read Only Memory
2. PROM - Programmable Read Only Memory
3. EPROM - Erasable Programmable Read Only Memory
4. EEPROM - Electrically Erasable Programmable Read Only Memory
5. Flash EEPROM memory
Each type has unique characteristics, but all types of ROM memory have
two things in common:
➢ Data stored in these chips is non-volatile -- it is not lost when power is
removed.
➢ Data stored in these chips is either unchangeable or requires a special
operation to change. 14
Computer Science Dept.
5.4 ROM Memory (Cont’d.)
1. Read Only Memory (ROM)
The ROM is permanently programmed so that data are always
present, even when power is disconnected. This type of memory is
often called nonvolatile memory, because its contents do not
change even if power is disconnected.
Since all the cells have a fuse, the initial (blank) state of a PROM
chip is all 1s. To change the value of a cell to 0, you use a
programmer to send a specific amount of current to the cell. The
higher voltage breaks the connection between the column and row
by burning out the fuse. 17
Computer Science Dept.
5.4 ROM Memory (Cont’d.)
3. Erasable Programmable Read Only Memory (EPROM)
This type is similar to PROM, except that the content of it can be
erased by exposing it to ultra violet light to restore it to its
unprogrammed state. EPROMs are configured using an EPROM
programmer that provides voltage at specified levels depending
on the type of EPROM used.
19
Computer Science Dept.
5.4 ROM Memory (Cont’d.)
Figure 5.7 The pin-out of the 2716, 2K × 8 EPROM. (Courtesy of Intel Corporation.) 20
Computer Science Dept.
5.4 ROM Memory (Cont’d.)
4. Electrically Erasable Programmable Read Only Memory
(EEPROM)
EEPROM chips remove the biggest drawbacks of EPROMs.
In EEPROMs:
1. The chip does not have to removed to be rewritten.
2. The entire chip does not have to be completely erased to
change a specific portion of it.
3. Changing the contents does not require additional dedicated
equipment.
Instead of using UV light, you can return the electrons in the cells of
an EEPROM to normal with the localized application of an electric
field to each cell. This erases the targeted cells of the EEPROM,
which can then be rewritten. EEPROMs are changed 1 byte at a
time, which makes them versatile but slow. 21
Computer Science Dept.
5.4 ROM Memory (Cont’d.)
5. Flash EEPROM Memory
EEPROM chips remove the biggest drawbacks of EPROMs.
It is a type of EEPROM that uses in-circuit wiring to erase by
applying an electrical field to the entire chip or to predetermined
sections of the chip called blocks. This erases the targeted area of the
chip, which can then be rewritten. Flash memory works much faster than
traditional EEPROMs because instead of erasing one byte at a time, it
erases a block or the entire chip, and then rewrites it. The electrons in the
cells of a Flash-memory chip can be returned to normal ("1") by the
application of an electric field, a higher-voltage charge.
23
Computer Science Dept.
5.5 RAM Memory
Random Access Memory (RAM)
Control
27
Computer Science Dept.
5.5 RAM Memory (Cont’d.)
2.1 Double Data Rate synchronous Dynamic Random Access
Memory (DDR SDRAM)
28
Computer Science Dept.
5.5 RAM Memory (Cont’d.)
2.2 Double Data Rate synchronous Dynamic Random Access
Memory (DDR2SDRAM)
DDR2 memory is fundamentally similar to DDR SDRAM. Still, while DDR
SDRAM can transfer data across the bus two times per clock, DDR2
SDRAM can perform four transfers per clock. DDR2 uses the same
memory cells, but doubles the bandwidth by using the multiplexing
technique.
The DDR2 memory cell is still clocked at the same frequency as DDR
SDRAM and SDRAM cells, but the frequency of the input/output buffers is
higher with DDR2 SDRAM (as shown in Fig 10). The bus that connects the
memory cells with the buffers is twice wider compared to DDR. Thus, the
I/O buffers perform multiplexing: the data is coming in from the memory
cells along a wide bus and is going out of the buffers on a bus of the
same width as in DDR SDRAM, but of a twice bigger frequency. This
allows to increase the memory bandwidth without increasing the 29
operational frequency.
Computer Science Dept.
5.5 RAM Memory (Cont’d.)
RAM Grid
RAM Grid
During read operation:
Entire row is selected
It is fed into the column MUX
MUX selects a single bit for output
During write operation:
Single bit to be written is distributed by the DEMUX to the
target column
Row decoder selects the proper column to be written
32
Computer Science Dept.
5.5 RAM Memory (Cont’d.)
33
Computer Science Dept.
5.6 Memory Hierarchy
Increasing performance
and
increasing cost
Slow and
inexpensive
34
Computer Science Dept.
5.7 Interfacing I/O and peripheral devices
I/O devices
For communication between microprocessor and outside world
Interrupt driven I/ O
I/O device interrupts the processor and
initiate data transfer
Direct memory access
Data transfer is achieved by bypassing
the microprocessor
35
Computer Science Dept.
5.8 8086 and 8088 comparison
Memory mapping I/O mapping
20 bit address are provided for I/O devices 8-bit or 16-bit addresses are provided for I/O
devices
The I/O ports or peripherals can be treated like Only IN and OUT instructions can be used for
memory locations and so all instructions related data transfer between I/O device and processor
to memory can be used for data transmission
between I/O device and processor
Data can be moved from any register to ports Data transfer takes place only between
and vice versa accumulator and ports
When memory mapping is used for I/O devices, Full memory space can be used for addressing
full memory address space cannot be used for memory.
addressing memory.
Suitable for systems which require large
Useful only for small systems where memory memory capacity
requirement is less
For accessing the memory mapped devices, the For accessing the I/O mapped devices, the
processor executes memory read or write cycle. processor executes I/O read or write cycle.
36
M / M is asser ted high M / M is asser ted low
Computer Science Dept.
5.8 8086 and 8088 comparison
8086 8088
16-bit Data bus lines obtained by demultiplexing 8-bit Data bus lines obtained by demultiplexing
AD0 – AD15 AD0 – AD7
In MIN mode, pin 28 is assigned the signal M / In MIN mode, pin 28 is assigned the signal IO /
I𝐎 𝐌
To access higher byte, 𝐁H𝐄 signal is used No such signal required, since the data width is
only 1-byte
37
Computer Science Dept.
Appendix