You are on page 1of 37

1.

MEMORY TYPES

2
1. RAM (random access memory)
 Volatile, i.e. retains data as long as power is applied
 Temporarily stores data
 Used to store currently running programs

2. ROM (read only memory)


 Non-volatile
 Permanent data storage
 Used for computer BIOS (basic input output system)

3
3. Hard Drive
 Introduced in 1956 with a capacity of 5MB at a cost of $50,000 (now
several TBs are at <$200)
 Mechanical drives that rely on a pin moving to magnetically read data
 Lifespan: Theoretically infinite read/write capability

4. Solid State Drive (SSD)


 Introduced in 1976
 No mechanical parts (they can randomly access data)
 Costs more per GB than HD (but typically worth it for high performance)
 Lifespan: ~10 years

4
HD: 0.1-1.7 MBps SSD: 50-250 MBps

5
A. PROM: one-time field programmable

B. EPROM: reprogrammed more than one by


exposing to UV rays for 20 minutes.

C. EEPROM: electrically erasable programmable


ROM through applying higher than normal voltage.

Note: Flash memory (usb/Sdcards/SSD) is a form of EEPROM that


uses normal PC volts for erasing and reprogramming
6
7
SRAM DRAM
Static RAM Dynamic RAM

FF: 6trs (less dense) C & trans. (more dense)

No refreshing required Requires refreshing

More expensive Less expensive

faster slower

CACHE MAIN MEMORY (RAM)

Up to 32MB up 32GB

8
What happens when the RAM is full?

If RAM fills up, the computer's processor must


repeatedly go to the hard disk to overlay the
old data in RAM with new data. This process
slows the computer's operation

9
Virtual memory is a storage scheme that
provides user an illusion of having a very
big main memory. This is done by treating
a part of secondary memory as the main
memory.

 More virtual RAM allowing more/larger


programs to run simultaneously

 Slower than having larger physical RAM,


e.g. takes more time in switching between
applications.

10
What happens when a large file is transferred between
memories?

11
 DMA Controller is a hardware device that allows
I/O devices to directly access memory with less
participation of the processor.

12
 Burst Mode: In burst mode, the full data block is transmitted in a continuous
sequence. Burst mode totally hacks the system bus causing the CPU to be
inactive for a considerable long time.
 Cycle Stealing Mode: used in a system where the CPU cannot be disabled for
the length of time required for the burst transfer mode. In the cycle stealing
mode, the DMA controller obtains the access to the system bus by using the BR
(Bus Request) and BG (Bus Grant) signals. These two signals control the
interface between the CPU and the DMA controller.
 Transparent Mode: takes the longest time to transfer data blocks, but it is also
the most efficient mode in terms of overall system performance. In transparent
mode, the DMA controller transfers data only when the CPU performs
operations that do not use the system buses.
 CPU never stops executing its programs
 H/W needs to determine when CPU is not using the system buses,
which can be complicated.

13
2 MEMORY ADDRESSING

14
How are the various RAM chips addressed?

15
a) Address lines (AN…A0)

b) Data lines (OK…O0):


typically 8 bits

c) Read/Write Enable

d) Chip Select (CS)

16
a) Address lines:?? 15

b) Data lines:?? 8

c) Read/Write Enable

d) Chip Select

17
Assume a simple microprocessor with 10 address lines (1KB
memory) and we wish to implement all its memory space using
128x8 memory chips.
a) How many memory chips are needed?
b) How many address lines are needed to access any word in the
total memory?
c) How many address lines are common to all chips?
d) How many address line must be decoded for chip select?
e) What is the size of the decoder?

18
Assume a simple microprocessor with 10 address lines (1KB
memory) and we wish to implement all its memory space using
128x8 memory chips.
a) How many memory chips are needed?
b) How many address lines are needed to access any word in the
total memory?
c) How many address lines are common to all chips?
d) How many address line must be decoded for chip select?
e) What is the size of the decoder?

19
20
21
A computer system uses RAM chips of 256x8. The computer system
require 4K bytes of RAM
a) How many memory chips are needed?
b) How many address lines are needed to access any word in the
total memory?
c) How many address lines are common to all chips?
d) How many address line must be decoded for chip select?
e) What is the size of the decoder?

22
A computer system uses RAM chips of 256x8. The computer system
require 4K bytes of RAM
a) How many memory chips are needed? 16
b) How many address lines are needed to access any word in the
total memory?12
c) How many address lines are common to all chips? 8
d) How many address line must be decoded for chip select? 4
e) What is the size of the decoder? 4x16

23
A computer system has 20 address bits. It is required to design a
64kx8 ROM memory using 8kx8 ROM chips (IC No.: 2764) for
addresses F0000H to FFFFFH. (Slides)
a) How many ROM chips are needed? 8
b) How many address lines are common to all ROM chips? 16
c) What is the size of the decoder?3x8

24
25
A computer system has 12 address bits and 8 bits data. Available are
RAM chips of size 256Bytes.
a) What will be the required decoder size to build the complete
memory?4x16
b) Indicate the chip number and memory location to be accessed by the
address 0x4567H

26
A 16-data bits and 18-address bits computer system requires 128kB
of RAM and 64kB of ROM using 32kB RAM chips and 16kB
ROM chips. (Slides)
a) How many RAM chips are needed? 4
b) How many address lines are common to all RAM chips? 17
c) How many ROM chips are needed? 4
d) How many address lines are common to all ROM chips? 16
e) What is the size of the decoder?3x8

27
The memory system for the 8086 that contains a 64K byte EROM and 128K byte SRAM 28
3 CACHE MEMORY

29
Registers B
1. Speed  Inside or
2. Cost  close to CPU
Cache (~MB )

RAM (~GB)
Outside
CPU
Hard Disk (~ TB)
30
Why do we use a memory hierarchy in computers?

31
Why do we use a memory hierarchy in computers?

Because we want memory to be:


 Fast
 Large
 Cheap
So, for storage we use SSD/HD which
is large and cheap, and for the
running programs we use the RAM
which is faster yet more expensive.

32
Cache memory is an extremely fast memory that
acts as a buffer between RAM and the CPU.

https://www.geeksforgeeks.org/cache-memory-in-computer-organization/

33
 Cache memory is used to reduce the average time
to access data from the main memory (RAM).

 Cache memory holds data and instructions that are


most likely to be requested so that they are
immediately available to the processor when
needed.

How do we know which memory objects are likely to be requested?


34
There are two aspects of locality:
1) Temporal locality: if a memory location is referenced,
then it will tend to be referenced again soon. (Loops)
 so, we keep most recently accessed items in cache

2) Spatial locality if a memory location is referenced,


then other locations nearby will tend to be referenced
soon. (Arrays)
 so, we move blocks of memory together.

35
When the processor needs to read or write a location in
main memory, it first checks for a corresponding entry in
the cache.
 Cache hit: processor finds that the memory location is in
the cache, and data is read from cache.
 Cache miss: processor does not find the memory
location in the cache. For a cache miss, the cache gets a
copy of the data from the main memory, then the
request is fulfilled from the contents of the cache.

36
 The performance of cache memory is frequently
measured of the hit ratio:

 Acceptable cache performance should be around 90%.

 Cache performance can be enhanced by using:


(1) higher cache block size
(2) higher associativity

37

You might also like