MEMORY IN COMPUTER SYSTEMS
MEMORY FUNCTION
Function as storage to store command and data Consists of various types, organization,
technology, performance and price
Divided into two main types:
Main Memory Secondary Memory
2
Primary memory
Storing
programs and data (can be reached quickly by the processor) to be and is being implemented by the CPU
implementation of any program depends on the speed of memory transfer cycles. (Faster main memory, the computer execute faster)
3
The
Not all programs and data stored in main memory, since this would require a large main memory and thus will increase construction
costs
Consists of two types (RAM and ROM)
Socondary Memory
storing programs and data that are
less needed by the computer
The price and speed is lower compare with primary
memory
for example: hard disk, pen drive and magnetic disk programs and data in the secondary memory is
accessed by the CPU through the I / O controller
5
Memory Characteristics and the usage of chips
Comparative characteristics: position, capacity,
performance, type, and organization
Internal memory is available in CPU registers either
be viewed by a programmer or not.
Register containing information most frequently used
and information is accessible immediately.
Can be achieved directly by the CPU.
6
The primary memory contains the programs and
data that are being implemented.
Can be achieved directly by the CPU. Secondary memory contains information that is
not needed immediately and accessible by the CPU through the controller input and output devices such as disk and tape.
3 most important considerations in choosing memory
device:
Speed Prize Size
There is no memory device can provide the
speed, the best price and size simultaneously.
Memory device is differentiate by the distance from
the CPU.
The farther from the CPU, memory devices is more
cheaper and the access time is longer.
Generally, but not always, cheaper device that has
a large load.
In the pyramid of memory, the
memory is located under the pyramid supports the above devices.
9
Memory Pyramid
10
Memory
Primary
Secondary
RAM
ROM
Hard Disk
Diskette
11
PRIMARY MEMORY
RAM
ROM
SRAM
DRAM
ROM
PROM
EPROM
EEPROM
EAROM
12
Random access memory (RAM)
Memory can be read and written
Is the type of volatile memory that the contents will be
lost when the power supply at disconnect
Used to store data temporarily (when
the CPU processing)
13
14
15
16
17
18
19
Capacity data to store in memory
20
21
22
Kapasiti / muatan ingatan dinyatakan dalam
jumlah bit yang dapat disimpan iaitu :
Talian alamat : 16 (A0 A15)
Bas Data : 8 bit (D0-D7) Kapasiti ingatan = 2^16 =65536 bit
Bilangan Bit = Kapasiti x bilangan bas data = 65536 x 8 bit = 524288 bit
23
Kapasiti / muatan ingatan dinyatakan dalam jumlah
bit yang dapat disimpan iaitu :
24
Kendalian : Operasi menulis dan membaca (RAM)
Operasi menulis dan membaca akan dikawal oleh
logic pada pin CS (chip select) dan WE (write enable) Jika data ditulis ke dalam RAM maka pengkod alamat akan memberi logic rendah kepada pin CS dan WE Jika data hendak dibaca, pin CS di beri logic rendah dan pin WE diberi logic tinggi. Dengan itu RAM dipilih dan ingatan dapat dibaca.
25
Operation to write and read on RAM
Write and read operation will be controlled by logic on CS (chip select) and WE ( Write enable) pin.
Write to RAM Address Decoder set Pin CS & WE to low logic(0) Read RAM Address Decoder set Pin CS to low (0) & WE to high logic(1)
RAM was selected and Memory are readable
26
27
TYPE OF RAM
RAM
SRAM (STATIC RAM)
DRAM (DYNAMIC RAM)
28
RAM statik (SRAM) static random access memory
Using a flip - flop as memory cell
A cell is
usually implemented with six transistors MOS.
This transistors form flip-flop or a latch that can
store data as long as there is a power supply.
Flip flops can be set and reset again by
the write operation.
29
Data or information stored in static RAM is in the form
of a logic '1 'and '0',
Logic 1of the situation shows flip flop set Logic '0 flip flop in the reset state.
Single cell static RAM can
only store a binary value only, ie either a '0 'atau'1'.
Data or information stored will remain until a new write
operation is executed
30
Data stored as long as power is supplied to
the IC (volatile memory)
Used for high-performance computer systems such
as supercomputer for high speed processing.
Use high power. It is generate of excessive
heat if used too long.
31
SR Flip Flop
R 0 0
0 S 0 B Rajah 2.1 (a)
32
33
DRAM dynamic random access memory
Using only one capacitor and transistor as memory c
ell
Data is stored in a bit as electric charges in
the capacitor.
It must be in the fresh state every few milliseconds in
order to maintain its data.
Data is stored by the capacitor (its charge) -
0 and 1 in the limited time.
34
35
A full charge represents a logic '1 ', which is
cell storing data '1', while a logic '0 represents capacitor not keep charge.
Low power consumption compared to SRAM The price is cheaper than SRAM
36
Dynamic random access memory
Data stored in this form will not last long because the
capacitor will have discharge process.
So, at last the stored data will be
lost after some time.
Thus each cell of dynamic RAM requires refreshing
process to ensure that the stored charge is not drop.
37
Dynamic random access memory
This process is usually done every 2 milli seconds so
that the data stored in every cell of the dynamic RAM is not lost.
The nature of a dynamic RAM, it
may require a separate special circuit to control the process of refreshing.
This causes the construction or hardware systems
become more complex
38
Comparison between Static & dynamic Ram
Dynamic RAM and static RAM, each has advantages
and disadvantages of each other.
In terms of cost static RAM is
usually more expensive than dynamic RAM
But the dynamic RAM to provide a larger storage
space,
so normally the choice of memory to
be used in a system that depends on the size and needs
39
For a small system using static RAM is more practica
l because it does not require refreshing circuit.
But for large systems using dynamic RAM to save
costs while providing greater storage space.
40
Comparison between Static & dynamic Ram
Dynamic RAM Static RAM
Information / data stored in the form of charge Unit cell consists of a capacitor Simplified unit cell size More cheaper (cost / cell) Low power consumption Need a refreshing
Information stored by setting or resetting the flip flop. Set = 1 & Reset = 0 Unit cell consists of flip flop Larger unit cell size More expensive (cost/cell) High power consumption Does not require refreshing
41
Contoh
Jika RAM 256 bytes mempunyai I/O 4 bit hendak
disambung kepada mikropemproses (256bytes) yang mempunyai sistem bas data 8 bit. Maka jumlah IC RAM yang diperlukan ialah,
42
ROM
43
Type of ROM
ROM
ROM
PROM
EPROM
EEPRO M
EAROM
44
Read Only Memory (ROM)
ROM
is also known as volatile memory which means that contents remain even without a power supply.
nonthe
ROM is also a type of semiconductor memory that is
designed to store data permanently, or not always be changed as the beginning of the program required by each system
45
ROM
is used only when the system is first installed to fill the next self-test routine operating system from disk into RAM.
After the operating system is executed, it will no
require ROM during normal operation of the system
Because the information in RAM disappears when
the computer is off, all software should be loaded from the hard disk every time the computer is first installed.
46
Data can only be read from the ROM
During
normal operation, no new data is written into the ROM, but the data can be read from the ROM
Data stored in ROM during the fabrication process at
factory
47
Data entry process is called ROM programming . Some ROMs do not allow to change the data already
inserted in the ROM
There also can be erased and re-programmed as
often as desired.
ROM is used to store data and information that can
not be changed during system operate.
Primary use of ROM is to keep the program in the
computer
48
Non-volatile memory, the program will not disappear
when the microcomputer OFF.
When the microcomputer ON, the program store in
ROM will be executed
49
Operation :
To enable the read operation, the
pin CE (chip enable) and OE (output enable) is logic low, so the ROM will be selected and the data can be read.
50
ROM s Type
ROM
ROM
PROM
EPROM
EEPROM
EAROM
51
ROM (Read Only Memory)
It
is programmed by the manufacturer according to customer specifications
the manufacturing process of ROM, a mask set the initial contents of each address
During
Programmed using the photo mask technology Produced in large quantities due to long hours and high
cost
52
For
programming the memory, the customer provides the manufacturer ROM conte nt.
This information is used to create masks for
the customer.
Once
programmed, changed directly.
the
ROM
can
not
be
53
Any
errors, although small, require a long time and high costs to be corrected, but the fabrication cost per chip is very low
ROM is used for many such systems are sold with
the ROM character set in the video display controller.
54
PROM (Programmable Read Only Memory)
Read-only memory that can be programmed by the
user, but only once
It is programmed using a PROM burner Data or instruction will be permanently stored in
memory
55
Each bit in this ROM is a fuse that can be break
PROM is more expensive than Mask ROM but it is
easier to manufacturer because programmed system itself.
it
can
be
56
EPROM
57
EPROM
(Erasable Programmable Read Only Memory)
It is read-only memory that can be programmed and
erased
It is programmed using the EPROM programmer
or EPROM burner
If
to re programme the data, be erase.
all
the contents must
The contents can be erase using the EPROM eraser
(exposed to ultraviolet ray for12 minutes)
58
Cont
EPROM can be reused hundreds of times
EPROM popular among the designers of computer
systems because they can change the program repeatedly during the development of the system.
Once the system reached the final version and is
ready for use, the EPROM can be maintained in the circuit board.
59
EAPROM (Electrically Alterable PROM)
EAPROM does not require the whole chip to be
erased, rather it allows data alteration at user selected location.
Erasing and reprogramming of data in EAPROM is
done on board without withdrawing from the socket, and the duration is varied between several ms to several seconds.
The alteration of data in the cell is done by applying
electrical pulse to them.
60
The difference between EAPROM and EPROM is : Erasing and re-programming data of EPROM chips must removed from the socket
61
EEPROM
62
EEPROM
(Electrically Erasable Programmable Read Only Memory)
This
also uses a system similar to the MOS circuit EAPROM but erasing of data have been made on the electricity to all areas in EEPROM before it can be re-programmed.
is read-only memory that can be programmed and erased using the signal(pulse) of electricity (the only 10ms)
chip
It
63
Practice
1. Explain the operation of write and read on RAM
1. Differentiate SRAM and DRAM 2. Differentiate RAM from ROM memory types 3. Differentiate between the ROM, PROM, EPROM,
EAPROM, EEPROM
64
Basic Operation of Memory
65
66
67
68
Kendalian Am Ingatan
Basic Principle
Pilih alamat yang dicapai dalam ingatan bagi kendalian baca atau kendalian tulis. Pilih sama ada kendalian baca atau tulis yang akan dilaksanakan
Bekalkan data masukan yang akan disimpan dalam ingatan semasa kendalian tulis. Pegang data keluaran yang datang daripada ingatan semasa kendalian baca. Bolehkan (lumpuhkan) ingatan supaya ia dapat (atau tidak dapat) menyambut masukan alamat dan arahan baca/tulis.
69
Basic operation of Memory
Basic Principle
Select the address in memory accessible for read or write operations.
Choose either read or write operations to be performed
Provide input data to be stored in memory , during write operations.
Hold the output data comes from memory, during read operations.
Enable( or disable) memory , so that it can (or can not) receive the input address and instruction of read / write.
70
Write operation
In a read operation, information is transferred
from memory to the CPU.
For this operation, the address information to be provided by
the processor to memory.
Next, the READ order was issued When the memory saw this information ( information address
& READ order) , it produces data which is located at the address specified on the data bus.
Finally the data is read by CPU
71
Write Operation
Memory/ Ingatan
72
Write Operation
Transferring data from CPU to memory Data bus not be as memory ouput but function as input To write a data into memory: CPU provides the address where the data will be stored into
the address bus.
Next, CPU put the data to be stored into the data bus. Finally, WRITE order was issued When the memory seeing all of this information, it stores
data to the specified address.
73
Write Operation
Memory
74
Practice
1. Explain the operation to READ and WRITE on
memory (RAM)
75
Memory mapping
A microprocessor need a large memory size for
storing programs and data
Memory
may consist of registers, where each own name or address
number of large register has its
To enable the microprocessor to access data
on each register, the microprocessor must use the address assigned to each register
76
Apabila alamat daftar tersebut telah dicapai maka
mikropemproses boleh membaca / ambil sebarang data yang tersimpan pada memori tersebut atau menulis /simpan sebarang data pada alamat tersebut Semua alatan yang bersambung dengan mikropemproses mestilah diberi alamat yang unik. Selain dari ingatannya, semua peranti luaran seperti keyboard, monitor, parallel dan serial ports mesti diberi nama/alamat khas
77
Disebabkan terdapat beriburibu kedudukan ingatan
didalam sesuatu sistem, maka peta ingatan digunakan untuk memudahkan kita mengetahui kedudukan sebenar peranti didalam sesuatu sistem.
Peta ingatan adalah perlambangan bergambar yang
menunjukkan keseluruhan ruang ingatan di sesuatu sistem
78
Capacity of a memory chip is determined by the
address size and data size.
The memory of a computer system (which is
normally much greater than the capacity of a single chip) is composed of many memory chips with different address sizes and data sizes,
79
The memory address size is determined by the
amount of address lines that can be handled by the computer microprocessor.
80
Example
A microprocessor has the following characteristics:
CPU 8 bit data bus and 16 bit address bus 12 kbyte ROM 4 kbyte for I/O ports 16 kbyte RAM
81
Address size = 2n = 2 16 = 65,536 location or cell (each has 8 bit data size)
82
Hence, following memory mapping can be used : Device ROM I /O Capacity (bytes) 12 K 4K Address 0000 2FFF 3000 3FFF Range (decimal) 0 - 12287 12288 - 16383
RAM unused
Total
16 K 32 K
64K
4000 7FFF 8000 - FFFF
0000 - FFFF
16384 - 32767 32768 65535
0 - 65535
83
Note that each block has the start address and end address, to coincide the block capacity.
84
85
86
Example
A microprocessor has the following characteristics:
CPU 8 bit data bus and 16 bit address bus 12 kbyte ROM 4 kbyte for I/O ports 16 kbyte RAM
Determine memory mapping Determine the range, block capacity of memory above
87
As known:
Address size = 2n = 2 16 = 65,536 location or cell (each has 8 bit data size)
Hence, following memory mapping can be used : Device Capacity Address Range
(bytes) ROM I /O 12 K 4K ( hexadecimal) 0000 2FFF 3000 3FFF (decimal) 0 - 12287 12288 - 16383
RAM
unused
Total
16 K
32 K
64K
4000 7FFF
8000 - FFFF
0000 - FFFF
16384 - 32767
32768 65535
0 - 65535
88
Unused calculation
1Kbyte = 1024bit
Address size = 2n = 2 16 = 65,536
2 16 = 12K +4K + 16K + unused 2 16 = 32K + unused
65,536 = 32( 1024) + unused
65,536 = 32768 + unused unused = 65,536 32768 Unused = 32768 Block capasity unused = 32768/1024 = 32K
89
90
91
Alamat
Satu nombor yang menentukan tempat sesuatu
perkataan dalam ingatan. Setiap perkataan yang disimpan dalam peranti atau system ingatan mempunyai alamat yang unik. Alamat biasanya diungkapkan dalam nombor perduaan.(juga dlm nombor-nombor perlapanan, perpuluhan dan perenambelasan) Rajah menggambarkan satu ingatan kecil yang mengandungi lapan perkataan. Setiap satu daripada lapan perkataan ini mempunyai satu alamat khusus yang digambarkan sebagai satu nombor 3-bit yang berjulat daripada 000 hingga 111. Setiap kali kita merujuk kepada tempat perkataan yang tertentu dalam ingatan, kita menggunakan kod alamatnya untuk menunjukkannya
92
93
Masukan R/W
Talian ini menentukan kendalian ingatan yang akan
berlaku. Kendalian baca berlaku apabila R/W = 1 dan kendalain tulis berlaku bila R/W = 0.
Pemboleh Ingatan (Memory Enable)
Talian ini mesti diaktifkan tinggi bagi membolehkan
ingatan berkendali. Jika keadaan rendah pada masukan ini ia tidak akan menyambut masukan alamat dan R/W.
94
Sel Ingatan
Satu peranti atau litar elektrik yang digunakan bagi
menyimpan satu bit tunggal (0 atau 1). Contoh flipflop, bintik tunggal di atas pita atau cakera magnet.
Perkataan Ingatan
Satu kumpulan bit (sel) dalam satu ingatan yang
mewakili arahan atau data daripada jenis-jenis tertentu. Contoh daftar yang mempunyai lapan FF boleh dikatakan sebagai satu ingatan yang menyimpan satu perkataan 8-bit.
95
Byte
Satu sebutan khusus yang digunakan untuk
Muatan
perkataan 8-bit. Satu byte selalunya mempunyai 8bit dan merupakan saiz perkataan yang paling umum dalam mikrokomputer.
Satu cara mengkelaskan berapa banyakkah bit yang
dapat disimpan dalam sesuatu peranti ingatan.
96
Contoh
Muatan ingatan 4096 x 20. Bermaksud satu ingatan dapat menyimpan 4096
perkataan-perkataan 20 bit. Nombor pertama (4096) adalah bilangan-bilangan perkataan dan Nombor kedua (20) adalah bit per perkataan. Bilangan perkataan dalam satu ingatan biasanya berbilang dengan 1024. Sudah menjadi kebiasaan menggunakan 1K bagi mewakili 1024. Oleh itu satu ingatan yang mempunyai muatan storan 4K X 20 adalah 4096 X 20.
97
Contoh :
Satu ingatan separuh pengalir dengan muatan 2K X 8. Kira;
1.
2.
3.
perkataan yang dapat disimpan saiz perkataan jumlah bit
Penyelesaian : 1. 2K = 2 X 1024 = 2048 perkataan 2. Setiap perkataan adalah 8 bit. 3. 2048 perkataan X 20 bit per perkataan = 16,384 bit.
98
Kendalian Baca
Kendalian yang mengesan perkataan perduaan
yang tersimpan dalam satu tempat ingatan (alamat) yang tertentu dan kemudiannya memindahkannya ke peranti lain. Sebagai contoh kita mahu menggunakan perkataan 4, jadi kita perlu menjalankan satu kendalian baca pada alamat 100. Kendalian baca juga dipanggil kendalian ambil kerana satu perkataan diambil daripada ingatan.
99
Kendalian Tulis
Kendalian dengan satu perkataan baru dimasukkan
ke dalam satu tempat ingatan tertentu. Ia juga dirujuk sebagai satu kendalian simpan.
Masa Capaian
Pengukuran kepantasan satu kendalian peranti
ingatan. Ia merupakan jumlah masa yang diperlukan bagi melaksanakan satu kendalian baca. Lebih tepat lagi, ia adalah satu masa antara ingatan menerima satu masukan alamat yang baru dan data boleh didapati pada keluaran ingatan.
100
Ingatan Meruap/ Volatile
Sebarang ingatan yang memerlukan kuasa elektrik
bagi membolehkan menyimpan maklumat. Jika kuasa elektrik diputuskan, semua maklumat yang tersimpan dalam ingatan tersebut akan hilang. Kebanyakan daripada ingatan separuh pengalir meruap manakala semua ingatan teras magnet tidak meruap.
101
latihan
S1. Jika pemetaan alamat suatu mikropemproses 8 bit diberi seperti Rajah 5.2,
dapatkan : a) Saiz ROM b) Saiz RAM c) Jika saiz ROM 4096 words / 8 bits, berapakah ROM yang diperlukan d) Jika RAM (16384 words / 4 bits) berapa RAM yang diperlukan
102
103
Maka pemetaan alamat yang boleh digunakan adalah seperti berikut :
Device RAM I/O UNUSED ROM Capacity (bytes) 32K 4K 12K 16K Address 0000-7FFF 8000-8FFF 9000-BFFF C000-FFFF Range (decimal) 0-32767 32768-36863 36864-49151 49152-65535
104
Cara pengiraan julat (desimal)
105
Cara pengiraan kapasiti
106
Jika saiz ROM 4096 words/8 bits, berapakah ROM yang diperlukan?
107
Jika saiz RAM 16384 words/4 bits, berapakah RAM yang diperlukan?
108
S3. Terangkan keadaan pada setiap masukan dan keluaran semasa kandungan tempat alamat 00100 dibaca.
109
S4. Terangkan keadaan pada setiap masukan dan keluaran semasa perkataan data 1110 ditulis ke dalam tempat alamat 01101.
110
S5. Satu ingatan mempunyai muatan 4K x 8
a) Berapakah talian masukan data dan keluaran data
yang dipunyainya? b) Berapakah talian alamat yang dipunyainya? c) Apakah muatannya dalam byte dan bit
111