Anda di halaman 1dari 94

Organisasi dan Arsitektur

Komputer : Perancangan Kinerja


(William Stallings)

Chapter 4
Memori Internal

IUS HWNet- 1
Karakteristik Memori

 Lokasi
 Kapasitas
 Unit transfer
 Metode Akses
 Kinerja
 Jenis fisik
 Sifat-sifat fisik
 Organisasi
IUS HWNet- 2
Lokasi

 CPU (register)
 Internal (main memori)
 External (secondary memori)

IUS HWNet- 3
Kapasitas

 Ukuran Word
 Satuan alami organisasi memori
 Banyaknya words
 atau Bytes

IUS HWNet- 4
Satuan Transfer
 Internal
 Jumlah bit dalam sekali akses
 Sama dengan jumlah saluran data (= ukuran word)
 External
 Dalam satuan block yg merupakan kelipatan word
 Addressable unit
 Lokasi terkecil yang dpt dialamati secara uniq
 Secara internal biasanya sama dengan Word
 Untuk disk digunakan satuan Cluster

IUS HWNet- 5
Metode Akses
 Sekuensial
 Mulai dari awal sampai lokasi yang dituju
 Waktu akses tergantung pada lokasi data dan lokasi
sebelumnya
 Contoh tape
 Direct
 Setiap blocks memilki address yg unique
 Pengaksesan dengan cara lompat ke kisaran umum (general
vicinity) ditambah pencarian sekuensial
 Waktu akses tdk tergantung pada lokasi dan lokasi sebelumnya
 contoh disk

IUS HWNet- 6
Metode Akses
 Random
 Setiap lokasi memiliki alamat tertentu
 Waktu akses tdk tergantung pada urutan akses sebelumnya
 Contoh RAM
 Associative
 Data dicarai berdasarkan isinya bukan berdasarkan alamatnya
 Waktu akses tdk tergantung terhadap lokasi atau pola akses
sebelumnya
 Contoh: cache

IUS HWNet- 7
Hierarki Memori

 Register
 Dalam CPU
 Internal/Main memory
 Bisa lebih dari satu level dengan adanya cache
 “RAM”
 External memory
 Penyimpan cadangan

IUS HWNet- 8
Performance
 Access time
 Waktu untuk melakukan operasi baca-tulis
 Memory Cycle time
 Diperlukan waktu tambahan untuk recovery sebelum
akses berikutnya
 Access time + recovery
 Transfer Rate
 Kecepatan transfer data ke/dari unit memori

IUS HWNet- 9
Jenis Fisik

 Semiconductor
 RAM
 Magnetic
 Disk & Tape
 Optical
 CD & DVD
 Others
 Bubble
 Hologram
IUS HWNet- 10
Karakteristik

 Decay
 Volatility
 Erasable
 Power consumption

Organisasi
 Susunan fisik bit-bit untuk membentuk word

IUS HWNet- 11
Kendala Rancangan

 Berapa banyak?
 Capacity
 Seberapa cepat?
 Time is money
 Berapa mahal?

IUS HWNet- 12
Hierarki

 Registers
 L1 Cache
 L2 Cache
 Main memory
 Disk cache
 Disk
 Optical
 Tape
IUS HWNet- 13
Ingin Komputer yg Cepat?

 Komputer hanya menggunakan static RAM


 Akan sangat cepat
 Tidak diperlukan cache
 Apa perlu cache untuk cache?
 Harga menjadi sangat mahal

IUS HWNet- 14
Locality of Reference

 Selama berlangsungnya eksekusi suatu


program, referensi memori cenderung untuk
mengelompok (cluster)
 Contoh: loops

IUS HWNet- 15
Memori Semiconductor

 RAM
 Penamaan yang salah karena semua memori
semiconductor adalah random access (termasuk
ROM)
 Read/Write
 Volatile
 Penyimpan sementara
 Static atau dynamic

IUS HWNet- 16
Dynamic RAM

 Bit tersimpan berupa muatan dalam capacitor


 Muatan dapat bocor
 Perlu di-refresh
 Konstruksi sederhana
 Ukuran per bit nya kecil
 Murah
 Perlu refresh-circuits
 Lambat
 Main memory

IUS HWNet- 17
Static RAM

 Bit disimpan sebagai switches on/off


 Tidk ada kebocoran
 Tdk perlu refreshing
 Konstruksi lebih complex
 Ukuran per bit lebih besar
 Lebih mahal
 Tidak memerlukan refresh-circuits
 Lebih cepat
 Cache

IUS HWNet- 18
Read Only Memory (ROM)

 Menyimpan secara permanen


 Untuk
 Microprogramming
 Library subroutines
 Systems programs (BIOS)
 Function tables

IUS HWNet- 19
Jenis ROM

 Ditulisi pada saat dibuat


 Sangat mahal
 Programmable (once)
 PROM
 Diperlukan peralatan khusus untuk memprogram
 Read “mostly”
 Erasable Programmable (EPROM)
 Dihapus dg sinar UV
 Electrically Erasable (EEPROM)
 Perlu waktu lebih lama untuk menulisi
 Flash memory
 Menghapus seleuruh memori secara electris

IUS HWNet- 20
Organisasi

 16Mbit chip dapat disusun dari 1M x 16 bit word


 1 bit/chip memiliki 16 lots dengan bit ke 1 dari
setiap word berada pada chip 1
 16Mbit chip dapat disusun dari array: 2048 x
2048 x 4bit
 Mengurangi jumlah addres pins
 Multiplex row address dg column address
 11 pins untuk address (211=2048)
 Menambah 1 pin kapasitas menjadi 4x
IUS HWNet- 21
Refreshing

 Rangkaian Refresh diamsukkan dalam chip


 Disable chip
 Pencacahan melalui baris
 Read & Write back
 Perlu waktu
 Menurunkan kinerja

IUS HWNet- 22
Contoh: 16 Mb DRAM (4M x 4)

IUS HWNet- 23
Packaging

IUS HWNet- 24
Organisation
Module

IUS HWNet- 25
Organisation Modul (2)

IUS HWNet- 26
Koreksi kesalahan

 Rusak berat
 Cacat/rusak Permanent
 Rusak ringan
 Random, non-destructive
 Rusak non permanent
 Dideteksi menggunakan Hamming code

IUS HWNet- 27
Error Correcting Code Function

IUS HWNet- 28
Cache

 Memori cepat dg kapasitas yg sedikit


 Terletak antara main memory dengan CPU
 Bisa saja diletakkan dalam chip CPU atau
module tersendiri

IUS HWNet- 29
Operasi pada Cache

 CPU meminta isi data dari lokasi memori


tertentu
 Periksa data tersebut di cache
 Jika ada ambil dari cache (cepat)
 Jika tidak ada, baca 1 block data dari main
memory ke cache
 Ambil dari cache ke CPU
 Cache bersisi tags untuk identitas block dari
main memory yang berada di cache

IUS HWNet- 30
Desain Cache

 Ukuran (size)
 Fungsi Mapping
 Algoritma penggantian (replacement algrthm)
 Cara penulisan (write policy)
 Ukuran Block
 Jumlah Cache

IUS HWNet- 31
Size

 Cost
 Semakin besar semakin mahal
 Speed
 Semakin besar semakin cepat
 Check data di cache perlu waktu

IUS HWNet- 32
Organisasi Cache

IUS HWNet- 33
Fungsi Mapping

 Ukuran Cache 64kByte


 Ukuran block 4 bytes
 diperlukan 16k (214) alamat per alamat 4 bytes
 Jumlah jalur alamat cache 14
 Main memory 16MBytes
 Jalur alamat perlu 24 bit
 (224=16M)

IUS HWNet- 34
Direct Mapping

 Setiap block main memory dipetakan hanya ke


satu jalur cache
 Jika suatu block ada di cache, maka tempatnya
sudah tertentu
 Address terbagi dalam 2 bagian
 LS-w-bit menunjukkan word tertentu
 MS-s-bit menentukan 1 blok memori
 MSB terbagi menjadi field jalur cache r dan tag
sebesar s-r (most significant)

IUS HWNet- 35
Struktur Alamat Direct Mapping
Tag s-r Line or Slot r Word w
8 14 2

 24 bit address
 2 bit : word identifier (4 byte block)
 22 bit: block identifier
 8 bit tag (=22-14)
 14 bit slot atau line
 2 blocks pada line yg sama tidak boleh memiliki tag yg
sama
 Cek isi cache dengan mencari line dan Tag

IUS HWNet- 36
Table Cache Line pada Direct
Mapping

 Cache line blocks main memori


 0 0, m, 2m, 3m…2s-m
 1 1,m+1, 2m+1…2s-m+1

 m-1 m-1, 2m-1,3m-1…2s-1

IUS HWNet- 37
Organisai Cache Direct
Mapping

IUS HWNet- 38
Contoh Direct Mapping

IUS HWNet- 39
Keuntungan & Kerugian Direct
Mapping

 Sederhana
 Murah
 Suatu blok memiliki lokasi yang tetap
 Jika program mengakses 2 block yang di map ke line
yang sama secara berulang-ulang, maka cache-miss
sanagat tinggi

IUS HWNet- 40
Associative Mapping

 Blok main memori dpt di simpan ke cache line


mana saja
 Alamat Memori di interpresi sbg tag dan word
 Tag menunjukan identitas block memori
 Setiap baris tag dicari kecocokannya
 Pencarian data di Cache menjadi lama

IUS HWNet- 41
Organisasi Cache Fully
Associative

IUS HWNet- 42
Contoh Associative Mapping

IUS HWNet- 43
Struktur Address Associative
Mapping
Word
Tag 22 bit 2 bit
 22 bit tag disimpan untuk blok data 32 bit
 tag field dibandingkan dg tag entry dalam cache
untuk pengecekan data
 LS 2 bits dari address menunjukkan 16 bit word
yang diperlukan dari 32 bit data block
 contoh
 Address Tag Data Cache
line
 FFFFFC FFFFFC 24682468 3FFF
IUS HWNet- 44
Set Associative Mapping

 Cache dibagi dalam sejumlah sets


 Setiap set berisi sejumlah line
 Suatu blok di maps ke line mana saja dalam set
 misalkan Block B dapat berada pada line mana saja
dari set i
 Contoh: per set ada 2 line
 2 way associative mapping
 Suatu block dpt berada pada satu dari 2 lines dan
hanya dalam 1 set
IUS HWNet- 45
Contoh Set Associative
Mapping

 Nomor set 13 bit


 Nomor Block dlm main memori adl modulo 213
 000000, 00A000, 00B000, 00C000 … map ke set
yang sama

IUS HWNet- 46
Organisasi Cache: Two Way Set
Associative

IUS HWNet- 47
Struktur Address: Set
Associative Mapping

Word
Tag 9 bit Set 13 bit 2 bit

 set field untuk menentukan set cache set yg


dicari
 Bandingkan tag field untuk mencari datanya
 Contoh:
 Address Tag Data Set number
 1FF 7FFC 1FF 12345678 1FFF
 001 7FFC 001 11223344 1FFF
IUS HWNet- 48
Contoh Two Way Set
Associative Mapping

IUS HWNet- 49
Replacement Algorithms (1)
Direct mapping

 Tidak ada pilihan


 Setiap block hanya di map ke 1 line
 Ganti line tersebut

IUS HWNet- 50
Replacement Algorithms (2)
Associative & Set Associative
 Hardware implemented algorithm (speed)
 Least Recently used (LRU)
 e.g. in 2 way set associative
 Which of the 2 block is lru?
 First in first out (FIFO)
 replace block that has been in cache longest
 Least frequently used
 replace block which has had fewest hits
 Random

IUS HWNet- 51
Write Policy

 Must not overwrite a cache block unless main


memory is up to date
 Multiple CPUs may have individual caches
 I/O may address main memory directly

IUS HWNet- 52
Write through

 All writes go to main memory as well as cache


 Multiple CPUs can monitor main memory traffic
to keep local (to CPU) cache up to date
 Lots of traffic
 Slows down writes

 Remember bogus write through caches!

IUS HWNet- 53
Write back

 Updates initially made in cache only


 Update bit for cache slot is set when update
occurs
 If block is to be replaced, write to main memory
only if update bit is set
 Other caches get out of sync
 I/O must access main memory through cache
 N.B. 15% of memory references are writes

IUS HWNet- 54
Pentium Cache

 Foreground reading
 Find out detail of Pentium II cache systems
 NOT just from Stallings!

IUS HWNet- 55
Newer RAM Technology (1)

 Basic DRAM same since first RAM chips


 Enhanced DRAM
 Contains small SRAM as well
 SRAM holds last line read (c.f. Cache!)
 Cache DRAM
 Larger SRAM component
 Use as cache or serial buffer

IUS HWNet- 56
Newer RAM Technology (2)

 Synchronous DRAM (SDRAM)


 currently on DIMMs
 Access is synchronized with an external clock
 Address is presented to RAM
 RAM finds data (CPU waits in conventional DRAM)
 Since SDRAM moves data in time with system clock,
CPU knows when data will be ready
 CPU does not have to wait, it can do something else
 Burst mode allows SDRAM to set up stream of data and
fire it out in block
IUS HWNet- 57
SDRAM

IUS HWNet- 58
Newer RAM Technology (3)

 Foreground reading
 Check out any other RAM you can find
 See Web site:
 The RAM Guide

IUS HWNet- 59
Memori Eksternal

IUS HWNet- 60
Jenis Memori External

 Magnetic Disk
 RAID
 Removable
 Optical
 CD-ROM
 CD-Writable (WORM)
 CD-R/W
 DVD
 Magnetic Tape
61
Magnetic Disk

 Metal atau plastic dilapisi dg material yg bersifat


magnet (iron oxide)
 Jenis kemasan
 Floppy
 Winchester hard disk
 Removable hard disk

62
Format dan Organisasi Data

 Lingkaran konsentris atau track


 Ada Gap antar track
 Gap sempit, kapasitas bertambah
 Jumlah bit per track sama (kerapatan bervariasi)
 Kecepatan putar tetap
 Track dibagi menjadi beberapa sector
 Ukuran minimum block adalah satu sector
 Satu block bisa berisi lebih dari satu sector

63
Fixed/Movable Head Disk

 Fixed head
 Ada satu head (r/w) per track
 Head diletakkan pada tangkai yg tetap
 Movable head
 Hanya ada satu head per side
 Diletakkan pada tangkai yg dpt bergerak

64
Removable / Nonremovable

 Removable disk
 Dapat dilepas dari drive dan diganti dg disk lain
 Memberikan kapasitas simpanan yg tak terbatas
 Mudah melakukan transfer data antar sistem
 Nonremovable disk
 Terpasanang permanen dalam drive

65
Floppy Disk

 8”, 5.25”, 3.5”


 Kapasitas kecil
 sampai 1.44Mbyte (ada yg 2.88M)
 Lambat
 Umum dipakai
 Murah

66
Winchester Hard Disk (1)

 Dikembangkan oleh IBM di Winchester (USA)


 Dikemas dalam satu unit
 Berisi satu cakram atau lebih
 Head sangat kecil
 Handal

67
Winchester Hard Disk (2)

 Umum digunakan
 Murah
 Sbg external storage yg sangat cepat
 Kapasitas semakin besar
 Dalam orde GB

68
Removable Hard Disk
 ZIP
 Murah
 Banyak digunakan
 100MB
 JAZ
 Mahal
 1G
 L-120 (a: drive)
 Juga dpt untuk membaca 3.5” floppy

69
Pencarian Sector

 Harus dapat mengenali awal suatu track dan


sector
 Format disk
 Menambahkan informasi tambahan
 Memberi tanda awal track dan sector

70
ST506 format (old!)

Gap1 Id Gap2 Data Gap3 Gap1 Id Gap2 Data Gap3

Sync Sync
Byte Track Head Sector CRC Data CRC
Byte

71
Karakteristik

 Fixed head atau movable head


 Removable disk atau fixed disk
 Single side atau double side
 Single platter atau multiple platter
 Mekanisme head
 Contact (Floppy)
 Fixed gap
 Flying (Winchester)

72
Multiple Platter

 Satu head per side


 Semua head di-join dan di-align
 Track-track yg setiap platter membentuk
cylinder
 Data dipecah berdasarkan cylinder
 Mengurangi gerakan head
 Meningkatkan kecepatan (transfer rate)

73
Kecepatan

 Seek time
 gerakan head ke track yg dituju
 (Rotational) latency
 Putar platter sampai posisi data dibawah head
 Access time = Seek + Latency
 Transfer rate

74
RAID
 Redundant Array of Independent Disks
 Redundant Array of Inexpensive Disks
 Ada 6 level
 Tidak berhirarki
 Sejumlah disks (fisik) yg dipandang sbg satu
drive (logical) oleh Sistem Operasi
 Data tersebar diantara disk fisik

75
RAID 0

 No redundancy
 Data striped across all disks
 Round Robin striping
 Increase speed
 Multiple data requests probably not on same disk
 Disks seek in parallel
 A set of data is likely to be striped across multiple
disks

76
RAID 1
 Mirrored Disks
 Data is striped across disks
 2 copies of each stripe on separate disks
 Read from either
 Write to both
 Recovery is simple
 Swap faulty disk & re-mirror
 No down time
 Expensive
77
RAID 2
 Disks are synchronized
 Very small stripes
 Often single byte/word
 Error correction calculated across corresponding bits on
disks
 Multiple parity disks store Hamming code error
correction in corresponding positions
 Lots of redundancy
 Expensive
 Not used

78
RAID 3

 Similar to RAID 2
 Only one redundant disk, no matter how large
the array
 Simple parity bit for each set of corresponding
bits
 Data on failed drive can be reconstructed from
surviving data and parity info
 Very high transfer rates

79
RAID 4

 Each disk operates independently


 Good for high I/O request rate
 Large stripes
 Bit by bit parity calculated across stripes on
each disk
 Parity stored on parity disk

80
RAID 5

 Like RAID 4
 Parity striped across all disks
 Round robin allocation for parity stripe
 Avoids RAID 4 bottleneck at parity disk
 Commonly used in network servers

 N.B. DOES NOT MEAN 5 DISKS!!!!!

81
Optical Storage CD-ROM
 Originally for audio
 650Mbytes giving over 70 minutes audio
 Polycarbonate coated with highly reflective coat,
usually aluminum
 Data stored as pits
 Read by reflecting laser
 Constant packing density
 Constant linear velocity

82
CD-ROM Drive Speeds

 Audio is single speed


 Constant linier velocity
 1.2 ms-1
 Track (spiral) is 5.27km long
 Gives 4391 seconds = 73.2 minutes
 Other speeds are quoted as multiples
 e.g. 24x
 The quoted figure is the maximum the drive can
achieve
83
CD-ROM Format

FF Layered

Sector
Mode
Min
00 x 10 00 Sec Data ECC

12 byte 4 byte 2048 byte 288 byte


Sync Id
2352 byte
 Mode 0=blank data field
 Mode 1=2048 byte data+error correction
 Mode 2=2336 byte data

84
Random Access on
CD-ROM

 Difficult
 Move head to rough position
 Set correct speed
 Read address
 Adjust to required location
 (Yawn!)

85
CD-ROM for & against

 Large capacity (?)


 Easy to mass produce
 Removable
 Robust

 Expensive for small runs


 Slow
 Read only
86
Other Optical Storage

 CD-Writable
 WORM
 Now affordable
 Compatible with CD-ROM drives
 CD-RW
 Erasable
 Getting cheaper
 Mostly CD-ROM drive compatible

87
DVD - what’s in a name?

 Digital Video Disk


 Used to indicate a player for movies
 Only plays video disks
 Digital Versatile Disk
 Used to indicate a computer drive
 Will read computer disks and play video disks
 Dogs Veritable Dinner
 Officially - nothing!!!

88
DVD - technology

 Multi-layer
 Very high capacity (4.7G per layer)
 Full length movie on single disk
 Using MPEG compression
 Finally standardized (honest!)
 Movies carry regional coding
 Players only play correct region films
 Can be “fixed”
89
DVD - Writable

 Loads of trouble with standards


 First generation DVD drives may not read first
generation DVD-W disks
 First generation DVD drives may not read CD-
RW disks
 Wait for it to settle down before buying!

90
Foreground Reading

 Check out optical disk storage options


 Check out Mini Disk

91
Magnetic Tape

 Serial access
 Slow
 Very cheap
 Backup and archive

92
Digital Audio Tape (DAT)

 Uses rotating head (like video)


 High capacity on small tape
 4Gbyte uncompressed
 8Gbyte compressed
 Backup of PC/network servers

93
Soal

1. Apa itu memori?


2. Asal dari suatu memori
3. Beda dari RAM ROM
4. Apa itu memori internal dan eksternal

IUS HWNet- 94

Anda mungkin juga menyukai