Professional Documents
Culture Documents
Memory
Section 8-1 to 8-4
COMPUTER ORGANIZATION
Introduction to RAM
Picture of memory
Address
00000000
00000001
00000002
.
.
.
.
.
.
.
.
.
.
FFFFFFFD
FFFFFFFE
FFFFFFFF
Data
ADRS
DATA
CS
WR
OUT
CS
WR
0
1
1
x
0
1
Memory operation
None
Read selected word
Write selected word
Memory sizes
We refer to this as a 2k x n memory.
There are k address lines, which can specify one of 2k addresses.
Each address contains an n-bit word.
2k x n memory
k
n
ADRS
DATA
CS
WR
OUT
For example, a 224 x 16 RAM contains 224 = 16M words, each 16 bits long.
The RAM would need 24 address lines.
The total storage capacity is 224 x 16 = 228 bits.
Random Access Memory
Size matters!
Memory sizes are usually specified in numbers of bytes (8 bits).
The 228-bit memory on the previous page translates into:
228 bits / 8 bits per byte = 225 bytes
K
M
G
Prefix
Base 2
Kilo
210 = 1,024
Mega
220 = 1,048,576
Giga
230 = 1,073,741,824
Base 10
103 = 1,000
106 = 1,000,000
109 = 1,000,000,000
To confuse you, RAM size is measured in base 2 units, while hard drive
size is measured in base 10 units.
In this class, well only concern ourselves with the base 2 units.
Random Access Memory
A: 256 KB
B: 1 MB
C: 128 KB
D: 512 KB
Address
00000000
00000001
00000002
.
.
.
.
.
.
.
.
.
.
FFFFFFFD
FFFFFFFE
FFFFFFFF
Data
Reading RAM
2k x n memory
k
n
ADRS
DATA
CS
WR
OUT
10
Writing RAM
2k x n memory
k
n
ADRS
DATA
CS
WR
OUT
11
Static memory
12
My first RAM
13
The C in LogicWorks
means conflict.
This can get expensive, with many wires and gates with large fan-ins.
Random Access Memory
14
IN
OUT
0
1
1
x
0
1
Disconnected
0
1
15
16
17
A 4 x 4 RAM
DATA and OUT are now each four bits long, so you can read and write
four-bit words.
18
How many address lines do we need for a 64 MB RAM with 32-bit words
?
A: 23
B: 20
C: 24
D: 21
19
We can use small RAMs as building blocks for making larger memories,
by following the same principles as in the previous examples.
As an example, suppose we have some 64K x 8 RAMs to start with:
64K = 26 x 210 = 216, so there are 16 address lines.
There are 8 data lines.
16
8
20
21
8
16
22
8
16
23
Address ranges
8
16
24
You can also combine smaller chips to make wider memories, with the
same number of addresses but more bits per word.
How do we create a 64K x 16 RAM from two 64K x 8 chips?
25
You can also combine smaller chips to make wider memories, with the
same number of addresses but more bits per word.
Here is a 64K x 16 RAM, created from two 64K x 8 chips.
The left chip contains the most significant 8 bits of the data.
The right chip contains the lower 8 bits of the data.
8
16
26
i-clicker
We want to build a memory with 4-byte words and a capacity of 2 21 bits.
1) How many 2K x 8 RAM chips are needed?
2) How many address lines are needed for the memory?
3) How many of these address lines are connected to the address
inputs of the RAM chips?
4) How many of these address lines will be used to select the
appropriate RAM chip(s)?
5) What size decoder is needed to build the memory?
27
Summary
28