Professional Documents
Culture Documents
UNIT 2 MEMORIES
Chapter Objectives
Stored Program Concept Addressing
Commodity Memories
Timing
Chapter Objectives
Reality of Memory Decoding Filling the Memory Map
Chapter Objectives
Caches
Read Only Memory (ROM) Punch Cards Harvard Architecture Current Memory Technology ROM / PROM
Chapter Objectives
More Electrostatic Memories
More Magnetic Memories Full Address Decoding
Magnetic Memories
Chapter Objectives
Designing Address Decoders
Address Decoding with Random Logic Address Decoding with m-line-to-nline Decoders
SECTION 1:
MEMORY
Commodity Memories
All von Neumann computers need memory
Small memories (a few Kbytes) are often on-chip Large memories could be in one or more modules
Transparent latches
Okay for logic but not as convenient
Smaller than D-types, but still large
DRAM
Very small area per bit
Memory Chips
The memory device shown is a 628512. This is a 4Mbit SRAM chip organized as 512 Kwords of 8 bits each. It therefore requires nineteen address lines and eight data lines.
Points to note:
All the control signals are active low
If the chip is not selected (/CS = H), nothing happens Write enable overrides read operations The data bus is bidirectional (either read or write saves pins)
Timing Issues
When accessing a memory location: ensure that
the correct data is accessed at the correct location no other memory locations are involved
Timing (2)
The timing diagram on the previous slide is only one of the possible approaches to strobing memory.
Timing (4)
Different processors (& different implementations) encode timing differently. This is okay, as long as timing is included somewhere on the datasheet.
Addressing
Some definitions: Byte now standardized as eight bits. Nibble four bits or half a byte
Word the natural size of operands, which varies from processor to processor (16 bits in MU0, 32 bits in ARM). Usually the width of the data bus.
Addressing (2)
Width the number of bits in a bus or a register Address range the number of elements which can be addressed.
Addressing (3)
The memory only performs one operation at a time. A memory operation requires the answers to some questions:
Do what? Control (read or write) With what? Data Where? Address
Address Decoding
A memory address may not always refer to one location The ARM processor example
Byte Access
Bus addressing is normally written in the format N[X:Y] Notice that when the processor reads word 00000000 it receives data on all its data lines (D[31:0]).
produces a 32-bit byte address. can perform read and write operations with 32-, 16- and 8-bit data.
Cleaner address space left just for true memory I/O space referenced with different instructions (e.g. IN and OUT )
limited addressing modes and, possibly, a smaller address range
Endianness
Endianness refers to the way sub-elements are numbered within an element
e.g. the way bytes are numbered in a word.
Harvard Architecture
Stored program computers with separate instruction and data buses The Harvard architecture logically separates the fetching of instructions from data reads and writes Its real purpose is to increase memory bandwidth
SECTION 2
Address Decoding
Although memory space is said to be flat, it does not mean the physical implementation is homogenous
Different portions of memory are used for different purposes: RAM, ROM, I/O Even if all the memory was of one type, we still have to implement it using multiple ICs
Address Decoding
This means that for a given valid address, one and only one memory-mapped component must be accessed Address decoding is the process of generating chip select (CS*) signals from the address bus for each device in the system
The address bus lines are split into two sections the N most significant bits are used to generate the CS* signals for the different devices the M least significant signals are passed to the devices as addresses to the different memory cells
Recall
Decoding Table
Device A9 MEM0 0 MEM1 0 MEM2 0 MEM3 0 MEM4 1 MEM5 1 MEM6 1 MEM7 1 A8 0 0 1 1 0 0 1 1 A7 0 1 0 1 0 1 0 1 A6 A5 A4 A3 A2 A1 A0
Solution
We will need 3 address lines to select each one of the 8 chips Each chip will need 7 address lines to address its internal memory cells
0 1 X X X
ROM2
PERI1 PERI2
0 0 0 0
0 0 0 0 0 0 0 0
0
0 0
0 0 0 0 0
0 0 0 0 1 0 0 0 0 1
1 X X
0 0 0 0 0 0
X X X X
0 0 0 0 0 0 0 0
X X
0 0 0 0
X X
0 0 0 0
X X
0 0 0 1
X
X X
Example
Lets assume the same microprocessor with 10 address lines (1KB memory) However, this time we wish to implement only 512 bytes of memory We still must use 128-byte memory chips Physical memory must be placed on the upper half of the memory map
Solution
Memory Map
X X X X
0 0 0 0 1
0 0 1 1
0 1 0 1
Also, recall
Versatile
Disadvantages
large PROM may be required for the decoding process depending on the values of p and m
making design and testing procedures complex
DEVICE
ADDRESS RANGE 000000 000FFF 001000 001FFF 002000 002FFF 00C000 00C7FF 00E000 00E0FF 00E100 00E1FF 00E200 00E2FF
ROM3
RAM1 PERIs (decoder)
2 blocks
1 block
2 entries in PROM
1 entry in PROM
System Address Lines Address range of A15 A14 A13 A12 A11 CPU PROM Address Input A4 A3 A2 A1 A0
System Device Enables PROM1 PROM2 PROM3 RAM1 PERIs PROM Data Output D7 D6 D5 D4 D3 D2 D1 D0
000000-0007FF 0
000800-000FFF 0 001000-0017FF 0 001800-001FFF 0 002000-0027FF 0 002800-002FFF 0 003000-0037FF 0 003800-003FFF 0 ----------
0
0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
0
0 0 0 1 1 1 1 1 0 0 0 0 1 1 1 1
0
0 1 1 0 0 1 1 1 0 0 1 1 0 0 1 1
0
1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 1
0
0 1 1 1 1 1 1 -do1 1 1 1 1 1 1 1 1
1
1 0 0 1 1 1 1 -do1 1 1 1 1 1 1 1 1
1
1 1 1 0 0 1 1 -do1 1 1 1 1 1 1 1 1
1
1 1 1 1 1 1 1 -do1 0 1 1 1 1 1 1 1
1
1 1 1 1 1 1 1 -do1 1 1 1 1 0 1 1 1
1
1 1 1 1 1 1 1
1
1 1 1 1 1 1 1
1
1 1 1 1 1 1 1