CH7 - Memory and Programmable Logic
CH7 - Memory and Programmable Logic
Logic
Md. Zubair Alam Emon
Memory
• Memory is a storage device that saves binary
information for later retrieval.
• Memory unit is a collection of cells capable of storing a
large quantity of binary info.
• Two types of memories:
– Random Access Memory (RAM)
• Allows memory read and memory write
– Read-Only Memory (ROM)
• Allows memory read only
• Memory Read
– Process of transferring stored info out of memory
• Memory Write
– Process of storing new info into memory
PLD
• Programmable Logic Device (PLD)
• PLD is a read-only memory
– ROM, PLA, PAL, FPGA (Field Programmable Gate
Array)
• Data is stored in a PLD through programming
– A hardware procedure that stores the bits.
• Within a PLD, internal gates are connected via
fuse like switches.
• Programming involves blowing fuses to obtain
particular configuration of the desired logic.
RAM
• Unlike CD/DVD/tape, memory read or
write time to any random location is same
(hence Random Access Memory)
• Stored info at each address is known as
word.
.
…
1K x 16 10-bit address lines
.
…
mem 16-bits in each word
Address ● ● ● ●
Word 3 ● ● ●
in BC out inputs
BC BC BC BC
Rd / Wr ● ● ● ●
Rd/Wr
2-Dimensional Decoding
Structure for a 1K-Word
Memory 5 X 32 decoder
Word 20
0 1 2 . . . . 20 . . . . 31
W (31+32)=63
● ● ● ● ●
0 ● ● ● ● ●
● ● ● ● ●
1
2
X binary address
5 X 32 decoder ● ● ● ● ● 01100 10100
12
X Y
Address #
● ● ● ● ● 12x32+20=404
31
Steps:
1. RAS=1; CAS=1 ;
2. RAS=0; CAS=1 ; 8-bit Row address given to address line.
3. RAS=1; CAS=1 ;
4. RAS=1; CAS=0 ; 8-bit Column address given to address line.
5. RAS=1; CAS=1 ;
Address Multiplexing
8-bit column
CAS ● ○ register
8 X 256
○ decoder
RAS ●
○ ○
Data Data
in out
• Done in large capacity memory cells (DRAM)
Read Only Memory
ROM
k inputs 2k
xn n outputs
(data)
Block
(address) ROM Diagram
0
1
I0 2
I1 3
..
I2 5 X 32
.
decoder
I3 28
I4 29
30
31
Internal Logic of
a 32 X 8 ROM A7 A6 A5 A4 A3 A2 A1 A0
ROM Truth Table
Inputs Outputs
I4 I3 I2 I1 I0 A7 A6 A5 A4 A3 A2 A1 A0
0 0 0 0 0 1 0 1 1 0 1 1 0
0 0 0 0 1 0 0 0 1 1 1 0 1
0 0 0 1 0 1 1 0 0 0 1 0 1
0 0 0 1 1 1 0 1 1 0 0 1 0
1 1 1 0 0 0 0 0 0 1 0 0 1
1 1 1 0 1 1 1 1 0 0 0 1 0
1 1 1 1 0 0 1 0 0 1 0 1 0
1 1 1 1 1 0 0 1 1 0 0 1 1
Example: A7 (I4I3I2I1I0) = Σ ( 0, 2, 3, …, 29 )
…
A0 (I4I3I2I1I0) = Σ ( 1, 2,… 28, 31 )
ROM Programming
Cross(x) means there is a connection
X X X X X
0 X
X X X
1
I0 X X X X
2
I1 3 X X X X
..
I2 5 X 32
decoder
I3 X X
28
I4 29 X X X X X
30 X X
31
X X X X
A7 (I4I3I2I1I0) = Σ ( 0, 2, 3, …, 29 ) A7 A6 A5 A4 A3 A2 A1 A0
Inputs Outputs
A2 A1 A0 B5 B4 B3 B2 B1 B0 Decimal
0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 1 1
0 1 0 0 0 0 1 0 0 4
0 1 1 0 0 1 0 0 1 9
1 0 0 0 1 0 0 0 0 16
1 0 1 0 1 1 0 0 1 25
1 1 0 1 0 0 1 0 0 36
1 1 1 1 1 0 0 0 1 49
Output as a function: B5 (A2A1A0) = Σ ( 6, 7) ; B4 (A2A1A0) = Σ ( 4, 5, 7) ; …..
Combo Ckt w/ ROM
B0 = A0
B0
B1 = 0 0 B1 A2 A1 A0 B5 B4 B3 B2
A0 ● B2 0 0 0 0 0 0 0
A1 8X4 B3 0 0 1 0 0 0 0
A2 ROM B4 0 1 0 0 0 0 1
B5 0 1 1 0 0 1 0
1 0 0 0 1 0 0
Block Diagram 1 0 1 0 1 1 0
1 1 0 1 0 1 1
0
1
A0 2
3
1 1 1 1 1 0 0
A1
A2
3X8
decoder
4
5
6 Simplified Truth Table to
7
Implement with a ROM
Internal Logic of
a 8 X 4 ROM B B B B
5 4 3 2
Types of ROMs
• PROM
– Programmable Read Only Memory
• EPROM
– Erasable Programmable Read Only Memory
• EEPROM ( E2PROM )
– Electrically Erasable Programmable Read
Only Memory
• Mask Programming
– Programmed by the manufacturer
Combinational PLDs
Fixed
Inputs
Programmable
AND array Outputs
OR array
(decoder)
Inputs
Programmable Fixed Outputs
AND array OR array
Programmabl
Inputs
Programmable
e OR array
Outputs
AND array
Programmable logic array (PLA)
PLA
AB’
○
X X X
F1 = AB’ + AC + A’BC’
A
X X X X AC F2 = (AC + BC)’
B ○
X X X BC
C ○
A’BC’
X X X X
X 0
X 1
C C’ B B’ A A’
F
1
F2
A’B’C’ 4 0 0 0 – 1
PAL
• Programmable Array Logic has fixed OR array
and a programmable AND array.
• Easier to program but less flexible then PLA
w ( A,B,C,D ) = Σ( 2, 12, 13 )
x ( A,B,C,D ) = Σ( 7, 8, 9, 10, 11, 12, 13, 14, 15 )
y ( A,B,C,D ) = Σ( 0, 2, 3, 4, 5, 6, 7, 8, 10, 11, 15 )
z ( A,B,C,D ) = Σ( 1, 2, 8, 12, 13 )
w = ABC’ + A’B’CD’
x = A + BCD
y = A’B + CD + B’D’
z = ABC’ + A’B’CD’ + AC’D’ + A’B’C’D
= w + AC’D’ + A’B’C’D
PAL Programming Table
AND Inputs
2 0 0 1 0 – + A’B’CD’
3 – – – – –
4 1 – – – – x=A
5 – 1 1 1 – + BCD
6 – – – – –
7 0 1 – – – y = A’B
8 – – 1 1 – + CD
9 – 0 – 0 – + B’D’
10 – – – – 1 z=w
11 1 – 0 0 – + AC’D’
12 0 0 0 1 – + A’B’C’D
A A’ B B’ C C’ D D’ w w’
1 x x x
Product
term ● w
2 x x x x
3 x
A ○ ● ● ○
● ●
4 x
5 x x x x
8 x x y
9 x x
●
C ○
●
10 x
11 x x x z
12 x x x x
D ○ ●
●
A A’ B B’ C C’ D D’ w w’
HW
• 7-1~7-3, 7-6~7-9, 7-14, 7-15, 7-18~7-23