Professional Documents
Culture Documents
Computer Architecture
Course ID: IT3283
Chương 6
BỘ NHỚ MÁY TÍNH
§ Bộ nhớ ngoài:
§ các thiết bị lưu trữ
§ Dung lượng
§ Độ dài từ nhớ (tính bằng bit)
§ Số lượng từ nhớ
Bộ vi xử lý
CPU
Tập Thiết bị
Bộ nhớ
thanh Cache lưu trữ
chính
ghi (HDD, SSD)
Bộ nhớ
mạng
n Bộ nhớ lý tưởng
n Thời gian truy nhập như SRAM
n Dung lượng và giá thành như ổ đĩa cứng
L1 L2
C C Memory
CPU a a bus
Memory Storage
Registers c c
h h
e e
Flash
memory
Register Level 1 Level 2 Memory
reference
reference Cache Cache reference
reference reference
Size: 1000 bytes 64 KB 256 KB 1– 2 GB 4– 64 GB
Speed: 300 ps 1 ns 5-10 ns 50 –100 ns 25 – 50 us
L1 L2 L3
C C C Memory
CPU a a a bus
Memory Storage
Registers c c c
h h h
e e e
Flash
NKK-CA2021.1.0 IT3283-Kiến trúc máy tính 11
memory
Register Level 1 Level 2 Level 3 Memory
h h
e e
Flash
L1 L2 L3
C C C Memory
CPU a a a bus
Memory Storage
Registers c c c
h h h
e e e
Flash
memory
Register Level 1 Level 2 Level 3 Memory
reference
reference Cache Cache Cache reference
reference reference reference
L1 L2 L3
C C C Memory Disk storage
CPU a a a bus I/O bus
Memory
Registers c c c
h h h
e e e Flash storage
NKK-CA2021.1.0 IT3283-Kiến trúc máy tính 12
Register Level 1 Level 2 Level 3 Memory
Register Level 1 Level 2 reference
reference Cache Cache Cache reference
reference
Phân cấp bộ nhớ cho máy chủ
reference reference
L1 L2 L3
C C C Memory Disk storage
CPU a a a bus I/O bus
Memory
Registers c c c
h h h
e e e Flash storage
Figure 2.1 The levels in a typical memory hierarchy in a personal mobile device (PMD), such as a cell phone or
tablet (A), in a laptop or desktop computer (B), and in a server (C). As we move farther away from the processor, the
memory in the level below becomes slower and larger. Note that the time units change by a factor of 109 from pico-
seconds to milliseconds in the case of magnetic disks and that the size units change by a factor of 1010 from thou-
sands of bytes to tens of terabytes. If we were to add warehouse-sized computers, as opposed to just servers, the
capacity scale would increase by three to six orders of magnitude. Solid-state drives (SSDs) composed of Flash are
used exclusively in PMDs, and heavily in both laptops and
NKK-CA2021.1.0 desktops.
IT3283-Kiến Intính
trúc máy many desktops, the primary storage system is13
SSD, and expansion disks are primarily hard disk drives (HDDs). Likewise, many servers mix SSDs and HDDs.
Nguyên lý cục bộ hoá tham chiếu bộ nhớ
§ Trong một khoảng thời gian đủ nhỏ CPU
thường chỉ tham chiếu các thông tin trong
một khối nhớ cục bộ
§ Ví dụ:
§ Cấu trúc chương trình tuần tự
§ Vòng lặp có thân nhỏ
§ Cấu trúc dữ liệu mảng
0
1
2
3
4
5
6
...
AN-1 - A0 i
...
D7 - D0
Băng 1 Băng 0
1 0
3 2
5 4
7 6
9 8
... ...
AN-1 - A1 2i+1 2i
... ...
BE1 BE0
D15 - D8 D7 - D0
...
... ... ...
Bộ nhớ
CPU cache
chính
...
...
Lm-1
BP-1
Bộ nhớ
Tag Cache chính
Nbit địa chỉ bộ nhớ
L0 B0
Tag Line Word
... ...
X Li Bj
X
So sánh
... ...
cache miss
Bộ nhớ
Tag Cache chính
N bit địa chỉ bộ nhớ
L0 B0
Tag Word
T bit W bit L1 B1
... ...
X
Li Bj
X
cache miss
Ít sử dụng
§ NKK-CA2021.1.0 IT3283-Kiến trúc máy tính 41
Ánh xạ liên kết tập hợp
§ Dung hòa cho hai phương pháp trên
§ Cache đươc chia thành các Tập (Set)
§ Mỗi một Set chứa một số Line
§ Ví dụ:
§ 4 Line/Set à 4-way associative mapping
§ Ánh xạ theo nguyên tắc sau:
§ B 0 à S0
§ B 1 à S1
§ B 2 à S2
§ .......
Bộ nhớ
Tag Cache chính
Nbit địa chỉ bộ nhớ L0 B0
L1 B1
Tag Set Word S0
L2 B2
L3 B3
T bit S bit W bit
L4 B4
L5 B5
S1
L6
L7
...
...
So sánh
X Sk X
...
cache hit ...
Sv-1
cache miss
Tag Word
27 bit 5 bit
Surface 9
Platter
Surface 8
Surface 7
Surface 2
SN
S5
Surface 1
S5
S1
Surface 0
S1
S4
S4
S2
S3
S2 Spindle Boom
S3
b0 b1 b2 b3 P(b)
RAID 5 & 6
block 8 block 9 block 10 block 11 P(8-11)
block 12 block 13 block 14 block 15 P(12-15)
RAID 0 FOR HIGH DATA TRANSFER CAPACITY The performance of any of the
RAID levels depends critically on the request patterns of the host system and on
NKK-CA2021.1.0 the layout of the data. TheseIT3283-Kiến
issues cantrúc
bemáy tínhclearly addressed in RAID 0, where
most 61
the impact of redundancy does not interfere with the analysis. First, let us consider
Kiến trúc máy tính
Hết chương 6