Professional Documents
Culture Documents
Lecture 5
Memory Implementation
XADDR
RA1
Memory
RD1 JMP(R31,XADDR,XP)
ISEL 0 1
OPCODE RA C RB RC
+1 0 1
ASEL BSEL
0 1 2 1 0
A B
ALUFN ALU
A op B
Z
RA2
Memory
RD2
PCSEL 0 1 0 1 2 WDSEL
D WD WA WD WA RC
PC Memory Register File
WE WEMEM WE WERF
1
Todays Lecture:
How do we build these?
RA1
Memory
RD1
RA1 RA2
Register File Register File
RD1 RD2
RA2
Memory
RD2
WD WA WD WA
Memory Register File
WE WE
D
Q
32
E 32
CLK
2
How do we select 1 of 31 registers to read?
D
Q
E
D
Q
E
.
.
.
D
Q
E
D
Q
E
RD1 = <RA1>
.
.
.
D
Q
E
RA1
How Computers Work Lecture 5 Page 6
3
Q: How do we add a second port?
D
Q
E
D
Q
E
RD1 = <RA1>
.
.
.
D
Q
E
RA1
How Computers Work Lecture 5 Page 7
D
Q
E
RA1 RA2
How Computers Work Lecture 5 Page 8
4
Q: How do we write selectively?
D
Q
E
D
Q
E
RA1 RA2
How Computers Work Lecture 5 Page 9
D
Q 1
1 E 1
RA1 RA2
WA
How Computers Work Lecture 5 Page 10
5
The Decoder / Demultiplexor
To minimize wires:
WD WD
D D
Q 0 Q
0 E 0 E 0
D D
Q 1 Q
1 E 1 E 1
RD1
WERF . . RD2
. .
. .
D D
Q 30 Q
30 E 30 E 30
31 31 31
0 31
0
RA1
WA RA2
How Computers Work Lecture 5 Page 12
6
Q: What about the clocks?
WD
D
Q 0
0 E 0
D
Q 1
1 E 1
RA1 RA2
WA
How Computers Work Lecture 5 Page 13
D
Q 1
1 E 1
RA1 RA2
WA Clock
How Computers Work Lecture 5 Page 14
7
Q: Is it practical to do the big
Memory this way?
A: NO
How Computers Work Lecture 5 Page 15
.
. ...
.
8
1 Bit Cell
.
. ...
.
Sense Amplifiers
9
How about ROMs?
10
The N-Channel FET (NFET)
11
How do we implement multiple ports?
XADDR
RA1
Memory
RD1 JMP(R31,XADDR,XP)
ISEL 0 1
OPCODE RA C RB RC
+1 0 1
ASEL BSEL
0 1 2 1 0
A B
ALUFN ALU
A op B
Z
RA2
Memory
RD2
PCSEL 0 1 0 1 2 WDSEL
D WD WA WD WA RC
PC Memory Register File
WE WEMEM WE WERF
12
A: Stalls are done by:
Disabling WERF
Disabling Memory Write
Disabling PC write
13
Summary
What Did we learn today?
How to Implement Registers + Big Memory
Multi-Port Big Memories arent easy
Sequential Access (stalls + extra logic)
Wide Access + Some sort of cache + extra logic
Recitation
Review of todays lecture
14