07 Memory and Programmable Logic
07 Memory and Programmable Logic
Hsi-Pin Ma ⾺席彬
https://eeclass.nthu.edu.tw/course/21649
Department of Electrical Engineerin
National Tsing Hua University
g
Outline
•Random-Access Memor
•Memory Decodin
•Read-Only Memor
•Programmable Logic Arra
•Programmable Array Logi
•Sequential Programmable Devices
Hsi-Pin Ma 2
g
[https://www.semianalysis.com/p/on-device-ai-double-edged-sword]
Hsi-Pin Ma 3
Category of Memory Arrays
Memory Arrays
1. Static RAM (SRAM) 1. Serial In Parallel Out (SIPO) 1. First In First Out (FIFO)
2. Dynamic RAM (DRAM) 2. Parallel In Serial Out (PISO) 2. Last In Fast Out (LIFO)
1. Mask ROM
2. Programmable ROM (PROM) (fuses)
3. Erasable Programmable ROM (EPROM)
4. Electrically Erasable Programmable ROM (EEPROM)
5. Flash ROM
Hsi-Pin Ma 4
Memory Unit
• A collection of storage cells together with associated
circuits needed to transfer information in and out of
storage
• RAM: Random-Access Memor
– Volatile (memory units that lose stored information when power is
turned off
– To accept new information for storage to be available later for us
– read/write operatio
• ROM: Read-Only Memor
– Nonvolatil
– The information inside can not be altered by writin
– Programmable devices are speci ed by some hardware procedure
Hsi-Pin Ma 5
.
fi
y
Random-Access Memory
Hsi-Pin Ma 6
Random-Access Memory
• Characteristic
– The time it takes to transfer data to or from any desired location is
always the same
– A memory unit stored binary information in groups of bits (words
– The size of the RAM is 2k x n bits. It has k address lines, n input data
lines and n output data lines
– For a commodity RAM, 16<=k<=30, n=1, 4, 8, 16, 32 or 64
2k-2
2k-1
Hsi-Pin Ma 8
)
Memory Cell
• A memory cell virtual model (binary storage cell)
1: read, 0: write
. Storage Components 7-15
Row select
Input D Q Output
C
MC
Write enable
Hsi-Pin Ma 9
Static RAM vs. Dynamic RAM
Hsi-Pin Ma 10
r
T 8-1
•Read operatio
– Apply the binary address to the address line
TABLE 8-1 – Activate the read input (1)
Control Inputs to a Memory Chip
0 X None
1 0 Write to selected word
1 1 Read from selected word
Hsi-Pin Ma 11
© 2008 Pearson Education, Inc.
n
– T1: providing the address and input data to the memory, and
the write/read control signa
– Address bus and read/write control must stay active for 50n
– The address and data signal must remain stable for a short
time after control signal is deactivated.
activated after
address stable
Hsi-Pin Ma 13
e
Hsi-Pin Ma 14
Memory Decoding
Hsi-Pin Ma 15
Memory Unit and Internal Construction
Hsi-Pin Ma 16
l
4x4 RAM
Hsi-Pin Ma 17
Hsi-Pin Ma 18
e
Hsi-Pin Ma 19
s
Hsi-Pin Ma 20
Error Detection and Correction
Hsi-Pin Ma 21
fi
y
fi
)
Hamming Code
Hsi-Pin Ma 22
k
6
0
6
0
7
0
7
0
8
8
9
0
0
9
0
0
⇒ C = C8C4C2C1 = 0000
Hsi-Pin Ma 24
y
1
0
2
0
3
1
4
1
d
5
1
6
0
7
0
8
1
)
9
0
)
1
0
0
1
0
fi
.
Example
Hsi-Pin Ma 26
Single Error Correction
Double Error Detection
•Hamming cod
– It can detect and correct only a single erro
– Multiple errors may not be detected
•Hamming code + a parity bi
– It can detect double errors and correct a single error
– The additional parity bit is the XOR of all the other
bits
•E.g.: the previous 12-bit coded wor
0 0 1 1 1 0 0 1 0 1 0 0 P13 ⇒ 0 0 1 1 1 0 0 1 0 1 0 0 1 (even
parity).
Hsi-Pin Ma 27
.
Hsi-Pin Ma 28
s
Read-Only Memory
Hsi-Pin Ma 29
Read-Only Memory (ROM)
Hsi-Pin Ma 30
f
Example
•32 x 8 ROM (25 x 8
– 5-to-32 decoder (k=5
– 32(25) outputs of the decoder are connected to each of the
eight OR gates, which have 32(25) input
– 32 x 8 internal programmable connections
Hsi-Pin Ma 31
)
Hsi-Pin Ma 32
t
Hsi-Pin Ma 33
Combinational Circuit Implementation
Hsi-Pin Ma 34
.
fi
s
Design Procedure
Hsi-Pin Ma 35
Hsi-Pin Ma 37
Types of ROM
• Mask programmable RO
– Data is programmed by IC manufacturer
– Economical if a large quantity of the same RO
• PROM: Programmable RO
– Fuses in the ROM are blown by high-voltage puls
– Universal programmer can program PROM on tim
Hsi-Pin Ma 38
M
Combinational PLDs
•PLD: Programmable logic devic
•Programmable two-level logi
– sum of product
– an AND array and an OR array
Hsi-Pin Ma 39
s
Hsi-Pin Ma 40
Sequential Programmable Devices
Hsi-Pin Ma 41
s
fl
D
fl
p
SPLD
SPLD macrocell
Hsi-Pin Ma 42
fl
fl
fi
CPLD
•Complex PL
– Put a lot of PLDs on a chi
– Adds wires between PLDs whose connections can be
programme
– Use fuse/EEPROM technology
Hsi-Pin Ma 43
d
FPGA
Hsi-Pin Ma 44
.
Hsi-Pin Ma 45
Simple FPGA Logic Cell (2/2)
Hsi-Pin Ma 46
Simple FPGA Routing Cell (1/2)
Hsi-Pin Ma 47
Simple FPGA Routing Cell (2/2)
Hsi-Pin Ma 48
Routed FPGA
Hsi-Pin Ma 49