Imam Abdulrahman Bin Faisal University
College of Computer Science & IT
Department of Computer Engineering
CSE 210: Digital Logic Design
Chapter#7: Memory and Programmable Logic
1
Introduction
There are two types of memories that are used in digital
systems:
• Random-access memory(RAM): perform both the write
and read operations.
• Read-only memory(ROM): perform only the read
operation.
The read-only memory is a programmable logic device.
Other such units are Programmable Logic Array(PLA),
Programmable Array Logic(PAL), and Field-
programmable Gate Array(FPGA).
2
Array logic
• A typical programmable logic device may have hundreds to
millions of gates interconnected through hundreds to
thousands of internal paths.
• In order to show the internal logic diagram in a concise
form, it is necessary to employ a special gate symbology
applicable to array logic.
3
4
Random-Access Memory
• A memory unit stores binary information in groups of bits called words.
• The communication between a memory and its environment is achieved
through data input and output lines, address selection lines, and control
lines that specify the direction of transfer.
Example: 1K words of 16 bit each.
So 1K and 16 bits means 2 bytes.
Thus, memory can accommodate 2K
bytes.
4
5
Content of a memory
• Each word in memory is
assigned an identification
number, called an address,
starting from 0 up to 2k-1,
where k is the number of
address lines.
• The number of words in a
memory with one of the
letters K=210, M=220, or
G=230.
64K = 216 2M = 221
4G = 232 5
Types of memories
• Memory units that lose stored information when
power is turned off are said to be volatile.
• Both static and dynamic, are of this category
since the binary cells need external power to
maintain the stored information.
• Nonvolatile memory, such as magnetic disk,
ROM, retains its stored information after removal
of power.
6
Static RAM
• SRAM consists essentially of internal latches that store
the binary information.
• The stored information remains valid as long as power is
applied to the unit.
• SRAM is easier to use and has shorter read and write
cycles.
• Low density, low capacity, high cost, high speed, high
power consumption.
7
Dynamic RAM
• DRAM stores the binary information in the form of electric
charges on capacitors.
• The capacitors are provided inside the chip by MOS
transistors.
• The capacitors tends to discharge with time and must be
periodically recharged by refreshing the dynamic memory.
8
Dynamic RAM
• DRAM offers reduced power consumption and larger
storage capacity in a single memory chip.
• High density, high capacity, low cost, low speed, low power
consumption.
9
Memories
• Volatile:
– Random Access Memory (RAM):
• SRAM "static"
• DRAM "dynamic"
• Non-Volatile:
– Read Only Memory (ROM):
• Mask ROM "mask programmable"
• EPROM "electrically programmable"
• EEPROM “electrically erasable electrically programmable"
• FLASH memory - similar to EEPROM with programmer
integrated on chip
10
Read-Only Memory (ROM)
Conventional Array Logic
Symbol Symbol
11
Read-Only Memory (ROM)
A block diagram of a ROM is shown below. It consists of
k address inputs and n data outputs.
The number of words in a ROM is determined from the
fact that k address input lines are needed to specify 2k
words.
12
Read-Only Memory (ROM)
Each output of the decoder represents a memory address.
Each OR gate must be considered as having 32 inputs.
A 2k X n ROM will have an internal k X 2k decoder and n OR gates.
• Design 8 x 4 ROM
13
Read-Only Memory (ROM)
3x8
• 8 x 4 ROM Decoder
Address Data 0
0 0 0 0000 1
0 0 1 1101 2
A2 I2
0 1 0 0011 3
A1 I1
0 1 1 1000 4
A0 I0
1 0 0 1111 5
1 0 1 1001 6
1 E 7
1 1 0 0111
1 1 1 0000
D3 D2 D1 D0
0 no connection
1 connection
14
Example
• Find a ROM-based circuit implementation for:
– f(a,b,c) = a’b’ + abc
– g(a,b,c) = a’b’c’ + ab + bc
– h(a,b,c) = a’b’ + c
• Solution:
– Express f(), g(), and h() in m() format (use
truth tables)
– Program the ROM based on the 3 m()’s
15
Example
– There are 3 inputs and 3 outputs, thus we
need a 8x3 ROM block.
• f = m(0, 1, 7)
• g = m(0, 3, 6, 7)
• h = m(0, 1, 3, 5, 7)
16
Types of ROMs
• Mask Programmed ROM
– Programmed during manufacturing
• Programmable Read-Only Memory (PROM)
– Blow out fuses to produce ‘0’
• Erasable Programmable ROM (EPROM)
– Erase all data by Ultra Violet exposure
• Electrically Erasable PROM (E2PROM)
– Erase the required data using an electrical
signal
17