---
# System prepended metadata

title: 計算機組織110
tags: [thu, co]

---

###### tags: `co` `thu`

# 計算機組織110

## 1.(10%) 請說明在 DRAM 內部定址設計上，是如何做到位址線接腳數可以用到較少的數目。請以 16Mbit DRAM 晶片為例。
- A $16Mbits$ chip can be organised as a $2048\times 2048\times 4bits$ array
- Multiplex row address and column address
- $16Mbits=16M$ cell$\times bit=4M$ cell $\times 4bit$
- $4M=2^{22}$(22 addrress lines, $A_0~A_{21}$)
- $2^{22}=2^{11}(Row)\times 2^{11}(Column)$
- $11$ pins to address($2^{11}=2048$)
- Adding one more pin double range of values so $\times 4$ capacity($2^{12}\times 4$ Capacity with $2^{11}$)

## 2.(30%) Please draw these two cache diagrams for MIPS, this cache specification of processor is listed as bellows: 
- The size of maximum memory (RAM) space is 4G Bytes 
- The size of cache memory is 4K Bytes 
- Cache line size is 4 Bytes (32bits) 
- You can refer the following cache diagram of MIPS (4-way) for drawing MIPS processor cache diagram

(a) Please draw the diagram for Direct Mapping (1-way set-associated) cache (tag ?bit : line ?bit : word ?bit), please calculate the total SRAM space needed for this 4KB cache memory. 

$4G=2^{32}$，需要$32bits$
$4=2^2$，word有$2bits$
$\frac{4M}{4}=2^{10}$，line有$10bits$
$32-2-10=20$，tag有$20bits$
$\frac{32+20+1}{32}\times 4KB=6.625KB$

(b) Please draw the diagram for 2-way set-associated cache (tag ?bit : set ?bit : word ?bit), please calculate the total SRAM space needed for this 4KB cache memory.

$4GB=2^{32}bytes$，address line 總共有32條
$4Bytes = 2^{2}$，word共2bits
$\frac{4MB}{4B}=2^{10}$，在direct mapping的情況下line有10bits，2-way set-associate的情況下，set則為$10-1=9bits$
$tag = 32-9-2=21bits$
$\frac{32+(32-9-2)+1}{32}=\frac{54}{32}\times 4KB=6.75KB$

(c) Please draw the diagram for 8-way set-associated cache (tag ?bit : set ?bit : word ?bit), please calculate the total SRAM space needed for this 4KB cache memory.

$4GB=2^{32}bits$，address line 總共有32條
$4Bytes=2^{2}$，word共2bits
$\frac{4MB}{4B} = 2^{10}$，$10-3=7$，set則為7bits
$tag=32-2-7=23$
$\frac{32+23+1}{32}=\frac{56}{32}\times 4KB=7KB$

## 3.(15%) Please calculate the average access time of this hard disk for transferring an 8GB video data file. As we known, the seek time of this HD is 2ms, spindle speed is 15000rpm, sectors per track is 512, and byes per sector is 4096 bytes (advanced format).

公式為
$$T_a=T_s+\frac{1}{2r}+\frac{b}{rN}$$
so：
$$T_a=2+\frac{1}{2\cdot 15000}+\frac{8\cdot 2^{30}}{15000\cdot 4096\cdot 512}$$

## 4.(15%) Please describe the functions and draw diagrams in detail for RAID 1, RAID 3, and RAID 5. 

RAID 1：
1、兩組以上硬碟相互做鏡像
2、Data is striped across disks
3、兩份複製的資料分別放在不同的disk
4、Read from either
5、Write to both
6、回復容易(更換disk後重新做鏡像)
7、昂貴

| DISK1 | DISK2 |
| -------- | -------- | 
| $A1$     | $A1'$     |
| $A2$     | $A2'$     |
| $A3$     | $A3'$     |
| $A4$     | $A4'$     |

RAID 3：
1、只有一個磁碟是多餘的
2、使用同位元錯誤檢測碼，資料遺失時可用此技術重建資料
3、轉移速率高

| DISK1 | DISK2 |DISK3 |
| -------- | -------- |-------- | 
| $A1$     | $A2$     |$P_{A1、A2}$     |
| $A3$     | $A4$     |$P_{A3、A4}$     |
| $A5$     | $A6$     |$P_{A5、A6}$     |
| $A7$     | $A8$     |$P_{A7、A8}$     |

RAID 5：
1、同位元錯誤檢測循環分配在每個磁碟
2、N個disk用戶需要N+1個disk
3、常用於網路服務器

| DISK1 | DISK2 |DISK3 |
| -------- | -------- |-------- | 
| $A1$     | $A2$     |$P_{A1、A2}$     |
| $A3$     | $P_{A3、A4}$     |  $A4$   |
| $P_{A5、A6}$    | $A6$     |$A5$     |

## 5.(15%) Please describe the functions (six steps) of DMA in detail. Please use this figure to explain.



## 6.(7%) 請問下列各種 RAID 方法，至少需要幾顆硬碟才可以達到其功能？

RAID 0:2
RAID 1:2
RAID 2:3
RAID 3:3
RAID 4:3
RAID 5:3
RAID 6:4
RAID 10：4
RAID 50：6
RAID 60：8

## 7.(5%) Please describe the functions of Data Buffering.

1、資料以快速突發的方式從主記憶體傳輸到I/O設備
2、資料在I/O設備中緩衝再以它本身的速度傳送至電腦周邊的設備

## 8. (10%) 請問在 TrueNAS 作業中，您學到了什麼？請詳述之。

![](https://i.imgur.com/hjedsMv.jpg)